Skip to content

Commit

Permalink
Gh1230 (#1232)
Browse files Browse the repository at this point in the history
* fix for #1230

* do not load upquote just simulate it in the test

* ltnews entry
  • Loading branch information
FrankMittelbach authored Jan 2, 2024
1 parent cc70406 commit 4438ccd
Show file tree
Hide file tree
Showing 8 changed files with 495 additions and 89 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 <[email protected]>
* 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 <[email protected]>
* ltproperties.dtx:
Correct typo (gh/1223)
Expand Down
102 changes: 17 additions & 85 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 @@ -595,7 +595,16 @@
% class file (like \texttt{ltugboat.cls}) use the |\DocstyleParms|
% command described below. Starting with release 2.0a it can now
% be changed directly as long as the redefinition happens before
% the |\begin{document}|.
% the |\begin{document}| (if you change it later you might see strange
% typesetting effects if you are unlucky).
%
% |\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|.
%
% \DescribeEnv{environment}
% For documenting the definition of environments one can use the
Expand Down Expand Up @@ -1373,7 +1382,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 +2123,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 +6258,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
22 changes: 18 additions & 4 deletions base/doc/ltnews39.tex
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ \subsection{pkg{doc}: provide \cs{ProvideDocElement}}
combined.


\subsection{pkg{doc}: better support for \pkg{upquote}}

In \LaTeX{} News~37~\cite{39:ltnews37} we wrote that support for the
\pkg{upquote} package was added to the \pkg{doc} package, but back
then this was only done for \cs{verb}, and the \env{verbatim}
environments. However, the bulk of code in a typical \texttt{.dtx} file is
within \env{macrocode} or \env{macrocode*} environments which were not
affected by adding \pkg{upquote}. We have now updated those, such that
\pkg{upquote} alters the quote characters in these environments as
well.
%
\githubissue{1230}


\section{Code improvements}

\subsection{Keep track of lost glyphs}
Expand Down Expand Up @@ -298,10 +312,10 @@ \subsection{Correct definition of \cs{k}}
%\newblock Reprinted with corrections in 1996.
%
%
%\bibitem{39:ltnews} \LaTeX{} Project Team.
% \emph{\LaTeXe{} news 1--39}.\\
% \url{https://latex-project.org/news/latex2e-news/ltnews.pdf}
%
\bibitem{39:ltnews37} \LaTeX{} Project Team.
\emph{\LaTeXe{} news 37}.\\
\url{https://latex-project.org/news/latex2e-news/ltnews37.pdf}

%\bibitem{39:blueprint} Frank Mittelbach and Chris Rowley.
% \emph{\LaTeX{} Tagged PDF \Dash A blueprint for a large project}.\\
% \url{https://latex-project.org/publications/indexbyyear/2020/}
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
57 changes: 57 additions & 0 deletions base/testfiles-doc/github-1230.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

\documentclass{article}

% \usepackage{upquote}
%
% instead of loading the package (which is not available in the
% test suite), we just simulate it:

\makeatletter
\newcommand\upquote@cmtt{cmtt}
\newcommand\upquote@OTone{OT1}
\ifx\encodingdefault\upquote@OTone
\ifx\ttdefault\upquote@cmtt\else\RequirePackage{textcomp}\fi
\else
\RequirePackage{textcomp}
\fi
\begingroup
\catcode`'=\active
\catcode``=\active
\g@addto@macro\@noligs
{\let'\textquotesingle
\let`\textasciigrave
\ifx\encodingdefault\upquote@OTone
\ifx\ttdefault\upquote@cmtt
\def'{\char13 }%
\def`{\char18 }%
\fi\fi}
\endgroup
\makeatother
\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}
Loading

0 comments on commit 4438ccd

Please sign in to comment.