A demo article, \(\pi \)

Peter Krautzberger

Abstract.

This test file demonstrates various features of the AMS’s texml and texml-to-html tools.

The thanks macro is often (ab)used for information regarding funding.

A section without a name is bad practice and can even be a WCAG failure. Don’t do it.

Check how the math mode in the title comes out in the HTML title tag.

1. Introduction

Theorem 1 (Theorem with footnotes, fig/bib references, and links to a math fragment later in the document).

Theorems (and other enunciations) are a central part of mathematical writing. They can contain all sorts of complex content, including other enunciations.

For example, Figure 2 and [2].⁠1

1

And also footnotes within theorems.

(i)

A list item.

(ii)

A list item.

A link to a math fragment that comes after this one: Theorem 6.

Here’s a reference to the theorem, 1, but consider cleveref, Theorem 1, which produces larger hitboxes in HTML (to meet WCAG).

And here’s a reference to one of its list items, namely i.

Theorem 2 (Theorem with a title).

If a theorem is not referenced, does it make a sound?

Theorem 3 (Theorem within a theorem).

Inception. Some people actually do this.

Of course theorems need proofs.

Proof.

This is a proof with has-qed-box on a child equation.

\[ {\text{A display equation without reference}} \]
Proof.

This is a proof with has-qed-box on a child paragraph.

Hello.

Proof.

This is a proof with a sub-proof.

Proof.

This is a nested proof without has-qed-box attribute.

2. Random stuff in headings: \(x^2\), tag with math \(x\)

Figure 1.

For better references and accessibility always prefer the subfigure environment over manually labeled or otherwise hacked combinations of graphics.

(a)

A rounded blue square overlaying a rounded red square, shifted approx. one third downward right

Graphic without alt text
(b)

The same image, scaled down by half

Graphic without alt text

A reference to a figure in a figure group: 1(b).

2.1. Subsection Kitch’n’Sink.

Theorem 4 (Theorem within a subsection).

With some content.

2.1.1. Subsubsection Sink’n’Kitsch.

Theorem 5 (Theorem within a subsubsection).

With some content.

Remark 6.

Another standard enunciation is the remark.

You can define your own theorem styles. While some aspects (e.g. punctuation) will be preserved during processing, you have a data attribute in HTML to build your own web-based version of the layout.

Theorem 2.1. —

A custom theorem style.

3. Tables, references, figures

A reference to a table 1.

Table 1.

Tables generally work; texml will generate custom CSS which you need to integrate.

Alignment \(K\)Shouldget through
23305677
Another tablewhich is side-by-side in PDF

If you have a footnote⁠2 and reference that footnote 2 multiple times, this demo won’t do it well (and maybe you should rethink using a footnote when it’s important enough to reference twice).

2

Footnote with multiple references

Here’s an inline equation with links \(a \overset{{\text{(\xhref[disp-formula]{#mathFn}{tag with math $x$}), \xhref[statement]{#ltxid16}{4}, \xhref[sec]{#ltxid15}{2.1}, [\xhref[bibr]{#bibr-bproc14}{2}], \xhref[table]{#ltxid22}{1}, \xhref[figure]{#ltxid13}{1(a)}, \xhref[algorithm]{#ltxid40}{1}}}}{=} b\)

\[\begin{equation} {\text{An equation with a footnote}} ⁠\xhref[fn]{#ltxid24}{{}^{3}} \cssId{mathFn}{\tag{tag with math $x$}} \end{equation}\]

3

A footnote within math mode

You can use eqref as well (tag with math \(x\)).

You can include graphics inline: Graphic without alt text; this one provides alt text.

4. Lists, text styles and more

When using text styles, be mindful that the web has other traditions than print (e.g., underline and blue make people think of links).

(a)

Italic text, roman text inside.

(b)

Small Caps.

(c)

Bold.

(d)

Monospace.

(e)

Oblique.

(f)

Sans-serif.

(g)

Underlined.

(h)

basesuperscript.

(i)

basesubscript.

Note how the above used the enumerate package. Lists are difficult to map to HTML because TeX allows on-the-fly changes to the marker, e.g.,

a normal item

not

a normal item

Note that texml/texml-to-html map all lists to HTML’s DL element; also because markers are important for accessibility in longform (e.g., when referenced).

Here’s a description list environment.

Term

Description.

A reference to a table 4 without label.s

A table without label. With inline Graphic without alt text tikz graphics.

Is a table without a name a table at all? don’t use blue text

Subequations can be tricky due to the ”global” label:

1
\[\begin{align} a \tag{1a}\\ b \cssId{subsubequation}{\tag{1b}} \end{align}\]

The entire group: (1); a particular subequation 1b.

A tikz diagram inside math-mode that is turned into SVG (with the surround math mode preserved):

\[\begin{equation} x = \vcenter{\img[][86pt][86pt][{Graphic without alt text}]{Images/imgfa9262243fe836a009d1b555c3b44123.svg}} \cssId{tikzPic}{\tag{2}} \end{equation}\]

The textcolor macro: blue text. The colorbox macro: pink background. The fcolorbox macro: violet frame with lime background but no border in text mode, see AmerMathSoc/texml#276.

Be mindful of WCAG’s color contrast requirements - no red/yellow/cyan-on-white, please!

Algorithm 1.

Calculate \(y = x^n\)

Require: \(n \geq 0 \vee x \neq 0\) Ensure: \(y = x^n\) \(y \leftarrow 1\) if \(n < 0\) then \(X \leftarrow 1 / x\) \(N \leftarrow -n\) else \(X \leftarrow x\) \(N \leftarrow n\) end if while \(N \neq 0\) do if \(N\) is even then \(X \leftarrow X \times X\) \(N \leftarrow N / 2\) else \(N\) is odd \(y \leftarrow y \times X\) \(N \leftarrow N - 1\) end if end while

5. Quotations and other trouble

Below is a quote:

Many times, the quote environment is abused as a call-out.

The center environment is too often abused for call-outs.

A macro from dbnsymb - \(\actsonleft \) - requires a custom MathJax extension.

The framed environment.

Here is a tcolorbox example.

No real heading structure

Usually a bit of text around.

Subtables:

Table 2.

Table with subtables

(a)

First Table

A
(b)

Second Table

B
Proof.

Nested proofs are surprisingly common. Also enunciations within proofs. This goes against amsart style guide - long proofs should be sections.

Proof.

If an inner proof has a qed, then the outer one usually needs disabling.

6. Miscellanea

6.1. Cleveref ranges.

Use cleveref if you can - you’ll generate bigger hitboxes for your cross-references.

You will also get ranges: sections 6.1.1 to 6.1.3.

6.1.1. And a one.

6.1.2. And a two.

6.1.3. And a one, two, three.

6.2. Footnotes in section titles can be iffy ⁠4.
4

A footnote in a section title

Theorem 7 (5).
5

Footnote in title

Another theorem.

A pithy graph, epigraph

Anonymous

A verse
is fine.

Appendix A. Appendix

This is fine.

References

[1]
Michael Drmota and Stefan Gerhold. Disproof of a conjecture by rademacher on partial fractions, 2013.
[2]
Michael Drmota and Stefan Gerhold. Disproof of a conjecture by rademacher on partial fractions. Proceedings of the American Mathematical Society, Series B, 1(11):121–134, 2014.