version 1.3, 2012/10/12 13:26:55
|
version 1.4, 2013/06/26 08:14:55
|
Line 1
|
Line 1
|
\label{Variables_in_the_Text_Block} |
\label{Variables_in_the_Text_Block} |
|
|
Once you've defined variables in the \textbf{Script}, you can use them in |
\index{variables in text block} |
|
Once you've defined variables in the \textbf{Script}, you can display them in |
the \textbf{Text Block}. For example, using the previous three-line script |
the \textbf{Text Block}. For example, using the previous three-line script |
we've created so far, you can place the following in the \textbf{Text Block}: |
we've created so far, you can place the following in the \textbf{Text Block}: |
|
|
See~the~3:~\$variable<br~/> |
\begin{lyxcode} |
|
See~the~3:~\$variable<br~/>\\ |
See~the~string:~<b>\$stringVar</b><br~/> |
See~the~string:~<b>\$stringVar</b><br~/> |
|
\end{lyxcode} |
% |
% |
\begin{figure} |
\begin{figure} |
\begin{center}\includegraphics{numericalResponseVarInText}\end{center} |
\begin{center}\includegraphics{numericalResponseVarInText}\end{center} |
Line 19 If you save that and hit \textbf{View},
|
Line 21 If you save that and hit \textbf{View},
|
was turned into a 3, and the {}``\$stringVar'' was turned into {}``I have |
was turned into a 3, and the {}``\$stringVar'' was turned into {}``I have |
a variable with the value 3.'' |
a variable with the value 3.'' |
|
|
|
If you a generating numbers by a formula by division, you will want to format your output. |
|
For example, if \$variable=1/3, it will display with too many digits. You can adjust the format |
|
using the \textbf{num} output tag \index{num output tag} \index{format numbers in text block} |
|
described in section \ref{Authoring_Output_Tags} |
|
|