[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: guard # in text font commands (#666) (a01382c4)

GitHub noreply at github.com
Sun Sep 12 19:36:29 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/a01382c42e11980e905b149a86299b33d3e24310

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

commit a01382c42e11980e905b149a86299b33d3e24310
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Sun Sep 12 18:36:29 2021 +0100

    guard # in text font commands (#666)
    
    * guard # in text font commands
    
    * news entry


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

a01382c42e11980e905b149a86299b33d3e24310
 base/changes.txt                                           |  4 ++++
 base/doc/ltnews34.tex                                      |  8 +++++++-
 base/ltfntcmd.dtx                                          |  5 +++--
 base/testfiles/github-0665.lvt                             | 14 ++++++++++++++
 base/testfiles/{github-0060.luatex.tlg => github-0665.tlg} |  0
 5 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 25196800..ac013b6a 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,10 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-09-12  David Carlisle  <David.Carlisle at latex-project.org>
+
+	* ltfntcmd.dtx: guard definition in \text at command with \unexpanded \gh/665
+
 2021-09-10  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltfssini.dtx:
diff --git a/base/doc/ltnews34.tex b/base/doc/ltnews34.tex
index b31bf601..e948b95b 100644
--- a/base/doc/ltnews34.tex
+++ b/base/doc/ltnews34.tex
@@ -587,7 +587,13 @@ setting new defaults.
 \githubissue{663}
 
 
-
+\subsection{Use of \# in \cs{textbf} and similar commands}
+Previously you could not use the macro parameter character \# in inline functions
+in the argument of \cs{texbf} and similar text font commands.
+An internal definition is now guarded with \cs{unexpanded}
+so that \# does not generate an error.
+%
+\githubissue{665}
 
 \subsection{???}
 
diff --git a/base/ltfntcmd.dtx b/base/ltfntcmd.dtx
index 5f70053a..6c4ec4b3 100644
--- a/base/ltfntcmd.dtx
+++ b/base/ltfntcmd.dtx
@@ -32,7 +32,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltfntcmd.dtx}
-             [2020/12/05 v3.4c LaTeX Kernel (Font commands)]
+             [2021/09/12 v3.5a LaTeX Kernel (Font commands)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltfntcmd.dtx}
@@ -466,9 +466,10 @@
 %    Is this the correct action in the `empty' case? It is efficient but
 %    typographically it is, strictly, incorrect!
 % \changes{v3.3l}{1994/06/18}{Added check for empty text}
+% \changes{v3.5a}{2021/09/12}{use \cs{unexpanded} to make \# safe}
 %    \begin{macrocode}
 \def \text at command #1{%
-  \def \reserved at a {#1}%
+  \edef \reserved at a {\unexpanded{#1}}%
   \ifx \reserved at a \@empty
     \let \check at icl \@empty
     \let \check at icr \@empty
diff --git a/base/testfiles/github-0665.lvt b/base/testfiles/github-0665.lvt
new file mode 100644
index 00000000..05df9ad6
--- /dev/null
+++ b/base/testfiles/github-0665.lvt
@@ -0,0 +1,14 @@
+
+\documentclass{article}
+
+\input{test2e}
+
+\begin{document}
+
+\START
+\ExplSyntaxOn
+\int_step_inline:nn { 1 } {#1} % works fine
+\textbf { \int_step_inline:nn { 1 } {#1} } %  should not error 
+\ExplSyntaxOff
+
+\END
\ No newline at end of file
diff --git a/base/testfiles/github-0060.luatex.tlg b/base/testfiles/github-0665.tlg
similarity index 100%
copy from base/testfiles/github-0060.luatex.tlg
copy to base/testfiles/github-0665.tlg





More information about the latex3-commits mailing list.