Skip to content

feat: support missing commands#214

Merged
OrangeX4 merged 4 commits intomitex-rs:mainfrom
Shichien:feat/mathscr
Dec 25, 2025
Merged

feat: support missing commands#214
OrangeX4 merged 4 commits intomitex-rs:mainfrom
Shichien:feat/mathscr

Conversation

@Shichien
Copy link
Contributor

@Shichien Shichien commented Dec 23, 2025

feat: support \mathscr command

Fix: #190.

Obviously there has been a solution to mathscr a long time ago, but I don't know why mitex has not supported it. It may be a font problem or your team has corresponding considerations. Because I have personal needs, I made a PR. If it is different from your expectations, you can abandon this change. I think it should at least be usable first and then consider optimization.

References:

Update the logic to handle multiple characters rather than a single one.

#mitex(`\mathscr{ABCDEFGHIJKLM}`)
#mitex(`\mathscr{NOPQRSTUVWXYZ}`)
#mitex(`\mathbf{\mathscr{ABC}}`)
After (Current PR) LaTeX
image image

The \mathscr command is typically provided by the mathrsfs package, while the RSFS (Ralph Smith's Formal Script) font files used by this package only provide a single font weight (the standard weight). Therefore, it does not render in bold in LaTeX.

chore: update deprecated symbols to latest

Fix: #207.
Fix: \ohm Command, Unknown variable: ohm

= Deprecated Symbols

// plus.circle, minus.circle, ast.circle, dash.circle, dot.circle
#mitex(`\oplus \quad \ominus \quad \circledast \quad \circleddash \quad \odot`)
// plus.circle.big, times.circle.big, dot.circle.big
#mitex(`\bigoplus \quad \bigotimes \quad \bigodot`)
// times.circle
#mitex(`\otimes`)
// sect, sect.big, sect.double, sect.sq
#mitex(`\cap \quad \bigcap \quad \Cap \quad \doublecap \quad \sqcap`)
// angle.l/r
#mitex(`\langle a, b \rangle \quad \lang a, b \rang`)
// bracket.l/r.double
#mitex(`\llbracket A \rrbracket \quad \llbracket A \rrbracket`)
// diff
#mitex(`\partial`)
// planck.reduce
#mitex(`\hbar \quad \hslash`)
// circle.nested -> compose.o
#mitex(`\circledcirc`)
// ohm.inv -> Omega.inv
// #mitex(`\mho`)
[WARNING] angle.l is deprecated, use chevron.l instead
[WARNING] angle.r is deprecated, use chevron.r instead
[WARNING] bracket.double is deprecated, use bracket.stroked instead
[WARNING] diff is deprecated, use partial instead
[WARNING] planck.reduce is deprecated, use planck instead
[WARNING] circle.nested is deprecated, use compose.o instead
[WARNING] plus.circle is deprecated, use plus.o instead
[WARNING] minus.circle is deprecated, use minus.o instead
[WARNING] ast.circle is deprecated, use convolve.o or ast.op.o instead
[WARNING] dash.circle is deprecated, use dash.o instead
[WARNING] dot.circle is deprecated, use dot.o instead
[WARNING] times.circle is deprecated, use times.o instead
[WARNING] sect is deprecated, use inter instead

See: Typst 0.14.0 Change Log

After (Current PR) LaTeX
image image

feat: support some missing eqq commands

Partial fix: #173.

Some unicode of symbols cannot be found, but I found that some LaTeX commands are actually obtained by length: 1em, angle: 20deg, this visual effect is consistent with LaTeX.

#let syms = (
  "nsubseteqq": math.cancel(angle: 20deg, length: 1em, "\u{2AC5}"),
  "nsupseteqq": math.cancel(angle: 20deg, length: 1em, "\u{2AC6}"),
  "gtrapprox": math.gt.approx,
  "ngeqq": math.cancel(angle: 20deg, "\u{2267}"),
  "nleqq": math.cancel(angle: 20deg, "\u{2266}"),
  "nleqslant": math.cancel(angle: 20deg, length: 1em, math.lt.eq.slant),
)

#table(
  columns: 2,
  align: (center, center),
  stroke: none,
  [*LaTeX Command*], [*Rendered Result*],
  ..syms.pairs().map(((k, v)) => (raw("\\" + k), $#v$)).flatten()
)
After (Current PR) LaTeX
image image

Tests

#table(
  columns: 4,
  stroke: none,
  align: (center, center, center, center),
  inset: 8pt,

  [\\nsubseteqq], mitex(`\nsubseteqq`), [\\nsupseteqq], mitex(`\nsupseteqq`),
  [\\gtrapprox], mitex(`\gtrapprox`), [\\ngeqq], mitex(`\ngeqq`),
  [\\nleqq], mitex(`\nleqq`), [\\nleqslant], mitex(`\nleqslant`),
)
image

@OrangeX4
Copy link
Member

Thanks! I think there are only some simple CI issues here.

@OrangeX4 OrangeX4 merged commit 22957a7 into mitex-rs:main Dec 25, 2025
4 checks passed
@OrangeX4
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecated diff, use partial instead. \mathscr is not supported [Bug] Missing symbols

2 participants