Repository navigation
Closed
Description
Description
The baseline and size of sub/superscripts are determined by the font.
If you use multiple fonts with inconsistent metrics, then the result will be poor.
I don't think Typst can do anything here, so let's suggest that the authors specify the baseline and size explicitly.
Discussion on Discord on 2026-04-11
Basic examples
Latin
#let Alpha = text(font: "STIX Two Math", sym.Alpha)
M#super[A#Alpha;A#Alpha;A#Alpha;A]Han
This was originally reported by
an unknown person纸浪i on 2026-03-11.
typst-doc-cn/clreq#91
#set text(font: "Noto Serif CJK SC")
#show emph: set text(font: "KaiTi")
Current: \
标#super[字_词_]
Expected: \
#set super(baseline: -0.5em, size: 0.5em)
标#super[字_词_]There is no italics in CJK scripts. To emphasize something, the author can change the font. The font KaiTi (中易楷体) here is shipped with the Windows OS.
More comparison
Code
#set page(height: auto, width: auto, margin: 15pt)
#let example = {
set text(2em, font: "Noto Serif CJK SC")
[宋]
super({
text(font: "KaiTi")[楷]
[宋]
text(font: "Libertinus Serif")[a]
})
}
#let try(..args) = {
let print(key) = {
let value = args.at(key, default: none)
if value != none {
raw(repr(value))
}
}
(
print("baseline"),
print("size"),
print("typographic"),
{
set super(..args)
example
},
)
}
#set text(font: ("Libertinus Serif", "Noto Serif CJK SC"))
#set raw(lang: "typc")
#show emph: set text(purple)
#import table: cell, hline
#table(
columns: (auto,) * 4 + (23em,),
stroke: none,
align: (x, y) => if x < 3 or y < 2 { center } else { start } + horizon,
inset: (y: 0.7em),
hline(),
cell(colspan: 3)[*`set super(…)`*],
cell(rowspan: 2)[*Result*],
cell(rowspan: 2)[*Comment*],
hline(stroke: 0.5pt),
`baseline`, `size`, `typographic`,
hline(),
..try(baseline: auto, size: auto, typographic: true),
[_Default._ Unlisted values in other rows are identical to those in this row.],
hline(stroke: 0.5pt),
..try(baseline: -0.35em),
[For reference, both Noto Serif CJK and Libertinus Serif set `ySuperscriptYOffset` to 350/1000.],
..try(baseline: -0.35em, size: 0.6em),
[_Expected._ For reference, both Noto Serif CJK and Libertinus Serif set `ySuperscriptYSize` to 600/1000.],
hline(stroke: 0.5pt),
..try(baseline: -0.5em, size: 0.5em),
[For reference, KaiTi sets `ySuperscriptYSize` and `Offset` to 128/256.],
..try(baseline: -0.5em, size: 0.5em, typographic: false),
[_Also acceptable._],
hline(stroke: 0.5pt),
..try(baseline: -0.1em),
cell(rowspan: 4)[
More experiments: `baseline` and `size` only apply to synthesized superscripts; in other words, they have no effect for the typographic “a”.
],
..try(baseline: -0.1em, size: 0.2em),
..try(baseline: -0.7em, size: 0.2em),
..try(baseline: -0.7em, size: 0.2em, typographic: false),
hline(),
)
Activity
Explain how to use multiple fonts in sub/superscript docs
Explain how to use multiple fonts in sub/superscript docs