jemdoc – latex equations

jemdoc-cvx renders equations server-side with KaTeX at build time. LaTeX source embedded in a jemdoc file is piped through the katex CLI, and the resulting HTML is embedded directly in the page — no client-side JavaScript is required to view rendered math.

KaTeX supports a large subset of LaTeX but not everything MathJax does. Cross- referencing macros (\label, \eqref) and some amsmath constructs are unsupported and render with a small red error indicator. Adjust the input or load a client-side renderer via a conf override if you need full MathJax features.

Inline equations

The conjugate function f(y)=supxX(yTxf(x))f^\star(y) = \sup_{x \in X}(y^Tx - f(x)) appears here inline, and is in the variable yy. Dollar signs ($) surround the LaTeX equation in the jemdoc source.

Syntax
The sample function $f^\star(y) = \sup_{x \in X}(y^Tx - f(x))$
appears here inline, and is in the variable $y$.

Equations on separate lines

To render an equation on its own line, use backslash-escaped round brackets (\( and \)). For example, the identity

(I+XY)1=IX(I+YX)1Y (I + XY)^{-1} = I - X(I + YX)^{-1}Y

is typeset on its own line. Yes, round brackets instead of square brackets — this is to avoid a conflict with ordinary square brackets that are escaped to avoid being a link. Sorry.

Syntax
The identity
\(
    (I \+ XY)^{-1} = I - X(I \+ YX)^{-1}Y
\)
is typeset on its own line.

Here, the line breaks (and other whitespace) are ignored. As always, the exact formatting details can be adjusted using CSS.

Notes

f(x)={3,x05,x>0. f(x) = \left\{ \begin{array}{ll} 3, & x \leq 0 \\ 5, & x > 0. \\ \end{array}\right.

(You can view the jemdoc source for this page.)