An implementation of numbered theorem environments in typst
See the codeAn implementation of numbered theorem environments in typst. Available as ctheorems in the official Typst universe. Import with
#import "@preview/ctheorems:2.0.0": *
#show: thm-rules // Must include!
A standard set of theorem environments in the AMS style is available using
#import thm-themes.ams: *
A theorem environment combines content with automatically updated numbering information. Theorem environments can
<label>-ed and @reference-dThis package also introduces a few miscellaneous features related to mathematical writing.
\tag).Get acquainted with ctheorems by checking out the minimal example below!
You can read the manual for a full walkthrough of functionality offered by this module.

#import "@preview/ctheorems:2.0.0": *
#import thm-state: thm-restate
#import thm-themes.ams: *
#show: thm-rules.with(qed-symbol: $square$)
#set page(width: 16cm, height: auto, margin: 1.5cm)
#set heading(numbering: "1.")
#show heading: set block(below: 1em)
#let theorem = theorem.with(
outset: 1em,
spacing: 2em,
fill: rgb("#eeffee"),
)
= Random variables
#definition[Expectation][
The expectation of a random variable $X$ on a probability space $(Omega, cal(E), PP)$ is $
EE[X] = integral X dif PP,
$ whenever well-defined.
] <expectation>
#remark[
We require at least one of $EE[X^+], EE[X^-]$ to be finite.
]
#proposition[
For any $A in cal(E)$, $
PP(X in A) = EE[bold(1)_A (X)].
$
] <prob-exp>
#theorem[Markov][
Let $X >= 0$. For all $a > 0$, $
PP(X > a) <= EE[X] / a.
$
] <markov>
#proof([of @markov], defer: true)[
$
PP(X > a)
&= EE[bold(1)_((a, oo))(X)] #tag[(@prob-exp)] \
&<= EE[(X / a) bold(1)_((a, oo))(X)] \
&<= EE[X] / a. #qedhere
$
]
#corollary[Chebyshev][
Let $EE[X] = mu$, $"var"[X] = sigma^2$. Then, $
PP(|X - mu| >= k sigma) <= 1 / k^2.
$
] <chebyshev>
#counter(heading).update(0)
#set heading(numbering: "A.")
= Appendix
#thm-restate()
thm-counter.thmproof function for creating proof environments.#qedhere in a block equation/list/enum item (in a proof) places
the qed symbol on the same line. The qed symbol can be customized via
thmrules.thmbox (or
thmplain) are passed to block.supplement (for references) is no longer set in thmenv. It can be
passed to the theorem environment directly, along with refnumbering to
control the appearance of @references.thmbox are passed to block.fmt.thmref, introduced normal <label>s and @references.show: thmrules.name: ... from theorem environments; use #theorem("Euclid")[]
instead of #theorem(name: "Euclid")[].figures.Thanks to
base-level and base: none features,separator: ... feature,fmt
function.number: ... override feature.title: ... override feature in thm-box.amsthm, thmtools, apxproof.Typst
100.0%
An implementation of numbered theorem environments in typst
See the codeAn implementation of numbered theorem environments in typst. Available as ctheorems in the official Typst universe. Import with
#import "@preview/ctheorems:2.0.0": *
#show: thm-rules // Must include!
A standard set of theorem environments in the AMS style is available using
#import thm-themes.ams: *
A theorem environment combines content with automatically updated numbering information. Theorem environments can
<label>-ed and @reference-dThis package also introduces a few miscellaneous features related to mathematical writing.
\tag).Get acquainted with ctheorems by checking out the minimal example below!
You can read the manual for a full walkthrough of functionality offered by this module.

#import "@preview/ctheorems:2.0.0": *
#import thm-state: thm-restate
#import thm-themes.ams: *
#show: thm-rules.with(qed-symbol: $square$)
#set page(width: 16cm, height: auto, margin: 1.5cm)
#set heading(numbering: "1.")
#show heading: set block(below: 1em)
#let theorem = theorem.with(
outset: 1em,
spacing: 2em,
fill: rgb("#eeffee"),
)
= Random variables
#definition[Expectation][
The expectation of a random variable $X$ on a probability space $(Omega, cal(E), PP)$ is $
EE[X] = integral X dif PP,
$ whenever well-defined.
] <expectation>
#remark[
We require at least one of $EE[X^+], EE[X^-]$ to be finite.
]
#proposition[
For any $A in cal(E)$, $
PP(X in A) = EE[bold(1)_A (X)].
$
] <prob-exp>
#theorem[Markov][
Let $X >= 0$. For all $a > 0$, $
PP(X > a) <= EE[X] / a.
$
] <markov>
#proof([of @markov], defer: true)[
$
PP(X > a)
&= EE[bold(1)_((a, oo))(X)] #tag[(@prob-exp)] \
&<= EE[(X / a) bold(1)_((a, oo))(X)] \
&<= EE[X] / a. #qedhere
$
]
#corollary[Chebyshev][
Let $EE[X] = mu$, $"var"[X] = sigma^2$. Then, $
PP(|X - mu| >= k sigma) <= 1 / k^2.
$
] <chebyshev>
#counter(heading).update(0)
#set heading(numbering: "A.")
= Appendix
#thm-restate()
thm-counter.thmproof function for creating proof environments.#qedhere in a block equation/list/enum item (in a proof) places
the qed symbol on the same line. The qed symbol can be customized via
thmrules.thmbox (or
thmplain) are passed to block.supplement (for references) is no longer set in thmenv. It can be
passed to the theorem environment directly, along with refnumbering to
control the appearance of @references.thmbox are passed to block.fmt.thmref, introduced normal <label>s and @references.show: thmrules.name: ... from theorem environments; use #theorem("Euclid")[]
instead of #theorem(name: "Euclid")[].figures.Thanks to
base-level and base: none features,separator: ... feature,fmt
function.number: ... override feature.title: ... override feature in thm-box.amsthm, thmtools, apxproof.Typst
100.0%