--- loncom/html/adm/help/tex/Authoring_Output_Tags.tex 2011/12/19 18:00:19 1.14 +++ loncom/html/adm/help/tex/Authoring_Output_Tags.tex 2017/01/19 21:12:45 1.23 @@ -4,23 +4,31 @@ This group of tags generates useful output. \begin{itemize} -\item \textbf{algebra}\index{algebra}: Typesets algebraic expressions +\item \textbf{algebra}\index{algebra}\index{format algebra}: Typesets algebraic expressions \begin{verbatim} 2x^y+sqrt(3/x^2) \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 on that as well as on the attribute \textbf{display}. -\item \textbf{chem}\index{chem}: Typesets chemical equation +Expressions are displayed using the math expression display mechanism defined in the user's preferences. See the section below concerning the $<$m$>$ tag for more information on that as well as on the \textbf{display} attribute. + +Recognized functions are all trigonometric functions, and the following: +exp, abs, logten, log, ln, sqrt, sgn, step, fact, int, lim, funX. +\item \textbf{chem}\index{chem}\index{format reaction}: Typesets chemical equation : \begin{verbatim} O2 + 2H2 -> 2H2O \end{verbatim} -\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. +will be rendered: + +$\mathrm{O_2} + 2\,\mathrm{H_2} \to 2\,\mathrm{H_2O}$ +\item \textbf{num}\index{num}\index{format number}: 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} - 31454678 - 31454678 - 31454678 - 31454678 - 31454678 - 31454678 + 31454678 results in 3.15 x 10^7 + 31454678 results in 31454678.00 + 31454678 results in 3.145 x 10^7 + 314.54678 results in 314.5 + 31454678 results in 31,454,678.00 + 31454678 results in $31,454,678.00 + 31454678 results in 31000000 + 31454678 results in 31,000,000 \end{verbatim} \item \textbf{parse}\index{parse}: to display the parsed view of a variable's contents @@ -114,17 +122,27 @@ in LON-CAPA style files. \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 +\item \textbf{printtext} the text that should appear instead of a footnote when printed \end{itemize} When printing, the included text will get turned into a real footnote. +\item \textbf{windowlink}\index{windowlink}: This creates a link to a resource that comes up in a pop-up window. The link will be the intervening information +between the start and the end tag. By default the window will be 500 pixels wide and 200 pixels tall. + +\begin{itemize} +\item \textbf{width} controls the starting width of the popup window +\item \textbf{height} controls the starting height of the popup window +\item \textbf{href} the address +\end{itemize} + \item \textbf{togglebox}\index{togglebox}: This creates a toggling box that can be clicked open and close. \begin{itemize} \item \textbf{heading} heading text of the box, by default no heading \item \textbf{headerbg} background color of the header, by default white -\item \textbf{showtext} the text that appears to make the box visible, by default the translation of 'show' -\item \textbf{hidetext} the text that appears to hide the box again, by default the translation of 'hide' +\item \textbf{showtext} the text that appears to make the box visible, by default the translation of `show' +\item \textbf{hidetext} the text that appears to hide the box again, by default the translation of `hide' \end{itemize} When printing, the included text will be rendered in a visible box. @@ -134,14 +152,16 @@ When printing, the included text will 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. Note, however, that setting the attribute \textbf{diplay} to \textbf{jsmath} is generally discouraged as it requires users to have installed jsmath software on their computer. +``\textbf{tth}'', ``\textbf{mimetex}'' or ``\textbf{mathjax}'' which +will force a specific display mechanism. Note that the ``\textbf{jsmath}'' display is deprecated today, and MathJax is used instead when it is specified. + +The contents of \texttt{ } are interpreted as LaTeX outside math environment, which is why using \texttt{\$ \$} is needed to switch to the LaTeX math environment. However, the ``\textbf{mathjax}'' display (which is used by default in recent versions of LON-CAPA) interprets all the contents of \texttt{ } as math, and does not support non-math LaTeX. For content to work well with all the display mechanisms, it is therefore important to never use non-math LaTeX for web targets. Even purely for printing, it is better to avoid using non-math LaTeX, as the printing mechanism might use HTML instead of LaTeX in the future. 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, +example, \texttt{\$ \$eqn \$}, +will evaluate the variable \$eqn first and then use the +display mechanism. 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: @@ -152,7 +172,7 @@ For example, put the following in a scri and in a text area, you can type: -\texttt{\$eqn} +\texttt{\$ \$eqn \$} You will get the equation rendered with no +-, no matter what value \$b may take on.