Skip to content

Commit

Permalink
Use 'math reset' approach to \ohm with mathastext (fixes #757)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Nov 12, 2024
1 parent 67abc3b commit 3391e8a
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/tl_packages
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ lualatex-math
luatexbase
luatexko
makeindex
mathastext
mathpazo
multirow
natbib
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
- Adjust `colortbl` support to allow for `tabularray` (see
https://github.com/lvjr/tabularray/issues/512)

### Fixed
- Output of `\ohm` with `mathastext` (see issue
[\#757](https://github.com/josephwright/siunitx/issues/757))

## [v3.3.22] - 2024-09-30

### Fixed
Expand Down
25 changes: 16 additions & 9 deletions siunitx-symbol.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,23 @@
\@ifpackageloaded { fontspec }
{ \exp_not:V \l_@@_tmpb_tl }
{
\bool_lazy_or:nnTF
\bool_lazy_any:nTF
{
\@ifclassloaded { beamer }
\c_true_bool
\c_false_bool
}
{
\@ifpackageloaded { kmath }
\c_true_bool
\c_false_bool
{
\@ifclassloaded { beamer }
\c_true_bool
\c_false_bool
}
{
\@ifpackageloaded { kmath }
\c_true_bool
\c_false_bool
}
{
\@ifpackageloaded { mathastext }
\c_true_bool
\c_false_bool
}
}
{ \exp_not:V \l_@@_tmpb_tl }
{ \exp_not:V \l_@@_tmpa_tl }
Expand Down
28 changes: 28 additions & 0 deletions testfiles/siunitx-pkg-mathastext.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
\input{regression-test}

\documentclass{article}

\ExplSyntaxOn
\debug_on:n { check-declarations , deprecation }
\ExplSyntaxOff

\usepackage{siunitx}

% Needed to force the failure we are testing for
\ifdefined\Umathcode\else
\usepackage[T1]{fontenc}
\fi
\usepackage[LGRgreek]{mathastext}

\begin{document}

% Set up math fonts
\savebox0{$ \mathrm { a } \mathsf { b } \mathtt{ c } \mathbf { d } $ }

\START

\showoutput

\unit{\omega}

\end{document}
46 changes: 46 additions & 0 deletions testfiles/siunitx-pkg-mathastext.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\hbox(0.0+0.0)x0.0
..\kern -72.26999
..\vbox(0.0+0.0)x0.0, glue set 72.26999fil
...\kern -72.26999
...\hbox(0.0+0.0)x0.0
....\glue 0.0 plus 1.0fil minus 1.0fil
...\glue 0.0 plus 1.0fil minus 1.0fil
.\glue 16.0
.\vbox(617.0+0.0)x345.0, shifted 62.0
..\vbox(12.0+0.0)x345.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x345.0
....\pdfcolorstack 0 push {0 g 0 G}
....\hbox(0.0+0.0)x345.0
....\pdfcolorstack 0 pop
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
...\write-{}
...\glue(\topskip) 5.6955
...\hbox(4.3045+0.0)x345.0, glue set 322.64069fil
....\hbox(0.0+0.0)x15.0
....\mathon
....\T1/cmr/m/n/10 w
....\kern0.13885
....\mathoff
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
..\glue(\baselineskip) 23.5849
..\hbox(6.4151+0.0)x345.0
...\pdfcolorstack 0 push {0 g 0 G}
...\hbox(6.4151+0.0)x345.0, glue set 170.00061fil
....\glue 0.0 plus 1.0fil
....\T1/cmr/m/n/10 1
....\glue 0.0 plus 1.0fil
...\pdfcolorstack 0 pop
.\kern 0.0
(siunitx-pkg-mathastext.aux)

0 comments on commit 3391e8a

Please sign in to comment.