回忆录更新:\reserved@a 定义中的参数编号非法

回忆录更新:\reserved@a 定义中的参数编号非法

为什么这会中断?

平均能量损失

\documentclass{memoir}
\begin{document}
test
\end{document}

日志

This is LuaTeX, Version 1.11.2 (TeX Live 2020/dev)
 restricted system commands enabled.
(./test.tex
LaTeX2e <2019-10-01> patch level 3

luaotfload | main : initialization completed in 0.123 seconds
(/opt/texlive/2019/texmf-dist/tex/latex/memoir/memoir.cls
Document Class: memoir 2019/11/15 v3.7i configurable book, report, article docu
ment class
(/opt/texlive/2019/texmf-dist/tex/generic/iftex/iftex.sty)
(/opt/texlive/2019/texmf-dist/tex/latex/memoir/mem10.clo)
(/opt/texlive/2019/texmf-dist/tex/latex/tools/array.sty)
(/opt/texlive/2019/texmf-dist/tex/latex/tools/dcolumn.sty)
(/opt/texlive/2019/texmf-dist/tex/latex/tools/delarray.sty)
(/opt/texlive/2019/texmf-dist/tex/latex/tools/tabularx.sty)
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
4
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
4
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
3
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \@uclcnotmath.
<to be read again>
{
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \MakeTextUppercase .
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \MakeTextUppercase .
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \MakeTextLowercase .
<to be read again>
2
l.12970 }
        % end of \IfFileExists
?
! Illegal parameter number in definition of \MakeTextLowercase .
<to be read again>
1
l.12970 }
        % end of \IfFileExists
?
)
No file test.aux.
[1{/opt/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux)
)
 1054 words of node memory still in use:
   2 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 5 attribute, 178 glue_spe
c, 5 attribute_list, 2 write nodes
   avail lists: 2:75,3:7,4:1,5:40,6:7,7:51,9:51
</opt/texlive/2019/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf>
Output written on test.pdf (1 page, 2862 bytes).
Transcript written on test.log.

答案1

修复版本memoir(v3.7j) 已经发送至 CTAN。

如果您的系统上没有 textcase 包,它现在还会包含一个警告。

答案2

这是 中的一个错误,其中有用于模拟后一个包未安装时memoir.cls的代码。textcase.sty

但是,如下代码

\IfFileExists{<filename>}{<code>}{\def\foo#1{#1}}

不起作用,而且据我所知,从来没有起作用。代码应该是

\IfFileExists{textcase.sty}{%
  \RequirePackage[overload]{textcase}\@tempswafalse
  }{\@tempswatrue}
\if@tempswa
% resort to the
%%%% Nearly a carbon copy from textcase.dtx by David Carlisle
\def\@uclcnotmath#1#2#3#4{\begingroup
      #1%
      \def\({$}\let\)\(% $ for emacs :-)
      \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
      \@nonchangecase\label
      \@nonchangecase\ref
      \@nonchangecase\ensuremath
      \def\cite##1##{\toks@{\noexpand\cite##1}\@citex}%
      \def\@citex##1{\NoCaseChange{\the\toks@{##1}}}%
      \def\reserved@a##1##2{\let#2\reserved@a}%
      \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
      \protected@edef\reserved@a{\endgroup
          \noexpand\@skipmath#3#4$\valign$}%
      \reserved@a}
\def\@nonchangecase#1{\def#1##1{\NoCaseChange{#1{##1}}}}
\let\NoCaseChange\@firstofone
\def\@skipmath#1#2$#3${%
  \@skip@nonchangecase#1#2\NoCaseChange\valign
  \ifx\valign#3%
  \else
    $#3$%
    \expandafter\@skipmath\expandafter#1%
  \fi}
\def\@skip@nonchangecase#1#2\NoCaseChange#3{%
  #1{#2}%
  \ifx\valign#3%
  \else
    #3%
    \expandafter\@skip@nonchangecase\expandafter#1%
  \fi}
\DeclareRobustCommand\MakeTextUppercase{%
  \@uclcnotmath{\def\i{I}\def\j{J}}{##1##2}\uppercase}
\protected@edef\MakeTextUppercase#1{\MakeTextUppercase{#1}}
\DeclareRobustCommand\MakeTextLowercase{%
  \@uclcnotmath{}{##2##1}\lowercase}
\protected@edef\MakeTextLowercase#1{\MakeTextLowercase{#1}}
%%%% End copy from textcase.dtx
\fi % end of \IfFileExists

因此代码不会被作为参数吸收,而仅当textcase.sty本地系统上不存在时才会读取。

相关内容