File:
[LON-CAPA] /
loncom /
html /
adm /
help /
tex /
Authoring_Equations.tex
Revision
1.3:
download - view:
text,
annotated -
select for diffs
Wed Feb 1 21:18:43 2017 UTC (7 years, 9 months ago) by
damieng
Branches:
MAIN
CVS tags:
version_2_12_X,
version_2_11_X,
HEAD
added doc for math, chem, hints, customresponse, essayresponse, organicresponse, reactionresponse
\label{Authoring_Equations}\index{equations}
\index{Latex}\index{tex}\index{math equations}LON-CAPA renders math using LaTeX,
and the LaTeX syntax is usually used to create equations (see \textbf{lm} in \ref{Authoring_Output_Tags} for an alternative).
LaTeX equations can be entered directly in the source with the text editor,
within \texttt{<m>\$~\$</m>} tags. When the browser has support for Java applets,
the DragMath editor can also be used to generate LaTeX.
To start DragMath in the text editor, insert the cursor at the desired equation location and click on the `Edit Math' button.
At the bottom of the DragMath pop-up is a `Render LaTeX' button that will insert the DragMath expression as LaTeX within \texttt{<m>\$ \$</m>} tags in the text.
The DragMath editor may not offer the template that you need, or the expression may not appear as you expect. The most powerful method of entering math or touching up DragMath output is to learn about the LaTeX syntax. An Internet search for ``LaTeX math quick reference'' will result in many resources.
To create equations in CKEditor (the WYSIWYG editor launched with the ``Rich formatting'' link),
you can use the $\Sigma$ button. It requires knowing the LaTeX syntax, but provides a real-time preview. Equations can be edited with a double-click on the rendering.
Within the \texttt{<m>} tag, additional tags control the display of LaTeX math. The \$ open and closing syntax will create an inline equation. To create an equation in a separate paragraph, use double signs, \$\$. Alternative notations are also accepted, \textbackslash{}( opening with \textbackslash{}) closing can be used for an inline equation, and \textbackslash{}[ opening with \textbackslash{}] closing results in a separate paragraph. The \$ and \$\$ methods are recommended as ``LaTeX robust'' and the \textbackslash{}( and \textbackslash{}[ methods are considered ``LaTeX fragile.'' The robust methods should be used if the fragile methods result in unexpected behavior.
Some simple sytax from common LaTeX math:
\begin{itemize}
\item \texttt{\symbol{92}frac\{numerator\}\{denominator\}} results in $\frac{numerator}{denominator}$
\item \texttt{\^{}} superscript, e.g. \texttt{x\^{}2} results in $x^{2}$
\item \_ subscript, e.g. \texttt{x\^{}2\_i} results in $x^{2}_i$
\item use \texttt{\{} and \texttt{\}} as delimiters, e.g. \texttt{x\_\{upper\}} for $x_{upper}$
\end{itemize}
See \textbf{m} in \ref{Authoring_Output_Tags} for more information about it.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>