MacTex 和 siunitx 的问题

MacTex 和 siunitx 的问题

我为学士、硕士和博士论文创建了一个大型模板,其中包含一个 Latex 教程,其中包含一些基础知识和一些模板特定内容。我知道这个模板适用于 Windows 上的 MiKTeX 和 Linux 上的 TeX Live。

现在,我有第一位 Apple 用户尝试使用我的模板并开始使用 Latex,但模板不起作用。我将其追溯到这个最小工作示例(在 Mac 上不起作用):

\documentclass[fontsize=12pt, twoside, paper=a4, ngerman, bibliography=totoc, listof=numbered, headinclude, headsepline, parskip=half, BCOR=15mm, DIV=18, numbers=noenddot]{scrbook}
\RequirePackage[ngerman]{babel}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[fleqn]{amsmath}
\usepackage[locale=DE,detect-all]{siunitx}

\begin{document}
\section{Error}
\begin{align}
    (\num{1+i2})\,\si{\ampere} &= \SI{1+i2}{\ampere}\\
    \ang{90} &= \SI{90}{\degree} = \SI{\pi/2}{\radian}
\end{align}
\end{document}

在日志中我可以看到以下错误:

  • 包 siunitx 错误:无效数字“1+i2”。
  • __siunitx_quantity_parsed_aux:w 的参数有一个额外的}。
  • → 还有一些后续错误

以下是日志文件的一些部分:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.12.22)  23 DEC 2022 17:45
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**2.tex
(./2.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24>
(/usr/local/texlive/2022/texmf-dist/tex/latex/koma-script/scrbook.cls
Document Class: scrbook 2021/11/13 v3.35 KOMA-Script document class (book)
(/usr/local/texlive/2022/texmf-dist/tex/latex/koma-script/scrkbase.sty
Package: scrkbase 2021/11/13 v3.35 KOMA-Script package (KOMA-Script-dependent b
asics and keyval usage)

(/usr/local/texlive/2022/texmf-dist/tex/latex/koma-script/scrbase.sty
Package: scrbase 2021/11/13 v3.35 KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)

(/usr/local/texlive/2022/texmf-dist/tex/latex/koma-script/scrlfile.sty
Package: scrlfile 2021/11/13 v3.35 KOMA-Script package (file load hooks)

(/usr/local/texlive/2022/texmf-dist/tex/latex/koma-script/scrlfile-hook.sty
Package: scrlfile-hook 2021/11/13 v3.35 KOMA-Script package (using LaTeX hooks)


(/usr/local/texlive/2022/texmf-dist/tex/latex/koma-script/scrlogo.sty
Package: scrlogo 2021/11/13 v3.35 KOMA-Script package (logo)
)))
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
)
Applying: [2021/05/01] Usage of raw or classic option list on input line 252.
Already applied: [0000/00/00] Usage of raw or classic option list on input line
 368.
))
(/usr/local/texlive/2022/texmf-dist/tex/latex/koma-script/tocbasic.sty
Package: tocbasic 2021/11/13 v3.35 KOMA-Script package (handling toc-files)
\scr@dte@tocline@numberwidth=\skip47
\scr@dte@tocline@numbox=\box50
)
Package tocbasic Info: babel extension for `toc' omitted
(tocbasic)             because of missing \bbl@set@language on input line 137.
Class scrbook Info: File `scrsize12pt.clo' used to setup font sizes on input li
ne 2490.

% skipped some parts here

(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2021/10/15 v2.17l AMS math features
\@mathmargin=\skip64

For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2021/08/26 v2.01 AMS text

(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks19
\ex@=\dimen140
))
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen141
)
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2021/08/26 v2.02 operator names
)
\inf@bad=\count197
LaTeX Info: Redefining \frac on input line 234.
\uproot@=\count198
\leftroot@=\count199
LaTeX Info: Redefining \overline on input line 399.
\classnum@=\count266
\DOTSCASE@=\count267
LaTeX Info: Redefining \ldots on input line 496.
LaTeX Info: Redefining \dots on input line 499.
LaTeX Info: Redefining \cdots on input line 620.
\Mathstrutbox@=\box52
\strutbox@=\box53
\big@size=\dimen142
LaTeX Font Info:    Redeclaring font encoding OML on input line 743.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 744.
\macc@depth=\count268
\c@MaxMatrixCols=\count269
\dotsspace@=\muskip16
\c@parentequation=\count270
\dspbrk@lvl=\count271
\tag@help=\toks20
\row@=\count272
\column@=\count273
\maxfields@=\count274
\andhelp@=\toks21
\eqnshift@=\dimen143
\alignsep@=\dimen144
\tagshift@=\dimen145
\tagwidth@=\dimen146
\totwidth@=\dimen147
\lineht@=\dimen148
\@envbody=\toks22
\multlinegap=\skip65
\multlinetaggap=\skip66
\mathdisplay@stack=\toks23
LaTeX Info: Redefining \[ on input line 2938.
LaTeX Info: Redefining \] on input line 2939.
)
(/usr/local/texlive/2022/texmf-dist/tex/latex/siunitx/siunitx.sty
Package: siunitx 2022-02-15 v3.0.49 A comprehensive (SI) units package
\l__siunitx_angle_tmp_dim=\dimen149
\l__siunitx_angle_marker_box=\box54
\l__siunitx_angle_unit_box=\box55
\l__siunitx_compound_count_int=\count275

(/usr/local/texlive/2022/texmf-dist/tex/latex/translations/translations.sty
Package: translations 2022/02/05 v1.12 internationalization of LaTeX2e packages
 (CN)

(/usr/local/texlive/2022/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count276
)
(/usr/local/texlive/2022/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)

(/usr/local/texlive/2022/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
(/usr/local/texlive/2022/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
)
(/usr/local/texlive/2022/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
))
\l__siunitx_number_exponent_fixed_int=\count277
\l__siunitx_number_min_decimal_int=\count278
\l__siunitx_number_min_integer_int=\count279
\l__siunitx_number_round_precision_int=\count280
\l__siunitx_number_group_minimum_int=\count281
\l__siunitx_table_tmp_box=\box56
\l__siunitx_table_tmp_dim=\dimen150
\l__siunitx_table_column_width_dim=\dimen151
\l__siunitx_table_integer_box=\box57
\l__siunitx_table_decimal_box=\box58
\l__siunitx_table_before_box=\box59
\l__siunitx_table_after_box=\box60
\l__siunitx_table_before_dim=\dimen152
\l__siunitx_table_carry_dim=\dimen153
\l__siunitx_unit_tmp_int=\count282
\l__siunitx_unit_position_int=\count283
\l__siunitx_unit_total_int=\count284

(/usr/local/texlive/2022/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2022-02-24 L3 programming layer (loader) 

(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-02-07 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count285
\l__pdf_internal_box=\box61
))
Package: l3keys2e 2022-01-12 LaTeX2e option processing using LaTeX3 keys
)

Package siunitx Info: Option "detect-all" has been deprecated in this release.
(siunitx)             
(siunitx)             Use "mode = match, propagate-math-font = true,
(siunitx)             reset-math-version = false, reset-text-family = false,
(siunitx)             reset-text-series = false, reset-text-shape = false,
(siunitx)             text-family-to-math = true, text-series-to-math = true"
(siunitx)             as a replacement.

(/usr/local/texlive/2022/texmf-dist/tex/latex/tools/array.sty
Package: array 2021/10/04 v2.5f Tabular extension package (FMi)
\col@sep=\dimen154
\ar@mcellbox=\box62
\extrarowheight=\dimen155
\NC@list=\toks24
\extratabsurround=\skip67
\backup@length=\skip68
\ar@cellbox=\box63
))
LaTeX Font Info:    Trying to load font information for T1+lmr on input line 10
.

(/usr/local/texlive/2022/texmf-dist/tex/latex/lm/t1lmr.fd
File: t1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
) (./2.aux)
\openout1 = `2.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.

(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/color.sty
Package: color 2021/12/07 v1.3c Standard LaTeX Color (DPC)

(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: pdftex.def on input line 149.

(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex

(/usr/local/texlive/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count286
\scratchdimen=\dimen156
\scratchbox=\box64
\nofMPsegments=\count287
\nofMParguments=\count288
\everyMPshowfont=\toks25
\MPscratchCnt=\count289
\MPscratchDim=\dimen157
\MPnumerator=\count290
\makeMPintoPDFobject=\count291
\everyMPtoPDFconversion=\toks26
)))
(/usr/local/texlive/2022/texmf-dist/tex/latex/translations/translations-basic-d
ictionary-german.trsl
File: translations-basic-dictionary-german.trsl (german translation file `trans
lations-basic-dictionary')
)
Package translations Info: loading dictionary `translations-basic-dictionary' f
or `german'. on input line 10.
LaTeX Font Info:    Trying to load font information for T1+lmss on input line 1
1.

(/usr/local/texlive/2022/texmf-dist/tex/latex/lm/t1lmss.fd
File: t1lmss.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)
LaTeX Font Info:    Trying to load font information for OT1+lmr on input line 1
2.

(/usr/local/texlive/2022/texmf-dist/tex/latex/lm/ot1lmr.fd
File: ot1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)
LaTeX Font Info:    Trying to load font information for OML+lmm on input line 1
2.

(/usr/local/texlive/2022/texmf-dist/tex/latex/lm/omllmm.fd
File: omllmm.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)
LaTeX Font Info:    Trying to load font information for OMS+lmsy on input line 
12.

(/usr/local/texlive/2022/texmf-dist/tex/latex/lm/omslmsy.fd
File: omslmsy.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)
LaTeX Font Info:    Trying to load font information for OMX+lmex on input line 
12.

(/usr/local/texlive/2022/texmf-dist/tex/latex/lm/omxlmex.fd
File: omxlmex.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <12> on input line 12.
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <8> on input line 12.
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <6> on input line 12.


! Package siunitx Error: Invalid number '1+i2'.

For immediate help type H <return>.
 ...                                              
                                                  
l.15    \end{align}
                 

The input '1+i2' could not be parsed as a number following the format defined
in module documentation.



! Package siunitx Error: Invalid number '1+i2'.

For immediate help type H <return>.
 ...                                              
                                                  
l.15    \end{align}
                 

The input '1+i2' could not be parsed as a number following the format defined
in module documentation.


! Argument of \__siunitx_quantity_parsed_aux:w has an extra }.
<inserted text> 
                \par 
l.15    \end{align}
                 
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
\q_stop \group_end: \group_end: \\ \ang {90} 
! Paragraph ended before \__siunitx_quantity_parsed_aux:w was complete.
<to be read again> 
                   \par 
l.15    \end{align}
                 
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Missing $ inserted.
<inserted text> 
                $
l.15    \end{align}
                 
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing } inserted.
<inserted text> 
                }
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Extra }, or forgotten $.
<recently read> }
                 
l.15    \end{align}
                 
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

! Missing $ inserted.
<inserted text> 
                $
l.15    \end{align}
                 
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.


! Package siunitx Error: Invalid number '\pi /2'.

For immediate help type H <return>.
 ...                                              
                                                  
l.15    \end{align}
                 

The input '\pi /2' could not be parsed as a number following the format
defined in module documentation.


! Argument of \__siunitx_quantity_parsed_aux:w has an extra }.
<inserted text> 
                \par 
l.15    \end{align}
                 
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
\q_stop \group_end: \group_end:  \math@cr@@@ \global \column@ \z@ \add@amps \ET
C.
! Paragraph ended before \__siunitx_quantity_parsed_aux:w was complete.
<to be read again> 
                   \par 
l.15    \end{align}
                 
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Missing $ inserted.
<inserted text> 
                $
l.15    \end{align}
                 
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing } inserted.
<inserted text> 
                }
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Extra }, or forgotten $.
<recently read> }
                 
l.15    \end{align}
                 
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

! Missing $ inserted.
<inserted text> 
                $
l.15    \end{align}
                 
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

! Arithmetic overflow.
<recently read> \@tempcnta 
                           
l.15    \end{align}
                 
I can't carry out that multiplication or division,
since the result is out of range.


! Package siunitx Error: Invalid number '1+i2'.

For immediate help type H <return>.
 ...                                              
                                                  
l.15    \end{align}
                 

The input '1+i2' could not be parsed as a number following the format defined
in module documentation.



! Package siunitx Error: Invalid number '1+i2'.

For immediate help type H <return>.
 ...                                              
                                                  
l.15    \end{align}
                 

The input '1+i2' could not be parsed as a number following the format defined
in module documentation.


! Argument of \__siunitx_quantity_parsed_aux:w has an extra }.
<inserted text> 
                \par 
l.15    \end{align}
                 
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
\q_stop \group_end: \group_end: \\ \ang {90} 
! Paragraph ended before \__siunitx_quantity_parsed_aux:w was complete.
<to be read again> 
                   \par 
l.15    \end{align}
                 
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Missing $ inserted.
<inserted text> 
                $
l.15    \end{align}
                 
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing } inserted.
<inserted text> 
                }
l.15    \end{align}
                 
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Extra }, or forgotten $.
<recently read> }
                 
l.15    \end{align}
                 
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

! Missing $ inserted.
<inserted text> 
                $
l.15    \end{align}
                 
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.


! Package siunitx Error: Invalid number '\pi /2'.

For immediate help type H <return>.
 ...                                              
                                                  
l.15    \end{align}
                 

The input '\pi /2' could not be parsed as a number following the format
defined in module documentation.


)
Runaway argument?
\q_stop \group_end: \group_end:  \end {align} \end {document} 
! File ended while scanning use of \__siunitx_quantity_parsed_aux:w.
<inserted text> 
                \par 
<*> 2.tex
         
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> 2.tex
         
*** (job aborted, no legal \end found)

 
Here is how much of TeX's memory you used:
 10191 strings out of 478268
 237077 string characters out of 5846346
 636007 words of memory out of 5000000
 28319 multiletter control sequences out of 15000+600000
 492665 words of font info for 44 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 108i,9n,106p,10627b,596s stack positions out of 10000i,1000n,20000p,200000b,200000s
!  ==> Fatal error occurred, no output PDF file produced!

答案1

除了(a)更新版本希尼奇您使用的软件包——截至 2022 年 12 月中旬,该软件包的当前版本为 3.1.11——并且 (b) 从和更改为和\si——并且在适当的情况下,并且——您还需要运行\SI\unit\qty\complexunit\complexqty

\sisetup{input-digits = 0123456789\pi\mitpi}

为了“注册” \pi(及其数学斜体版本\mitpi)为数字。

这些更改并非特定于 MacOS 和 MacTeX。相反,它们是由软件包版本 3 中引入的语法更改引起的siunitx

您可能还想考虑让您的模板或多或少地与所采用的 TeX 引擎(pdfTeX、XeTeX 或 LuaTeX)无关。这可以通过更改来实现(至少对于您提供的最小示例而言)

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage{iftex} % condtionals for checking which TeX engine is in use
\ifpdftex
  \usepackage[T1]{fontenc}
  %%\RequirePackage[utf8]{inputenc} % that's the default nowadays
  \usepackage{lmodern}
\else % either XeLaTeX or LuaLaTeX
  \usepackage{unicode-math}
\fi

在此处输入图片描述

\documentclass[fontsize=12pt, twoside, paper=a4, 
      ngerman, bibliography=totoc, listof=numbered, 
      headinclude, headsepline, parskip=half, 
      BCOR=15mm, DIV=18, numbers=noenddot]{scrbook}
\usepackage{babel}  % employ 'ngerman' option automatically
\usepackage[fleqn]{amsmath}
\usepackage[locale=DE,detect-all]{siunitx}
\sisetup{input-digits = 0123456789\pi\mitpi} % <-- new

\usepackage{iftex} % condtionals for checking which TeX engine is in use
\ifpdftex
  \usepackage[T1]{fontenc}
  %%\RequirePackage[utf8]{inputenc} % that's the default nowadays
  \usepackage{lmodern}
\else % either XeLaTeX or LuaLaTeX
  \usepackage{unicode-math}
\fi

\begin{document}

$(\complexnum{1+i2})\,\unit{\ampere} = \complexqty{1+i2}{\ampere}$

$\ang{360} = \qty{360}{\degree} = \qty{2\pi}{\radian}$

\end{document}

相关内容