[latex3-commits] [git/LaTeX3-latex3-latex2e] textcomp: allow for mid-document changes of the defaults (77b72b73)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Nov 15 10:51:03 CET 2019


Repository : https://github.com/latex3/latex2e
On branch  : textcomp
Link       : https://github.com/latex3/latex2e/commit/77b72b731ee3f7d6e0aa8e1e44cffcc2eb555472

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

commit 77b72b731ee3f7d6e0aa8e1e44cffcc2eb555472
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Nov 15 10:51:03 2019 +0100

    allow for mid-document changes of the defaults


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

77b72b731ee3f7d6e0aa8e1e44cffcc2eb555472
 base/testfiles-legacy/tlb-textcomp-005.lvt |  2 +-
 base/testfiles-legacy/tlb-textcomp-005.tlg | 16 ++++++++------
 base/testfiles-legacy/tlb-textcomp-006.lvt |  9 ++++----
 base/testfiles-legacy/tlb-textcomp-006.tlg | 35 +++++++++++++++++++-----------
 base/textcomp-adds.tex                     | 15 +++++++++++++
 5 files changed, 51 insertions(+), 26 deletions(-)

diff --git a/base/testfiles-legacy/tlb-textcomp-005.lvt b/base/testfiles-legacy/tlb-textcomp-005.lvt
index f58b491d..0dae69c5 100644
--- a/base/testfiles-legacy/tlb-textcomp-005.lvt
+++ b/base/testfiles-legacy/tlb-textcomp-005.lvt
@@ -17,7 +17,7 @@
 
 \START
 
-\typeout{needs also nfssaxes to change defaults and needs path search - not done}
+\typeout{needs path search - not done}
 
 \rmfamily \textdollaroldstyle \textcentoldstyle
 \sffamily \textdollaroldstyle \textcentoldstyle
diff --git a/base/testfiles-legacy/tlb-textcomp-005.tlg b/base/testfiles-legacy/tlb-textcomp-005.tlg
index eecef8e2..181cc8ab 100644
--- a/base/testfiles-legacy/tlb-textcomp-005.tlg
+++ b/base/testfiles-legacy/tlb-textcomp-005.tlg
@@ -1,6 +1,6 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-needs also nfssaxes to change defaults and needs path search - not done
+needs path search - not done
 LaTeX Info: Symbol \textdollaroldstyle not provided by
             font family Alegreya-LF in TS1 encoding.
             Default family used instead on input line ....
@@ -14,6 +14,7 @@ LaTeX Font Warning: Font shape `OT1/AlegreyaSans-LF/m/n' undefined
 LaTeX Info: Symbol \textdollaroldstyle not provided by
             font family AlegreyaSans-LF in TS1 encoding.
             Default family used instead on input line ....
+LaTeX Font Info:    Trying to load font information for TS1+cmss on input line ....
 LaTeX Info: Symbol \textcentoldstyle not provided by
             font family AlegreyaSans-LF in TS1 encoding.
             Default family used instead on input line ....
@@ -24,6 +25,7 @@ LaTeX Font Warning: Font shape `OT1/AlgolRevived-TLF/m/n' undefined
 LaTeX Info: Symbol \textdollaroldstyle not provided by
             font family AlgolRevived-TLF in TS1 encoding.
             Default family used instead on input line ....
+LaTeX Font Info:    Trying to load font information for TS1+cmtt on input line ....
 LaTeX Info: Symbol \textcentoldstyle not provided by
             font family AlgolRevived-TLF in TS1 encoding.
             Default family used instead on input line ....
@@ -39,18 +41,18 @@ Completed box being shipped out [1]
 ..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
 ...\write-{}
 ...\glue(\topskip) 2.50183
-...\hbox(7.49817+0.97198)x345.0, glue set 296.6748fil
+...\hbox(7.49817+1.11084)x345.0, glue set 297.28577fil
 ....\hbox(0.0+0.0)x15.0
 ....\TS1/cmr/m/n/10 ^^8a
 ....\TS1/cmr/m/n/10 ^^8b
-....\TS1/cmr/m/n/10 ^^8a
-....\TS1/cmr/m/n/10 ^^8b
-....\TS1/cmr/m/n/10 ^^8a
-....\TS1/cmr/m/n/10 ^^8b
+....\TS1/cmss/m/n/10 ^^8a
+....\TS1/cmss/m/n/10 ^^8b
+....\TS1/cmtt/m/n/10 ^^8a
+....\TS1/cmtt/m/n/10 ^^8b
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
-...\glue -0.97198
+...\glue -1.11084
 ...\glue 0.0 plus 1.0fil
 ...\glue 0.0
 ...\glue 0.0 plus 0.0001fil
diff --git a/base/testfiles-legacy/tlb-textcomp-006.lvt b/base/testfiles-legacy/tlb-textcomp-006.lvt
index 471c8115..5508ca32 100644
--- a/base/testfiles-legacy/tlb-textcomp-006.lvt
+++ b/base/testfiles-legacy/tlb-textcomp-006.lvt
@@ -17,14 +17,13 @@
 
 \START
 
-\typeout{oldstyle in cmr or cmss from TS1}
+\typeout{oldstyle in cmr cmss or cmtt from TS1}
 
-\oldstylenums{123,4}           % here cmr gets substituted
+CM \oldstylenums{123,4}           % here cmr gets substituted
 
-\sffamily\oldstylenums{567.8}  % this should give cmss
+\sffamily LM \oldstylenums{567.8}  % this should give cmss
 
-\typeout{needs nfssaxes to work well}
 
-\ttfamily\oldstylenums{0.99}   % this should give cmtt but needs nfssaxes for that ...
+\ttfamily LM \oldstylenums{0.99}   % this should give cmtt but needs nfssaxes for that ...
 \end{document}
 
diff --git a/base/testfiles-legacy/tlb-textcomp-006.tlg b/base/testfiles-legacy/tlb-textcomp-006.tlg
index 14768285..51395adf 100644
--- a/base/testfiles-legacy/tlb-textcomp-006.tlg
+++ b/base/testfiles-legacy/tlb-textcomp-006.tlg
@@ -1,16 +1,16 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-oldstyle in cmr or cmss from TS1
+oldstyle in cmr cmss or cmtt from TS1
 LaTeX Info: Oldstyle digits unavailable for family lmr.
             Default oldstyle digits used instead on input line ....
 LaTeX Font Info:    Trying to load font information for TS1+cmss on input line ....
-needs nfssaxes to work well
 LaTeX Font Info:    Trying to load font information for OT1+lmtt on input line ....
 LaTeX Font Info:    No file OT1lmtt.fd. on input line ....
 LaTeX Font Warning: Font shape `OT1/lmtt/m/n' undefined
 (Font)              using `OT1/cmr/m/n' instead on input line ....
 LaTeX Info: Oldstyle digits unavailable for family lmtt.
             Default oldstyle digits used instead on input line ....
+LaTeX Font Info:    Trying to load font information for TS1+cmtt on input line ....
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0
 .\glue 16.0
@@ -22,9 +22,12 @@ Completed box being shipped out [1]
 ..\glue(\lineskip) 0.0
 ..\vbox(550.0+0.0)x345.0, glue set 515.94489fil
 ...\write-{}
-...\glue(\topskip) 5.62607
-...\hbox(4.37393+1.94397)x345.0, glue set 307.22778fil
+...\glue(\topskip) 3.11125
+...\hbox(6.88875+1.94397)x345.0, glue set 287.50546fil
 ....\hbox(0.0+0.0)x15.0
+....\OT1/lmr/m/n/10 C
+....\OT1/lmr/m/n/10 M
+....\glue 3.33333 plus 1.66498 minus 1.11221
 ....\TS1/cmr/m/n/10 1
 ....\TS1/cmr/m/n/10 2
 ....\TS1/cmr/m/n/10 3
@@ -34,9 +37,12 @@ Completed box being shipped out [1]
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
 ...\glue(\parskip) 0.0 plus 1.0
-...\glue(\baselineskip) 3.50208
-...\hbox(6.55396+1.94397)x345.0, glue set 307.22778fil
+...\glue(\baselineskip) 3.11159
+...\hbox(6.94444+1.94397)x345.0, glue set 289.72772fil
 ....\hbox(0.0+0.0)x15.0
+....\OT1/cmss/m/n/10 L
+....\OT1/cmss/m/n/10 M
+....\glue 3.33333 plus 1.66498 minus 1.11221
 ....\TS1/cmss/m/n/10 5
 ....\TS1/cmss/m/n/10 6
 ....\TS1/cmss/m/n/10 7
@@ -46,17 +52,20 @@ Completed box being shipped out [1]
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
 ...\glue(\parskip) 0.0 plus 1.0
-...\glue(\baselineskip) 5.6821
-...\hbox(4.37393+1.94397)x345.0, glue set 312.22656fil
+...\glue(\baselineskip) 3.22272
+...\hbox(6.83331+2.22168)x345.0, glue set 290.2551fil
 ....\hbox(0.0+0.0)x15.0
-....\TS1/cmr/m/n/10 0
-....\TS1/cmr/m/n/10 .
-....\TS1/cmr/m/n/10 9
-....\TS1/cmr/m/n/10 9
+....\OT1/cmr/m/n/10 L
+....\OT1/cmr/m/n/10 M
+....\glue 3.33333 plus 1.66498 minus 1.11221
+....\TS1/cmtt/m/n/10 0
+....\TS1/cmtt/m/n/10 .
+....\TS1/cmtt/m/n/10 9
+....\TS1/cmtt/m/n/10 9
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
-...\glue -1.94397
+...\glue -2.22168
 ...\glue 0.0 plus 1.0fil
 ...\glue 0.0
 ...\glue 0.0 plus 0.0001fil
diff --git a/base/textcomp-adds.tex b/base/textcomp-adds.tex
index 01f00709..373f398b 100644
--- a/base/textcomp-adds.tex
+++ b/base/textcomp-adds.tex
@@ -48,6 +48,19 @@
 }
 
 
+% this is already defined by nfssaxes, so we can reuse it (but since I
+% currently run things individually I define it again). It is needed
+% in case the user changed the defaults mid document.
+
+\def\expand at font@defaults{%
+  \edef\rmdef at ult{\rmdefault}%
+  \edef\sfdef at ult{\sfdefault}%
+  \edef\ttdef at ult{\ttdefault}%
+  \edef\bfdef at ult{\bfdefault}%
+  \edef\mddef at ult{\mddefault}%
+  \edef\famdef at ult{\familydefault}%
+}
+
 
 \def\tc at oldstyle#1{%
    \tc at errorwarn
@@ -55,6 +68,7 @@
            family \f at family.\MessageBreak
            Default oldstyle digits used instead}\@eha
   \bgroup
+      \expand at font@defaults
       \ifx\f at family\rmdef at ult
          \fontfamily\rmsubstdefault
       \else\ifx\f at family\sfdef at ult
@@ -180,6 +194,7 @@
      font family \f at family\space
      in TS1 encoding.\MessageBreak Default family used instead}\@eha
   \bgroup
+      \expand at font@defaults
       \ifx\f at family\rmdef at ult
          \fontfamily\rmsubstdefault
       \else\ifx\f at family\sfdef at ult





More information about the latex3-commits mailing list