[LON-CAPA-cvs] cvs: loncom /html/adm/help/tex Authoring_Output_Tags.tex

damieng damieng at source.lon-capa.org
Fri Jan 20 19:02:05 EST 2017

damieng		Sat Jan 21 00:02:05 2017 EDT

  Modified files:              
    /loncom/html/adm/help/tex	Authoring_Output_Tags.tex 
  added doc for <lm>
Index: loncom/html/adm/help/tex/Authoring_Output_Tags.tex
diff -u loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.23 loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.24
--- loncom/html/adm/help/tex/Authoring_Output_Tags.tex:1.23	Thu Jan 19 21:12:45 2017
+++ loncom/html/adm/help/tex/Authoring_Output_Tags.tex	Sat Jan 21 00:02:05 2017
@@ -178,6 +178,76 @@
 \$b may take on.
+\item \textbf{lm}\index{lm}: This is another way to input math, which does not require
+knowing \LaTeX{}.
+The lm syntax describes mathematical operations rather than appearance (as opposed to LaTeX, which describes how the math should appear). Display is the same when the math operations are the same, for instance 2*(x) will be displayed just like 2x. One advantage to that system is that math will be displayed in a consistent way, even when written by several authors. The drawback is that display cannot be chosen precisely.
+Eventually, this syntax will also be used to evaluate \texttt{<formularesponse>} (it is already used for the real-time preview).
+    Spaces are always ignored.
+\item[Decimal separators and function parameter separators]~\\
+    To keep compatible with previous \texttt{<formularesponse>} syntax, only ``.'' can be used as a decimal separator, and ``,'' is used to separate function and vector/matrix parameters.
+\item[Variables and constants]~\\
+    Variable names and constant names are used directly, without any special character before. They are displayed in italics.
+    Unit names are used directly. They are displayed with a straight font. LON-CAPA has a list of known units and a list of known constants to differentiate them in units mode.
+    Parenthesis can be used to specify evaluation order. They are only displayed when necessary.
+    arithmetic: \texttt{+ - * / \^{}}\\
+    factorial: \texttt{!}\\
+    relational: \texttt{= \# < <= >= >}\\
+    units: \texttt{`}\\
+    Example: \texttt{2`m + 3`m = 5`m}\\
+    scalar product for vectors, multiplication for matrices: \texttt{.}\\
+\item[Implicit operators]~\\
+    \texttt{*} and \texttt{`} are implicit.
+    The parser will try to guess which operator is missing whenever possible. The choice between * and ` depends on the mode for interpreting equations.
+    Example: \texttt{2c+3m/s} is understood in unit mode to be \texttt{2*c + 3`(m/s)}. In symbolic mode, it would be interpreted \texttt{2*c + (3*m)/s} (m and s being variables).
+    Functions use the syntax \texttt{f(a,b)}.
+        basic:
+        \quad \texttt{sqrt(x)}, \texttt{abs(x)}, \texttt{exp(x)=e\^{}x}, \texttt{factorial(x)=x!}
+        binomial (displayed like a vector):
+        \quad \texttt{binomial(n,p)=n!/(p!*(n-p)!)}
+        sum and product (requiring symbolic mode):
+        \quad \texttt{sum(f(x),x,x1,x2)}, \texttt{product(f(x),x,x1,x2)}
+        differential, integral, limit:
+        \quad \texttt{diff(expr,x,n)}, \texttt{integrate(expr,x,a,b)}, \texttt{limit(expr,x,val,dir)}
+\item[Vectors and matrices]~\\
+    Vectors and matrices are defined with square brackets. A matrix is made of a list of row vectors.
+        vectors: \texttt{[1,2,3]}\\
+        matrices: \texttt{[[1,2],[3,4]]}
+    Sets are defined with curly brackets: \texttt{\{1,2,3\}}
+        union: \texttt{union(\{1,2\},\{1,3\}) = \{1,2,3\}}\\
+        intersection: \texttt{intersection(\{1,2\},\{1,3\}) = \{1\}}
 \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.

More information about the LON-CAPA-cvs mailing list