version 1.26, 2017/02/01 21:18:43
|
version 1.27, 2021/01/22 17:16:31
|
Line 8 This group of tags generates useful outp
|
Line 8 This group of tags generates useful outp
|
\begin{verbatim} |
\begin{verbatim} |
<algebra>2x^y+sqrt(3/x^2)</algebra> |
<algebra>2x^y+sqrt(3/x^2)</algebra> |
\end{verbatim} |
\end{verbatim} |
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. |
Expressions are displayed using the math expression display mechanism for the current context. The default is to use |
|
the display mechanism the user has selected in preferences. This can be overriden by setting the \textbf{display} attribute for the tag. See the section below concerning the $<$m$>$ tag for more information on how the default is set and on the display attribute. |
|
|
Recognized functions are all trigonometric functions, and the following: |
Recognized functions are all trigonometric functions, and the following: |
exp, abs, logten, log, ln, sqrt, sgn, step, fact, int, lim, funX. |
exp, abs, logten, log, ln, sqrt, sgn, step, fact, int, lim, funX. |
Line 175 to HTML (or MathML) on the fly. The defa
|
Line 176 to HTML (or MathML) on the fly. The defa
|
to the display mechanism that the user has selected in preferences. This can be |
to the display mechanism that the user has selected in preferences. This can be |
overriden by setting the attribute \textbf{display} to one of |
overriden by setting the attribute \textbf{display} to one of |
``\textbf{tth}'', ``\textbf{mimetex}'' or ``\textbf{mathjax}'' which |
``\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. |
will force a specific display mechanism. Note that the ``\textbf{jsmath}'' display is deprecated today, and MathJax is used instead when it is specified. If a display attribute is not included, the display mechanism is determined in the following order, with the first one set being the one in effect: |
|
\begin{enumerate} |
|
\item In course context: Course-wide default set by Course Coordinator via Settings $>$ Course Settings $>$ Display of resources $>$ Force use of a specific math rendering engine |
|
\item User's own personal preference set by the user hovering over the user's name at top left of a LON-CAPA page, and selecting Preferences $>$ Math display settings |
|
\item Domain default set by a Domain Coordinator |
|
\item System default set for the LON-CAPA version installed on the server (tth in 2.11 and earlier, mathjax in 2.12). |
|
\end{enumerate} |
|
|
The contents of \texttt{<m> </m>} are interpreted as LaTeX outside math environment, which is why using \texttt{<m>\$ \$</m>} 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{<m> </m>} 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. |
The contents of \texttt{<m> </m>} are interpreted as LaTeX outside math environment, which is why using \texttt{<m>\$ \$</m>} 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{<m> </m>} 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 |
If you want variables inside of this tag to be evaluated before the |
tex gets converted, then use eval=``on'' \index{eval=on}. For |
tex gets converted, then use eval=``on'' \index{eval=on}. For |
example, \texttt{<m eval="on">\$ \$eqn \$</m>}, |
example, \texttt{<m eval=''on''>\$ \$eqn \$</m>}, |
will evaluate the variable \$eqn first and then use the |
will evaluate the variable \$eqn first and then use the |
display mechanism. Anytime you use a variable inside of the m tag, |
display mechanism. Anytime you use a variable inside of the m tag, |
you will want to set eval to on. |
you will want to set eval to on. |
Line 194 For example, put the following in a scri
|
Line 201 For example, put the following in a scri
|
|
|
and in a text area, you can type: |
and in a text area, you can type: |
|
|
\texttt{<m eval="on">\$ \$eqn \$</m>} |
\texttt{<m eval=''on''>\$ \$eqn \$</m>} |
|
|
You will get the equation rendered with no +-, no matter what value |
You will get the equation rendered with no +-, no matter what value |
\$b may take on. |
\$b may take on. |