A sample post compiled from a real .tex file. It exercises macros,
theorems, numbered equations, cross-references, footnotes, tables, code,
citations and TikZ, so you can see how each one renders on the site.
Because the source is the document. Every post on this site starts as a
.tex file and is compiled with LaTeXML,11 The same converter
arXiv uses for its HTML papers. It actually runs your macros rather than
guessing at them. so custom macros like and just work.
Definition 1.
A function is convex if for all and
,
(1)
Theorem 1.
If is convex then .
Proof.
Apply (1) inductively to finite sums, then pass to the limit.
∎
Theorem1 is Jensen’s inequality [1]. Aligned
derivations work too:
(2)
(3)
2 Figures
TikZ and pgfplots are compiled by a real TeX engine to SVG, and
follow the site’s light or dark theme.22 Black in the source becomes
the current text colour.
Figure 1: A convex function and a chord above it.
3 Tables and code
Method
Iterations
Error
Gradient descent
1 200
Newton
8
Table 1: Convergence on a toy problem.
defdescend(f,grad,x,lr=0.1):
for_inrange(1000):
x=x-lr*grad(x)
returnx
References
[1]
J. L. W. V. Jensen.
Sur les fonctions convexes et les inégalités entre les valeurs moyennes.
Acta Mathematica, 30:175–193, 1906.
Notes
The same converter
arXiv uses for its HTML papers. It actually runs your macros rather than
guessing at them.
Black in the source becomes
the current text colour.