Swapped numbers

swapnumbers: true puts the number before the name, as amsthm’s \swapnumbers does.

1 Theorem (Fermat). If \(p\) is prime, then \(a^p \equiv a \pmod p\).

2 Lemma. \(\binom{p}{k}\) is divisible by \(p\) for \(0 < k < p\).

1 Remark. In a swapped heading the number takes the heading’s font, italic here, where after the name it would be upright.

Source

This page is made from the Markdown below, and LaTeX output gets the LaTeX beside it. The PDF under Other Formats is that LaTeX, typeset by amsthm.

---
title: Swapped numbers
amsthm:
  swapnumbers: true
  plain:
    - Theorem:
        - Lemma
  remark:
    - Remark
---

`swapnumbers: true` puts the number before the name, as amsthm's
`\swapnumbers` does.

::: {.Theorem info="Fermat"}
If $p$ is prime, then $a^p \equiv a \pmod p$.
:::

::: Lemma
$\binom{p}{k}$ is divisible by $p$ for $0 < k < p$.
:::

::: Remark
In a swapped heading the number takes the heading's font, italic here,
where after the name it would be upright.
:::
\usepackage{amsthm}
\swapnumbers
\theoremstyle{plain}
\newtheorem{Theorem}{Theorem}
\newtheorem{Lemma}[Theorem]{Lemma}
\theoremstyle{remark}
\newtheorem{Remark}{Remark}
\texttt{swapnumbers:\ true} puts the number before the name, as amsthm's
\texttt{\textbackslash{}swapnumbers} does.

\begin{Theorem}[Fermat]
If \(p\) is prime, then \(a^p \equiv a \pmod p\).
\end{Theorem}

\begin{Lemma}
\(\binom{p}{k}\) is divisible by \(p\) for \(0 < k < p\).
\end{Lemma}

\begin{Remark}
In a swapped heading the number takes the heading's font, italic here,
where after the name it would be upright.
\end{Remark}