Skip to content

Commit

Permalink
fix for #1230
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Dec 30, 2023
1 parent cc70406 commit 7dde819
Show file tree
Hide file tree
Showing 7 changed files with 447 additions and 84 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2023-12-30 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
* doc.dtx (subsection{Macros surrounding the `definition parts'}):
Use \@noligs from the LaTeX kernel, so that the upquote
package can add its patch (gh/1230)

2023-12-26 Yukai Chou <muzimuzhi@gmai.com>
* ltproperties.dtx:
Correct typo (gh/1223)
Expand Down
99 changes: 15 additions & 84 deletions base/doc.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
%<+package>
%<+package>\ProvidesPackage{doc}
%<+shortvrb>\ProvidesPackage{shortvrb}
%<+package|shortvrb> [2023/12/26 v3.0n
%<+package|shortvrb> [2023/12/30 v3.0o
%<+package|shortvrb> Standard LaTeX documentation package V3 (FMi)]
%\catcode`\<=12
%
Expand Down Expand Up @@ -167,7 +167,7 @@
%\RenewDocElement[macrolike = true ,
% toplevel = false,
% idxtype = ,
% idxgroup = LaTeX comands\actualchar\LaTeX{} commands ,
% idxgroup = LaTeX commands\actualchar\LaTeX{} commands ,
% printtype =
% ]{Macro}{macro}
%
Expand Down Expand Up @@ -597,6 +597,14 @@
% be changed directly as long as the redefinition happens before
% the |\begin{document}|.
%
% |\MacroFont| does not alter the font of
% |\verb| or |\verb*| because it is often used to make the font size of
% the code displays smaller, which would look odd if used within a
% paragraph. If you decide to use a different font family and want to
% use the same family with
% |\verb| you need to alter the font setup for |\ttfamily| in addition
% to |\MacroFont|.

This comment has been minimized.

Copy link
@jfbu

jfbu Dec 30, 2023

would it make sense to mention verbatim@font here?

%
% \DescribeEnv{environment}
% For documenting the definition of environments one can use the
% environment \texttt{environment} which works like the \texttt{macro}
Expand Down Expand Up @@ -1373,7 +1381,7 @@
%\RenewDocElement[macrolike = true ,
% toplevel = false,
% idxtype = ,
% idxgroup = LaTeX comands\actualchar\LaTeX{} commands ,
% idxgroup = LaTeX commands\actualchar\LaTeX{} commands ,
% printtype =
% ]{Macro}{macro}
%\end{verbatim}
Expand Down Expand Up @@ -2114,9 +2122,12 @@
% that is, they must be given |\catcode| $12$.
% \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX verbatim,
% which handles more ligatures.}
% \changes{v3.0o}{2023/12/30}{Use \cs{@noligs} from the \LaTeX\
% kernel, so that the \texttt{upquote} package can
% add its patch (gh/1230)}
% \begin{macrocode}
\obeylines
\let\do\do@noligs \verbatim@nolig@list
\@noligs
\let\do\@makeother \dospecials
% \end{macrocode}
% \changes{v1.5t}{1989/11/07}{Common code added.}
Expand Down Expand Up @@ -6246,86 +6257,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% \section{Code no longer used}
%
% \begin{imacro}{\verb}
% \changes{v1.7a}{1992/02/27}{Now warns about newlines (from
% newdoc with `@noligs added).}
% \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX \cs{verb}}
% We re-define |\verb| to check for newlines in its argument since a
% missing delimiter is difficult to detect in \DOC{} source.
% The code is the same as in \texttt{latex.tex} of September 19, 1993.
% Perhaps there should be a font-changing
% hook rather than just using |\ttfamily|, but if so it probably should be
% different from |\MacroFont| since that normally includes |\small|
% and would look wrong inline.
% \changes{v1.7a}{1992/02/28}{Added math mode check (from verbatim.sty)}
% \begin{macrocode}
%\def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
% \bgroup \let\do\do@noligs \verbatim@nolig@list
% \ttfamily \verb@eol@error \let\do\@makeother \dospecials
% \@ifstar{\@sverb}{\@vobeyspaces \frenchspacing \@sverb}}
% \end{macrocode}
% \end{imacro}
%
% \begin{macro}{\verb@balance@group}
% \begin{macro}{\verb@egroup}
% \begin{macro}{\verb@eol@error}
% \changes{v1.8b}{1993/09/21}{Renamed \cs{verb@err} to
% \cs{verb@eol@error}, as in new LaTeX verbatim.}
% \begin{macrocode}
%\let\verb@balance@group\@empty
% \end{macrocode}
%
% \begin{macrocode}
%\def\verb@egroup{\global\let\verb@balance@group\@empty\egroup}
% \end{macrocode}
%
% \begin{macrocode}
%\begingroup
% \obeylines%
% \gdef\verb@eol@error{\obeylines%
% \def^^M{\verb@egroup\@latex@error{%
% \noexpand\verb command ended by end of line}\@ehc}}%
%\endgroup
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@sverb}
% \changes{v1.7a}{1992/02/27}{Added for \cs{verb} change.}
% \changes{v1.7a}{1992/02/28}{Now same as in verbatim.sty.}
% \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX verbatim,
% which has better error trapping.}
% See \cite{art:verbatim} for commentary.
% \changes{v2.1j}{2019/11/03}{Use the kernel definition, no change needed (gh/205)}
% \begin{macrocode}
%\def\@sverb#1{%
% \catcode`#1\active \lccode`\~`#1%
% \gdef\verb@balance@group{\verb@egroup
% \@latex@error{Illegal use of \noexpand\verb command}\@ehc}%
% \aftergroup\verb@balance@group
% \lowercase{\let~\verb@egroup}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\verbatim@nolig@list}
% \begin{macro}{\do@noligs}
% These macros replace the old |\@noligs| mechanism by an
% extensible version to allow more ligatures to be added.
% \begin{macrocode}
%\def\verbatim@nolig@list{\do\`\do\<\do\>\do\,\do\'\do\-}
%\def\do@noligs#1{%
% \catcode`#1\active
% \begingroup
% \lccode`\~`#1\relax
% \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1}}}
% \end{macrocode}
% \end{macro}
% \end{macro}


^^A Needed for emacs
^^A
Expand Down
143 changes: 143 additions & 0 deletions base/testfiles-doc/github-1230.luatex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
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(633.0+0.0)x407.0, direction TLT
.\hbox(0.0+0.0)x0.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
.\vbox(0.0+0.0)x0.0, glue set - 14.99626fil, direction TLT
..\kern0.0
..\kern16.0
..\kern-1.00374
..\hbox(0.0+0.0)x0.0, glue set - 60.99626fil, direction TLT
...\kern0.0
...\kern62.0
...\kern-1.00374
...\pdfdest name{page.1} xyz
...\penalty 10000
...\glue 0.0 plus 1.0fil minus 1.0fil
..\glue 0.0 plus 1.0fil minus 1.0fil
.\glue(\lineskip) 0.0
.\vbox(633.0+0.0)x407.0, direction TLT
..\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 492.94736fil, direction TLT
....\write-{}
....\pdfdest name{Doc-Start} xyz
....\glue(\topskip) 3.88889
....\hbox(6.11111+0.0)x345.0, glue set 303.75024fil, direction TLT
.....\localpar
......\localinterlinepenalty=0
......\localbrokenpenalty=0
......\localleftbox=null
......\localrightbox=null
.....\hbox(0.0+0.0)x15.0, direction TLT
.....\hbox(0.0+0.0)x0.0, direction TLT
.....\OT1/cmtt/m/n/10 ^^R
.....\OT1/cmtt/m/n/10 Z
.....\OT1/cmtt/m/n/10 =
.....\OT1/cmtt/m/n/10 ^^R
.....\OT1/cmtt/m/n/10 a
.....\penalty 10000
.....\glue(\parfillskip) 0.0 plus 1.0fil
.....\glue(\rightskip) 0.0
....\penalty 10000
....\glue 10.0 plus 4.0 minus 5.0
....\glue 0.0 plus 1.0
....\glue(\parskip) 0.0
....\glue(\parskip) 0.0
....\glue(\baselineskip) 4.75
....\hbox(6.25+0.74998)x345.0, glue set 288.30066fil, direction TLT
.....\localpar
......\localinterlinepenalty=0
......\localbrokenpenalty=0
......\localleftbox=null
......\localrightbox=null
.....\hbox(0.0+0.0)x0.0, direction TLT
......\glue 0.0
......\glue 0.0
......\glue -5.0
......\hbox(0.0+0.0)x0.0, direction TLT
.......\pdfcolorstack 0 push {0 g 0 G}
.......\pdfcolorstack 0 pop
......\glue 5.0
.....\OT1/cmtt/m/n/9 \
.....\OT1/cmtt/m/n/9 l
.....\OT1/cmtt/m/n/9 c
.....\OT1/cmtt/m/n/9 c
.....\OT1/cmtt/m/n/9 o
.....\OT1/cmtt/m/n/9 d
.....\OT1/cmtt/m/n/9 e
.....\OT1/cmtt/m/n/9 ^^R
.....\OT1/cmtt/m/n/9 Z
.....\OT1/cmtt/m/n/9 =
.....\OT1/cmtt/m/n/9 ^^R
.....\OT1/cmtt/m/n/9 a
.....\hbox(0.0+0.0)x0.0, direction TLT
.....\penalty 10000
.....\glue(\parfillskip) 0.0 plus 1.0fil
.....\glue(\rightskip) 0.0
....\penalty 0
....\penalty -51
....\glue 10.0 plus 3.0 minus 5.0
....\glue -10.74998 plus -3.0 minus -5.0
....\penalty 10000
....\glue 0.74998
....\glue 10.0 plus 3.0 minus 5.0
....\penalty 0
....\glue(\parskip) 0.0
....\glue(\parskip) 0.0
....\glue(\baselineskip) 4.00002
....\hbox(6.25+0.74998)x345.0, glue set 281.62006fil, direction TLT
.....\glue(\leftskip) 6.68059
.....\localpar
......\localinterlinepenalty=0
......\localbrokenpenalty=0
......\localleftbox=null
......\localrightbox=null
.....\hbox(0.0+0.0)x0.0, direction TLT
.....\OT1/cmtt/m/n/9 \
.....\OT1/cmtt/m/n/9 l
.....\OT1/cmtt/m/n/9 c
.....\OT1/cmtt/m/n/9 c
.....\OT1/cmtt/m/n/9 o
.....\OT1/cmtt/m/n/9 d
.....\OT1/cmtt/m/n/9 e
.....\OT1/cmtt/m/n/9 ^^R
.....\OT1/cmtt/m/n/9 Z
.....\OT1/cmtt/m/n/9 =
.....\OT1/cmtt/m/n/9 ^^R
.....\OT1/cmtt/m/n/9 a
.....\penalty 10000
.....\glue(\parfillskip) 0.0 plus 1.0fil
.....\glue(\rightskip) 0.0
....\penalty 0
....\penalty -51
....\glue 5.0 plus 2.2 minus 2.0
....\glue -0.74998
....\glue 0.0 plus 1.0fil
....\glue 0.0
....\glue 0.0 plus 0.0001fil
...\glue(\baselineskip) 23.55556
...\hbox(6.44444+0.0)x345.0, direction TLT
....\pdfcolorstack 0 push {0 g 0 G}
....\hbox(6.44444+0.0)x345.0, glue set 170.0fil, direction TLT
.....\glue 0.0 plus 1.0fil
.....\OT1/cmr/m/n/10 1
.....\glue 0.0 plus 1.0fil
....\pdfcolorstack 0 pop
.\kern0.0
.\kern0.0
29 changes: 29 additions & 0 deletions base/testfiles-doc/github-1230.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

\documentclass{article}
\usepackage{upquote}
\usepackage{doc}

% Input the test macros for latex 2e
\input{regression-test}

\showoutput

\begin{document}

\START

\verb|`Z=`a|

\begin{verbatim}
\lccode`Z=`a
\end{verbatim}

\MakePercentIgnore
% \begin{macrocode}
\lccode`Z=`a
% \end{macrocode}

\newpage

\OMIT
\end{document}

0 comments on commit 7dde819

Please sign in to comment.