[latex3-commits] [latex3/latex2e] ltcmd-verb: Switch from \par to \obeyedline (9bba6c4f)

github at latex-project.org github at latex-project.org
Fri Sep 1 10:12:10 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : ltcmd-verb
Link       : https://github.com/latex3/latex2e/commit/9bba6c4f7c6e11cba92cb41e3da8c198aa61be86

>---------------------------------------------------------------

commit 9bba6c4f7c6e11cba92cb41e3da8c198aa61be86
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Sep 1 09:12:10 2023 +0100

    Switch from \par to \obeyedline
    
    With a bit of detail added for the user.


>---------------------------------------------------------------

9bba6c4f7c6e11cba92cb41e3da8c198aa61be86
 base/changes.txt      |  7 +++++++
 base/doc/ltnews38.tex |  2 +-
 base/doc/usrguide.tex | 10 ++++++++--
 base/ltcmd.dtx        |  7 ++++---
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 0a4499dc..9ff0a0fc 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,13 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2023-09-01  Joseph Wright  <Joseph.Wright at latex-project.org>
+
+	* ltcmd.dtx
+	Collect \endlinechar as \obeyedline
+	* usrguide.tex
+	Document use of \obeyedline in +v arguments
+
 2023-06-15  Joseph Wright  <Joseph.Wright at latex-project.org>
 
 	* ltmiscen.dtx
diff --git a/base/doc/ltnews38.tex b/base/doc/ltnews38.tex
index b51b7616..b3c2a434 100644
--- a/base/doc/ltnews38.tex
+++ b/base/doc/ltnews38.tex
@@ -182,7 +182,7 @@ the result of this grabbing will be used in a typesetting context. Previously,
 the end-of-line characters were stored literally as category code~12
 (\enquote{other}) \verb|^^M| tokens. However, these are difficult to work with
 in general. We have now revised this behavior, such that end-of-line characters
-are converted to the \cs{par} command when parsed by \texttt{+v}-type
+are converted to the \cs{obeydline} command when parsed by \texttt{+v}-type
 arguments. As with the previous change, this may require adjustment in the
 source of some documents, but the enhanced ability of users and programmers to
 exploit the \texttt{+v}-type argument means we believe it is necessary.
diff --git a/base/doc/usrguide.tex b/base/doc/usrguide.tex
index 57bb5d6d..54b6a331 100644
--- a/base/doc/usrguide.tex
+++ b/base/doc/usrguide.tex
@@ -815,9 +815,15 @@ any of the grabbed tokens have \enquote{special} meaning, an error will be
 issued.
 
 For the \texttt{+v}-type argument, which allows line breaks in input,
-newline characters are converted into \cs{par} tokens. This means that
+newline characters are converted into \cs{obeyedline} commands. This means that
 the grabbed tokens can be used directly in typesetting, while a local
-redefinition of \cs{par} can be used to achieve other outputs.
+redefinition of \cs{obeyedline} can be used to achieve other outputs. For
+example, to retain blank lines whilst typesetting, one could use
+\begin{verbatim}
+\renewcommand*\obeyedline{\mbox{}\par
+\end{verbatim}
+along with other setting that may be appropriate (e.g.~using a monospaced
+font).
 
 Some additional details that may be useful for those with more \TeX{}
 knowledge: do not worry if this does not make sense to you! Grabbed tokens are
diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 06d12db3..93f27bb6 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -34,8 +34,8 @@
 %%% From File: ltcmd.dtx
 %
 %    \begin{macrocode}
-\def\ltcmdversion{v1.1f}
-\def\ltcmddate{2023-06-14}
+\def\ltcmdversion{v1.1g}
+\def\ltcmddate{2023-08-01}
 %    \end{macrocode}
 %
 %<*driver>
@@ -3549,6 +3549,7 @@
 %
 % \begin{macro}{\@@_grab_v_aux_put:N}
 % \changes{v1.1f}{2023/06/14}{Collect \cs{endlinechar} as \cs{par} token}
+% \changes{v1.1g}{2023/09/01}{Collect \cs{endlinechar} as \cs{obeyedline} token}
 %   Storing one token in the collected argument. Most tokens are
 %   converted to category code $12$, with the exception of active
 %   characters.
@@ -3563,7 +3564,7 @@
           { \exp_not:N #1 }
           {
             \int_compare:nNnTF {`#1} = \tex_endlinechar:D
-              { \exp_not:N \par }
+              { \exp_not:N \obeyedline }
               { \token_to_str:N #1 }
           }
       }





More information about the latex3-commits mailing list.