diff options
Diffstat (limited to 'macros/latex-dev/base/ltmiscen.dtx')
-rw-r--r-- | macros/latex-dev/base/ltmiscen.dtx | 63 |
1 files changed, 47 insertions, 16 deletions
diff --git a/macros/latex-dev/base/ltmiscen.dtx b/macros/latex-dev/base/ltmiscen.dtx index 8cd6120751..f60a4090b6 100644 --- a/macros/latex-dev/base/ltmiscen.dtx +++ b/macros/latex-dev/base/ltmiscen.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltmiscen.dtx} - [2019/08/29 v1.1p LaTeX Kernel (Misc. Environments)] + [2019/11/02 v1.1s LaTeX Kernel (Misc. Environments)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltmiscen.dtx} @@ -370,17 +370,7 @@ % percent. The result is saved in \cs{@temptokena} for later use. % \changes{v1.1n}{2018/09/26}{Sometimes mask the endline char when % writing to files (github/73)} -% \begin{macrocode} -\begingroup -\catcode`\%=12 -% \end{macrocode} -% \texttt{latexrelease} will read this code in high-speed -% mode in certain situations. During that it will only look for -% \cs{if} tests but not actually execute the \cs{catcode} change -% above. As a result it will drop anything after the |%| character -% in the definition. Therefore the |\fi| needs to be on the next -% line and we need locally another comment character to avoid -% getting spaces into the definition---a weird problem :-) +% % \begin{macrocode} \catcode`\^^A=9 \long\gdef\add@percent@to@temptokena @@ -390,13 +380,34 @@ % the beginning, so that in case the tokenlist consists of a single brace % group the braces aren't stripped. The |\expandafter| then expands % this extra token away again. +% \changes{v1.1q}{2019/10/25}{Allow unbalanced conditionals in \texttt{\#1} (gh/202)} +% \changes{v1.1r}{2019/11/10}{fix to special comment catcodes (gh/202)} +% \begin{macrocode} + {\expandafter\ifx\expandafter X\detokenize{#2}X\expandafter\dont@add@percent@to@temptokena\else + \expandafter\do@add@percent@to@temptokena\fi{#1}} +% \end{macrocode} +% % \begin{macrocode} - {\ifx!#2!\@temptokena\expandafter{#1}\else - \@temptokena\expandafter{#1%^^A +\long\def\dont@add@percent@to@temptokena#1{% + \@temptokena\expandafter{#1}} +% \end{macrocode} +% \texttt{latexrelease} will read this code in high-speed +% mode in certain situations. During that it will only look for +% \cs{if} tests but not actually execute the \cs{catcode} change +% above. As a result it will drop anything after the |%| character +% in the definition. Therefore the |\fi| needs to be on the next +% line and we need locally another comment character to avoid +% getting spaces into the definition---a weird problem :-) +% +% \begin{macrocode} +\begingroup +\catcode`\%=12 +\catcode`\^^A=14 +\long\gdef\do@add@percent@to@temptokena#1{\@temptokena\expandafter{#1%^^A % \end{macrocode} % Can't be on the same line as the |%| --- see above. % \begin{macrocode} - }\fi} + }} \endgroup % \end{macrocode} % \end{macro} @@ -432,6 +443,8 @@ %<latexrelease> {\protected@file@percent}{Mask line endings}% %<latexrelease>\let\protected@file@percent\@undefined %<latexrelease>\let\add@percent@to@temptokena\@undefined +%<latexrelease>\let\do@add@percent@to@temptokena\@undefined +%<latexrelease>\let\dont@add@percent@to@temptokena\@undefined %<latexrelease>\long\def\@writefile#1#2{% %<latexrelease> \@ifundefined{tf@#1}\relax %<latexrelease> {\@temptokena{#2}% @@ -693,9 +706,27 @@ % \begin{macro}{\@centercr} % \changes{v1.0h}{1994/05/03}{\cs{@badcrerr} replaced by \cs{@nolnerr}} % \changes{v1.0z}{1995/07/13}{Use \cs{nobreak}} +% \changes{v1.1s}{2019/11/02}{Make \cs{@centercr} robust (gh/203)} % \begin{macrocode} -\def\@centercr{\ifhmode \unskip\else \@nolnerr\fi +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2020/02/01}% +%<latexrelease> {\@centercr}{Make robust}% +\protected\def\@centercr{\ifhmode \unskip\else \@nolnerr\fi \par\@ifstar{\nobreak\@xcentercr}\@xcentercr} +%</2ekernel|latexrelease> +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\@centercr}{Make robust}% +%<latexrelease> +%<latexrelease>\def\@centercr{\ifhmode \unskip\else \@nolnerr\fi +%<latexrelease> \par\@ifstar{\nobreak\@xcentercr}\@xcentercr} +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % |