Skip to content

Commit

Permalink
fix for #874
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jun 23, 2022
1 parent de74be0 commit 2bae2d9
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Expand Up @@ -10,6 +10,11 @@ are not part of the distribution.
All changes above are only part of the development branch for the next release.
================================================================================

2022-06-23 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* ltxdoc.dtx (section{Useful abbreviations}):
Update \cmd definition to work with new \cs (gh/874)

#########################
# 2022-06-01 PL2 Release
#########################
Expand Down
8 changes: 5 additions & 3 deletions base/ltxdoc.dtx
Expand Up @@ -30,7 +30,7 @@
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{ltxdoc}
%<class> [2022/06/14 v2.1g Standard LaTeX documentation class]
%<class> [2022/06/22 v2.1h Standard LaTeX documentation class]
%
%<*driver>
\documentclass{ltxdoc}
Expand Down Expand Up @@ -294,10 +294,12 @@
% \changes{v2.0k}{1994/05/21}{New definition, so \cmd\{ works.}
% \begin{macro}{\cs}
% \changes{v2.0d}{1994/03/17}{Add \cs{cs}}
% \changes{v2.1h}{2022/06/22}{Update \cs{cmd} definition to work with new \cs{cs}}
% \begin{macrocode}
\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
%\DeclareRobustCommand\cs[1]... % defined later
%\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}} % can't use with new \cs
\def\cmd#1{\texttt{\char`\\\expandafter\cmd@to@cs\string#1}}
\def\cmd@to@cs#1#2{\char\number`#2\relax}
%\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} % already part of doc.sty
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand Down
14 changes: 14 additions & 0 deletions base/testfiles/github-0874.lvt
@@ -0,0 +1,14 @@
\documentclass[nohyperref]{ltxdoc}

\input{regression-test}

\showoutput

\begin{document}

\START

\cmd{\blub}

\end{document}

39 changes: 39 additions & 0 deletions base/testfiles/github-0874.tlg
@@ -0,0 +1,39 @@
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(682.0+0.0)x428.0
.\hbox(0.0+0.0)x0.0
.\glue 17.0
.\vbox(665.0+0.0)x355.0, shifted 73.0
..\vbox(12.0+0.0)x355.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x355.0
....\hbox(0.0+0.0)x355.0
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(598.0+0.0)x355.0, glue set 587.9372fil
...\write-{}
...\glue(\topskip) 3.05556
...\hbox(6.94444+0.8333)x355.0, glue set 313.75023fil
....\hbox(0.0+0.0)x15.0
....\OT1/cmtt/m/n/10 \
....\OT1/cmtt/m/n/10 b
....\OT1/cmtt/m/n/10 l
....\OT1/cmtt/m/n/10 u
....\OT1/cmtt/m/n/10 b
....\kern 0.0
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue -0.8333
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
..\glue(\baselineskip) 23.55556
..\hbox(6.44444+0.0)x355.0
...\hbox(6.44444+0.0)x355.0, glue set 175.0fil
....\glue 0.0 plus 1.0fil
....\OT1/cmr/m/n/10 1
....\glue 0.0 plus 1.0fil
.\kern 0.0
(github-0874.aux)

0 comments on commit 2bae2d9

Please sign in to comment.