typst-equate icon indicating copy to clipboard operation
typst-equate copied to clipboard

Add more documentation about `number-mode`

Open 34j opened this issue 1 month ago • 3 comments

It would be nice if there were a way to avoid assigning equation numbers to equations that do not need to be referenced.

Related:

  • https://github.com/typst/typst/issues/3031#issuecomment-2515355592
  • https://forum.typst.app/t/how-to-conditionally-enable-equation-numbering-for-labeled-equations/977/14

34j avatar Nov 20 '25 06:11 34j

Doesn't number-mode: "label" basically do that already?

EpicEricEE avatar Nov 20 '25 22:11 EpicEricEE

You are absolutely right, thank you for pointing out.

sub-numbering: true, number-mode: "label"

#import "@preview/equate:0.3.2": equate

#set page(paper: "a7", flipped: true)
#set math.equation(numbering: "(1.1)")
#show: equate.with(breakable: true, sub-numbering: true, number-mode: "label")

$
1 = 1 \
2 = 2
$

$
1 = 1 #<line-only> \
2 = 2
$

$
1 = 1 \
2 = 2
$ <label-only>

$
1 = 1 #<both-line> \
2 = 2
$ <both-label>

@line-only @label-only @both-line @both-label

Image

sub-numbering: true, number-mode: "line"

#import "@preview/equate:0.3.2": equate

#set page(paper: "a7", flipped: true)
#set math.equation(numbering: "(1.1)")
#show: equate.with(breakable: true, sub-numbering: true, number-mode: "line")

$
1 = 1 \
2 = 2
$

$
1 = 1 #<line-only> \
2 = 2
$

$
1 = 1 \
2 = 2
$ <label-only>

$
1 = 1 #<both-line> \
2 = 2
$ <both-label>

@line-only @label-only @both-line @both-label

Image

sub-numbering: false, number-mode: "label"

#import "@preview/equate:0.3.2": equate

#set page(paper: "a7", flipped: true)
#set math.equation(numbering: "(1)")
#show: equate.with(breakable: true, sub-numbering: false, number-mode: "label")

$
1 = 1 \
2 = 2
$

$
1 = 1 #<line-only> \
2 = 2
$

$
1 = 1 \
2 = 2
$ <label-only>

$
1 = 1 #<both-line> \
2 = 2
$ <both-label>

@line-only @label-only @both-line @both-label

Image

sub-numbering: false, number-mode: "line"

#import "@preview/equate:0.3.2": equate

#set page(paper: "a7", flipped: true)
#set math.equation(numbering: "(1)")
#show: equate.with(breakable: true, sub-numbering: false, number-mode: "line")

$
1 = 1 \
2 = 2
$

$
1 = 1 #<line-only> \
2 = 2
$

$
1 = 1 \
2 = 2
$ <label-only>

$
1 = 1 #<both-line> \
2 = 2
$ <both-label>

@line-only @label-only @both-line @both-label

Image

#set page(paper: "a7", flipped: true)
#set math.equation(numbering: "(1)")

$
1 = 1 \
2 = 2
$

$
1 = 1 #<line-only> \
2 = 2
$

$
1 = 1 \
2 = 2
$ <label-only>

$
1 = 1 #<both-line> \
2 = 2
$ <both-label>

@label-only @both-label

Image

34j avatar Nov 25 '25 02:11 34j

I think the name number-mode is highly confusing. I would suggest add-number-to: (“labeled-lines-and-labeled-equation”, “all-lines”).

34j avatar Nov 25 '25 03:11 34j