Skip to content

Commit

Permalink
Correct ohm symbol with newtxsf (fixes #713)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jan 24, 2024
1 parent 8d3b7da commit 7f9b26e
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/tl_packages
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ makeindex
mathpazo
multirow
natbib
newtxsf
opensans
pgfplots
psnfss
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
- Load `color` package in `begindocument/before` hook

### Fixed
- Correct ohm symbol with `newtxsf` (see issue
[\#713](https://github.com/josephwright/siunitx/issues/713))
- Prevent accidental expansion of `\mathord` (see issue
[\#716](https://github.com/josephwright/siunitx/issues/716))

Expand Down
6 changes: 5 additions & 1 deletion siunitx-symbol.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@
{
\@ifclassloaded { beamer }
{ \exp_not:V \l_@@_tmpb_tl }
{ \exp_not:V \l_@@_tmpa_tl }
{
\@ifpackageloaded { newtxsf }
{ \exp_not:V \l_@@_tmpb_tl }
{ \exp_not:V \l_@@_tmpa_tl }
}
}
\exp_not:N \else
\exp_not:N \text
Expand Down
61 changes: 61 additions & 0 deletions testfiles/siunitx-pkg-newtxsf.luatex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for U+ntxsfmia on input line ....
LaTeX Font Info: Trying to load font information for U+ntxsym on input line ....
LaTeX Font Info: Trying to load font information for U+ntxsyc on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0, direction TLT
.\hbox(0.0+0.0)x0.0, direction TLT
..\kern-72.26999
..\vbox(0.0+0.0)x0.0, glue set 72.26999fil, direction TLT
...\kern-72.26999
...\hbox(0.0+0.0)x0.0, direction TLT
....\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, direction TLT
..\vbox(12.0+0.0)x345.0, glue set 12.0fil, direction TLT
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x345.0, direction TLT
....\pdfcolorstack 0 push {0 g 0 G}
....\hbox(0.0+0.0)x345.0, direction TLT
....\pdfcolorstack 0 pop
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 539.94232fil, direction TLT
...\write-{}
...\glue(\topskip) 3.29501
...\hbox(6.70499+0.0)x345.0, glue set 310.69fil, direction TLT
....\localpar
.....\localinterlinepenalty=0
.....\localbrokenpenalty=0
.....\localleftbox=null
.....\localrightbox=null
....\hbox(0.0+0.0)x15.0, direction TLT
....\mathon
....\TU/lmss/m/n/10 m
....\mathoff
....\glue(\spaceskip) 3.33 plus 1.665 minus 1.11
....\mathon
....\hbox(6.70499+0.0)x8.04, direction TLT
.....\hbox(6.70499+0.0)x8.04, direction TLT
......\mathon
......\U/ntxsfmia/m/it/10
......\mathoff
....\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.22
..\hbox(6.78+0.0)x345.0, direction TLT
...\pdfcolorstack 0 push {0 g 0 G}
...\hbox(6.78+0.0)x345.0, glue set 170.0fil, direction TLT
....\glue 0.0 plus 1.0fil
....\TU/lmss/m/n/10 1
....\glue 0.0 plus 1.0fil
...\pdfcolorstack 0 pop
.\kern0.0
(siunitx-pkg-newtxsf.aux)
24 changes: 24 additions & 0 deletions testfiles/siunitx-pkg-newtxsf.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
\input{regression-test}

\documentclass{article}

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

\usepackage{siunitx}

% Deliberately before the package
\renewcommand{\familydefault}{\sfdefault}
\usepackage{newtxsf}

\begin{document}

\START

\showoutput

\unit{\metre}
\unit{\ohm}

\end{document}
60 changes: 60 additions & 0 deletions testfiles/siunitx-pkg-newtxsf.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Font Warning: Font shape `OT1/cmss/m/n' in size <5.5> not available
(Font) size <5> substituted on input line ....
LaTeX Font Info: Trying to load font information for U+ntxsfmia on input line ....
LaTeX Font Info: Trying to load font information for U+ntxsym on input line ....
LaTeX Font Info: Trying to load font information for U+ntxsyc on input line ....
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) 3.29501
...\hbox(6.70499+0.0)x345.0, glue set 310.68222fil
....\hbox(0.0+0.0)x15.0
....\mathon
....\OT1/cmss/m/n/10 m
....\mathoff
....\glue 3.33333 plus 1.66666 minus 1.11111
....\mathon
....\hbox(6.70499+0.0)x8.04
.....\hbox(6.70499+0.0)x8.04
......\mathon
......\U/ntxsfmia/m/it/10
......\mathoff
....\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.44444
..\hbox(6.55556+0.0)x345.0
...\pdfcolorstack 0 push {0 g 0 G}
...\hbox(6.55556+0.0)x345.0, glue set 170.0fil
....\glue 0.0 plus 1.0fil
....\OT1/cmss/m/n/10 1
....\glue 0.0 plus 1.0fil
...\pdfcolorstack 0 pop
.\kern 0.0
(siunitx-pkg-newtxsf.aux)
LaTeX Font Warning: Size substitutions with differences
(Font) up to 1.97499pt have occurred.
48 changes: 48 additions & 0 deletions testfiles/siunitx-pkg-newtxsf.xetex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for U+ntxsfmia on input line ....
LaTeX Font Info: Trying to load font information for U+ntxsym on input line ....
LaTeX Font Info: Trying to load font information for U+ntxsyc on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\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
....\special{color push Black}
....\hbox(0.0+0.0)x345.0
....\special{color pop}
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
...\write-{}
...\glue(\topskip) 3.29501
...\hbox(6.70499+0.0)x345.0, glue set 310.69fil
....\hbox(0.0+0.0)x15.0
....\mathon
....\TU/lmss/m/n/10 glyph#75
....\mathoff
....\glue 3.33 plus 1.665 minus 1.11
....\mathon
....\hbox(6.70499+0.0)x8.04
.....\hbox(6.70499+0.0)x8.04
......\mathon
......\U/ntxsfmia/m/it/10
......\mathoff
....\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.22
..\hbox(6.78+0.0)x345.0
...\special{color push Black}
...\hbox(6.78+0.0)x345.0, glue set 170.0fil
....\glue 0.0 plus 1.0fil
....\TU/lmss/m/n/10 1
....\glue 0.0 plus 1.0fil
...\special{color pop}
(siunitx-pkg-newtxsf.aux)

0 comments on commit 7f9b26e

Please sign in to comment.