[latex3-commits] [git/LaTeX3-latex3-latex2e] nfssaxes: correct implementation of \emforce (8b53f870)
Frank Mittelbach
frank.mittelbach at latex-project.org
Wed Oct 9 14:05:43 CEST 2019
Repository : https://github.com/latex3/latex2e
On branch : nfssaxes
Link : https://github.com/latex3/latex2e/commit/8b53f8701a0d32be5a2b08ad7a395a0e6aa1a8e4
>---------------------------------------------------------------
commit 8b53f8701a0d32be5a2b08ad7a395a0e6aa1a8e4
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Wed Oct 9 14:05:43 2019 +0200
correct implementation of \emforce
>---------------------------------------------------------------
8b53f8701a0d32be5a2b08ad7a395a0e6aa1a8e4
base/nfssaxes.tex | 7 +--
base/testfiles-search/tlb-nfssaxes-004.lvt | 73 ++++++++++++++++++++++++++++++
base/testfiles-search/tlb-nfssaxes-004.tlg | 49 ++++++++++++++++++++
3 files changed, 126 insertions(+), 3 deletions(-)
diff --git a/base/nfssaxes.tex b/base/nfssaxes.tex
index f4177ae9..98ca03c7 100644
--- a/base/nfssaxes.tex
+++ b/base/nfssaxes.tex
@@ -501,10 +501,11 @@
% In such a case one has to use \cs{emforce} to which directs the
% mechanism to use the level even if the font attributes haven't changed.
%
+% \DecsribeMacro\emreset
% If the nesting is so deep, that the specified levels are
% exhausted then \cs{emreset} is used as a final set of
% declarations (which by default returns
-% back to the upright shape). ThisAny additional nesting levels will
+% back to the upright shape). Any additional nesting levels will
% then reuse the list from its beginning.
%
@@ -535,7 +536,7 @@
-% \begin{macro}{\emreset}
+% \begin{macro}{\emrest}
% Reset the font to upright (this needs to undo \texttt{sc} and
% \textt{it} separately as \cs{upshape} no longer resets both in
% one go).
@@ -608,7 +609,7 @@
% If the test fails we are done and the declarations will be used.
% Otherwise we will try the next declaration in the sequence.
% \begin{macrocode}
- \expandafter\ifx\csname\curr at fontshape/\f at size\em at force\endcsname\em at currfont
+ \expandafter\ifx\csname\curr at fontshape/\f at size\em at force\expandafter\endcsname\em at currfont
\expandafter\do at emfont@update\emfontdeclare at clist\do at emfont@update
% \end{macrocode}
% If \cs{emforce} was used, we have to undo its effect:
diff --git a/base/testfiles-search/tlb-nfssaxes-004.lvt b/base/testfiles-search/tlb-nfssaxes-004.lvt
new file mode 100644
index 00000000..740bf0f4
--- /dev/null
+++ b/base/testfiles-search/tlb-nfssaxes-004.lvt
@@ -0,0 +1,73 @@
+\documentclass{article}
+
+\input{test2e}
+
+\usepackage{color}
+
+\makeatletter
+\def\showresult#1#2{#2\typeout{\detokenize{#2} -> \csname f@#1\endcsname}}
+\def\showfont{\typeout{\f at encoding/\f at family/\f at series/\f at shape}}
+\makeatother
+
+\begin{document}
+
+\START
+
+\typeout{========== std LaTeX ==========}
+\emph{\showfont First
+\emph{\showfont second
+\emph{\showfont third
+\emph{\showfont fourth
+\emph{\showfont fifth}}}}}
+
+\typeout{========== it, sc, scit ==========}
+\emfontdeclare{\itshape,\upshape\scshape,\itshape}
+\emph{\showfont First
+\emph{\showfont second
+\emph{\showfont third
+\emph{\showfont fourth
+\emph{\showfont fifth}}}}}
+
+
+\typeout{========== it, sc, scit, but with supported font ==========}
+\fontfamily{qpl}\selectfont
+\emfontdeclare{\itshape,\upshape\scshape,\itshape}
+\emph{\showfont First
+\emph{\showfont second
+\emph{\showfont third
+\emph{\showfont fourth
+\emph{\showfont fifth}}}}}
+
+
+
+\typeout{========== it, sc, scit, but it already in force ==========}
+\emfontdeclare{\itshape,\upshape\scshape,\itshape}
+\textit{% italics already in force
+\emph{\showfont First
+\emph{\showfont second
+\emph{\showfont third
+\emph{\showfont fourth
+\emph{\showfont fifth}}}}}
+}
+
+\typeout{========== it, blue, bf, sc (but without emforce) ==========}
+\emfontdeclare{\itshape,\color{blue},\bfseries,\color{black}\scshape}
+\emph{\showfont First
+\emph{\showfont second
+\emph{\showfont third
+\emph{\showfont fourth
+\emph{\showfont fifth}}}}}
+
+
+
+\typeout{========== it, blue, bf, sc (now with emforce) ==========}
+\emfontdeclare{\itshape,\color{blue}\emforce,\bfseries,\color{black}\scshape}
+\emph{\showfont First
+\emph{\showfont second
+\emph{\showfont third
+\emph{\showfont fourth
+\emph{\showfont fifth}}}}}
+
+
+
+\stop
diff --git a/base/testfiles-search/tlb-nfssaxes-004.tlg b/base/testfiles-search/tlb-nfssaxes-004.tlg
new file mode 100644
index 00000000..e94eb106
--- /dev/null
+++ b/base/testfiles-search/tlb-nfssaxes-004.tlg
@@ -0,0 +1,49 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+========== std LaTeX ==========
+OT1/cmr/m/it
+OT1/cmr/m/n
+OT1/cmr/m/it
+OT1/cmr/m/n
+OT1/cmr/m/it
+========== it, sc, scit ==========
+OT1/cmr/m/it
+OT1/cmr/m/sc
+LaTeX Font Warning: Font shape `OT1/cmr/m/scit' undefined
+(Font) using `OT1/cmr/m/it' instead on input line ....
+OT1/cmr/m/it
+OT1/cmr/m/n
+OT1/cmr/m/it
+========== it, sc, scit, but with supported font ==========
+LaTeX Font Info: Trying to load font information for OT1+qpl on input line ....
+OT1/qpl/m/it
+OT1/qpl/m/sc
+OT1/qpl/m/scit
+OT1/qpl/m/n
+OT1/qpl/m/it
+========== it, sc, scit, but it already in force ==========
+OT1/qpl/m/sc
+OT1/qpl/m/scit
+OT1/qpl/m/n
+OT1/qpl/m/it
+OT1/qpl/m/sc
+========== it, blue, bf, sc (but without emforce) ==========
+OT1/qpl/m/it
+LaTeX Font Info: Font shape `OT1/qpl/bx/it' in size <10> not available
+(Font) Font shape `OT1/qpl/b/it' tried instead on input line ...
+OT1/qpl/bx/it
+LaTeX Font Info: Font shape `OT1/qpl/bx/scit' in size <10> not available
+(Font) Font shape `OT1/qpl/b/scit' tried instead on input line ....
+OT1/qpl/bx/scit
+LaTeX Font Info: Font shape `OT1/qpl/bx/n' in size <10> not available
+(Font) Font shape `OT1/qpl/b/n' tried instead on input line ...
+OT1/qpl/bx/n
+OT1/qpl/bx/it
+========== it, blue, bf, sc (now with emforce) ==========
+OT1/qpl/m/it
+OT1/qpl/m/it
+OT1/qpl/bx/it
+OT1/qpl/bx/scit
+OT1/qpl/bx/n
+[1
+]
More information about the latex3-commits
mailing list