[LON-CAPA-cvs] cvs: loncom /html/adm/help/tex Authoring_Output_Tags.tex
felicia
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 04 Aug 2008 22:02:26 -0000
felicia Mon Aug 4 18:02:26 2008 EDT
Modified files:
/loncom/html/adm/help/tex Authoring_Output_Tags.tex
Log:
Added documention for num format attribute. Added info from Authoring_M_Tag.tex to this file. Cleaned up text so it prints and and looks pretty on the web.
Index: loncom/html/adm/help/tex/Authoring_Output_Tags.tex
diff -u loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.7 loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.8
--- loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.7 Mon May 21 12:43:17 2007
+++ loncom/html/adm/help/tex/Authoring_Output_Tags.tex Mon Aug 4 18:02:26 2008
@@ -6,30 +6,36 @@
\begin{itemize}
\item \textbf{algebra}\index{algebra}: Typesets algebraic expressions
\begin{verbatim}
- <algebra>2x^y+sqrt(3/x^2)</algebra>
+<algebra>2x^y+sqrt(3/x^2)</algebra>
\end{verbatim}
+Expressions are displayed using the math expression display mechanism defined in the user's preferences. The default is tth. See the section below concerning the $<$m$>$ tag for more information.
\item \textbf{chem}\index{chem}: Typesets chemical equation
\begin{verbatim}
<chem>02 + 2H2 -> 2H20</chem>
\end{verbatim}
-\item \textbf{num}\index{num}: Typesets a number
+\item \textbf{num}\index{num}: Typesets a number formatted in scientific notation, fixed point, fixed point with commas, fixed point with commas and dollar sign, or in significant digits.
\begin{verbatim}
- <num format=''2E''>31454678</num>
+ <num format="2E">31454678</num>
+ <num format="2f">31454678</num>
+ <num format="2f">31454678</num>
+ <num format=",2f">31454678</num>
+ <num format="$2f">31454678</num>
+ <num format="2s">31454678</num>
\end{verbatim}
\item \textbf{parse}\index{parse}: to display the parsed view of a variable's
contents
\begin{verbatim}
- <script type=''loncapa/perl''>
- $table='<table>';
+ <script type="loncapa/perl">
+ $table=`<table>';
for ($i=1;$i<=10;$i++) {
- $table.='<tr><td>'.$i.'</td><td>'.&random(1,10,1).'</td></tr>';
+ $table.=`<tr><td>'.$i.`</td><td>'.&random(1,10,1).`</td></tr>';
}
- $table.='</table>';
+ $table.=`</table>';
</script>
- <parse>\$table</parse>
+ <parse>$table</parse>
\end{verbatim}
-\item \textbf{standalone}\index{standalone}: Everything inbetween the
+\item \textbf{standalone}\index{standalone}: Everything in between the
start and end tag is shown only on the web and only if the resource
is not part of a course.
\item \textbf{displayduedate}\index{displayduedate}: This will insert the
@@ -105,23 +111,42 @@
\item \textbf{window}\index{window}: This creates a link that when clicked shows the intervening information in a pop-up window. By default the window will be 500 pixels wide and 200 pixels tall, and the link text will be a superscript * (so as to look like a footnote). These can be changed using the attributes
\begin{itemize}
-\item[width] controls the starting width of the popup window
-\item[height] controls the starting height of the popup window
-\item[linktext] the text that should appear as the link that causes the creation of the window
+\item \textbf{width} controls the starting width of the popup window
+\item \textbf{height} controls the starting height of the popup window
+\item \textbf{linktext} the text that should appear as the link that causes the creation of the window
\end{itemize}
-When printing this included text will get turned into a real footnote.
+When printing, this included text will get turned into a real footnote.
\item \textbf{m}\index{m}: The inside text is \LaTeX{}, and is converted
-to HTML (or MathML) on the fly. If the attribute \textbf{eval} is set
-to {}``\textbf{on}'' the intervening text will have a perl variable
-expansion done to it before being converted. The default is to convert
-to the display mechanism that the user has selected. This can be
+to HTML (or MathML) on the fly. The default is to convert
+to the display mechanism that the user has selected in preferences. This can be
overriden by setting the attribute \textbf{display} to one of
``\textbf{tth}'' or ``\textbf{jsMath}'' or ``\textbf{mimetex}''which
will force a specfic display mechanism.
+If you want variables inside of this tag to be evaluated before the
+tex gets converted, then use eval=``on'' \index{eval=on}. For
+example, $<$m eval=``on''$>$\textbackslash{}[\$eqn\textbackslash{}]$<$/m$>$,
+will evaluate the variable \$eqn first and then run it through the
+TTH\index{TTH} converter. Anytime you use a variable inside of the m tag,
+you will want to set eval to on.
+
+For example, put the following in a script in the resource:
+
+\texttt{\$eqn = "\$a+\$b";}
+
+\texttt{\$eqn =~ s/\textbackslash{}+-/-/g;}
+
+and in a text area, you can type:
+
+\texttt{<m eval=``on''>\$eqn</m>}
+
+You will get the equation rendered with no +-, no matter what value
+\$b may take on.
+
+
\item \textbf{randomlabel}\index{randomlabel}: This shows a specified image
with images or text labels randomly assigned to a set of specific
locations. Those locations may also have values assigned to them.