[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Document \DeclareEncodingSubset (#720) (9282ada4)

GitHub noreply at github.com
Thu Dec 9 14:14:14 CET 2021


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

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

commit 9282ada49cec9d098ea21409832df60bef374d40
Author: dr-scsi <59777257+dr-scsi at users.noreply.github.com>
Date:   Thu Dec 9 14:14:14 2021 +0100

    Document \DeclareEncodingSubset (#720)
    
    * base/doc/fntguide.tex (section{Additional text symbols --
    \textsf{textcomp}}): Describe the macro \DeclareEncodingSubset.
    Add tables showing the different symbols in different
    sub-encodings.


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

9282ada49cec9d098ea21409832df60bef374d40
 base/doc/fntguide.tex | 293 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 288 insertions(+), 5 deletions(-)

diff --git a/base/doc/fntguide.tex b/base/doc/fntguide.tex
index a4b872a2..5b7940cc 100644
--- a/base/doc/fntguide.tex
+++ b/base/doc/fntguide.tex
@@ -40,9 +40,9 @@
 \author{\copyright~Copyright 1995--2021, \LaTeX\ Project
   Team.\thanks{Thanks to Arash Esbati for documenting the
     newer NFSS features of 2020}\\
-   All rights reserved.}
+  All rights reserved.}
 
-\date{March 2021}
+\date{December 2021}
 
 \begin{document}
 
@@ -2056,7 +2056,7 @@ Table~\vref{tab:textcomp} contains macros to access text symbols.  Again,
 the numbers are the slots in the encoding.
 
 \begin{table}
-\centering\footnotesize
+  \centering\footnotesize
   \begin{tabular}[t]{@{}lp{1.5em}l@{}}
     \verb|\textcapitalcompwordmark|  & \textcapitalcompwordmark  & 23 \\
     \verb|\textascendercompwordmark| & \textascendercompwordmark & 31 \\
@@ -2170,8 +2170,291 @@ the numbers are the slots in the encoding.
     \verb|\texttimes|                & \texttimes                & 214 \\
     \verb|\textdiv|                  & \textdiv                  & 246
   \end{tabular}
-\caption{Text symbols formerly from the \textsf{textcomp} package}
-\label{tab:textcomp}
+  \caption{Text symbols formerly from the \textsf{textcomp} package}
+  \label{tab:textcomp}
+\end{table}
+
+The |TS1| encoding contains a rich set of symbols which means that
+several symbols are only available in a few \TeX{} fonts and some, such
+as the capital accents, not available at all but developed as part of
+the reference font implementation.  In reality, many existing fonts
+don't provide a full set of glyphs defined in |TS1| encoding and the
+question arises: ``Which glyphs of the |TS1| encoding are implemented by
+which font?''
+
+\NEWfeature{2021/06/01}
+Fonts can be ordered in sub-encodings with the |\DeclareEncodingSubset|
+macro:
+\begin{decl}
+  |\DeclareEncodingSubset| \arg{encoding}
+                           \arg{font family}
+                           \arg{subset number}
+\end{decl}
+The macro takes 3 mandatory arguments: An \m{encoding} for which a
+subsetting is wanted (currently only |TS1|), the \m{font family} for
+which we declare the subset and finally the \m{subset number} between
+|0| (all of the encoding is supported) and |9| (many glyphs are
+missing).  Hence, it is assumed that some symbols are always available
+by all fonts and each sub-encoding defines macros which become
+unavailable (i.e., they are not provided in the sub-encoding with that
+number and all sub-encodings with higher numbers.)
+
+\begin{table}[tbp]
+  \centering\footnotesize
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textquotestraightbase|     & \textquotestraightbase     & 13  \\
+    \verb|\textquotestraightdblbase|  & \textquotestraightdblbase  & 18  \\
+    \verb|\textcapitalcompwordmark|   & \textcapitalcompwordmark   & 23  \\
+    \verb|\textascendercompwordmark|  & \textascendercompwordmark  & 31  \\
+    \verb|\textdollar|                & \textdollar                & 36  \\
+    \verb|\textquotesingle|           & \textquotesingle           & 39  \\
+    \verb|\textasteriskcentered|      & \textasteriskcentered      & 42  \\
+    \verb|\textdagger|                & \textdagger                & 132 \\
+    \verb|\textdaggerdbl|             & \textdaggerdbl             & 133 \\
+    \verb|\textperthousand|           & \textperthousand           & 135 \\
+    \verb|\textbullet|                & \textbullet                & 136 \\
+    \verb|\texttrademark|             & \texttrademark             & 151 \\
+    \verb|\textcent|                  & \textcent                  & 162 \\
+    \verb|\textsterling|              & \textsterling              & 163 \\
+    \verb|\textyen|                   & \textyen                   & 165 \\
+    \verb|\textbrokenbar|             & \textbrokenbar             & 166
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textsection|               & \textsection               & 167 \\
+    \verb|\textcopyright|             & \textcopyright             & 169 \\
+    \verb|\textordfeminine|           & \textordfeminine           & 170 \\
+    \verb|\textlnot|                  & \textlnot                  & 172 \\
+    \verb|\textregistered|            & \textregistered            & 174 \\
+    \verb|\textdegree|                & \textdegree                & 176 \\
+    \verb|\textpm|                    & \textpm                    & 177 \\
+    \verb|\textparagraph|             & \textparagraph             & 182 \\
+    \verb|\textperiodcentered|        & \textperiodcentered        & 183 \\
+    \verb|\textordmasculine|          & \textordmasculine          & 186 \\
+    \verb|\textonequarter|            & \textonequarter            & 188 \\
+    \verb|\textonehalf|               & \textonehalf               & 189 \\
+    \verb|\textthreequarters|         & \textthreequarters         & 190 \\
+    \verb|\texttimes|                 & \texttimes                 & 214 \\
+    \verb|\textdiv|                   & \textdiv                   & 246
+  \end{tabular}
+  \caption{Default symbols always available in \texttt{TS1} encoding}
+  \label{tab:ts1-subset-always}
+\end{table}
+
+\begin{table}[tbp]
+  \centering
+  \begin{tabular}[t]{@{}lll@{}}
+    \verb*|\textcircled| & \textcircled{} & acc
+  \end{tabular}
+  \caption{Symbol unavailable in \texttt{TS1} sub-encoding \texttt{1}
+    and higher}
+  \label{tab:ts1-subset-1}
+\end{table}
+
+Thus, the symbols that are available in sub-encoding $x$ are the symbols
+in table~\ref{tab:ts1-subset-always} (always available) and the symbols
+listed in sub-encodings $< x - 1$.  The tables
+\vrefrange{tab:ts1-subset-1}{tab:ts1-subset-9} show the symbols in
+different sub-encodings.  Again, the numbers are the slots in the |TS1|
+encoding, |acc| indicates a `constructed' accent.
+
+As an example,
+\begin{verbatim}
+   \DeclareEncodingSubset{TS1}{foo}{5}
+\end{verbatim}
+indicates that the font family |foo| contains the always available
+symbols (table~\vref{tab:ts1-subset-always}) and the ones in
+sub-encodings 1--4
+(tables~\vrefrange{tab:ts1-subset-1}{tab:ts1-subset-4}).
+
+\begin{table}[tbp]
+  \centering\footnotesize
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\capitalcedilla|       & \capitalcedilla{}       & acc \\
+    \verb|\capitalogonek|        & \capitalogonek{}        & acc \\
+    \verb|\capitalgrave|         & \capitalgrave{}         & 0   \\
+    \verb|\capitalacute|         & \capitalacute{}         & 1   \\
+    \verb|\capitalcircumflex|    & \capitalcircumflex{}    & 2   \\
+    \verb|\capitaltilde|         & \capitaltilde{}         & 3   \\
+    \verb|\capitaldieresis|      & \capitaldieresis{}      & 4   \\
+    \verb|\capitalhungarumlaut|  & \capitalhungarumlaut{}  & 5   \\
+    \verb|\capitalring|          & \capitalring{}          & 6   \\
+    \verb|\capitalcaron|         & \capitalcaron{}         & 7   \\
+    \verb|\capitalbreve|         & \capitalbreve{}         & 8   \\
+    \verb|\capitalmacron|        & \capitalmacron{}        & 9   \\
+    \verb|\capitaldotaccent|     & \capitaldotaccent{}     & 10  \\
+    \verb|\capitaltie|           & \capitaltie{}           & 27  \\
+    \verb|\newtie|               & \newtie{}               & 28  \\
+    \verb|\capitalnewtie{}|      & \capitalnewtie{}        & 29  \\
+    \verb|\textdblhyphen|        & \textdblhyphen          & 45  \\
+    \verb|\textzerooldstyle|     & \textzerooldstyle       & 48  \\
+    \verb|\textoneoldstyle|      & \textoneoldstyle        & 49  \\
+    \verb|\texttwooldstyle|      & \texttwooldstyle        & 50  \\
+    \verb|\textthreeoldstyle|    & \textthreeoldstyle      & 51  \\
+    \verb|\textfouroldstyle|     & \textfouroldstyle       & 52  \\
+    \verb|\textfiveoldstyle|     & \textfiveoldstyle       & 53  \\
+    \verb|\textsixoldstyle|      & \textsixoldstyle        & 54  \\
+    \verb|\textsevenoldstyle|    & \textsevenoldstyle      & 55  \\
+    \verb|\texteightoldstyle|    & \texteightoldstyle      & 56  \\
+    \verb|\textnineoldstyle|     & \textnineoldstyle       & 57  \\
+    \verb|\textmho|              & \textmho                & 77  \\
+    \verb|\textbigcircle|        & \textbigcircle          & 79  \\
+    \verb|\textlbrackdbl|        & \textlbrackdbl          & 91  \\
+    \verb|\textrbrackdbl|        & \textrbrackdbl          & 93  \\
+    \verb|\textasciigrave|       & \textasciigrave         & 96  \\
+    \verb|\textborn|             & \textborn               & 98
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textdivorced|         & \textdivorced           & 99  \\
+    \verb|\textdied|             & \textdied               & 100 \\
+    \verb|\textleaf|             & \textleaf               & 108 \\
+    \verb|\textmarried|          & \textmarried            & 109 \\
+    \verb|\textmusicalnote|      & \textmusicalnote        & 110 \\
+    \verb|\texttildelow|         & \texttildelow           & 126 \\
+    \verb|\textdblhyphenchar|    & \textdblhyphenchar      & 127 \\
+    \verb|\textasciibreve|       & \textasciibreve         & 128 \\
+    \verb|\textasciicaron|       & \textasciicaron         & 129 \\
+    \verb|\textacutedbl|         & \textacutedbl           & 130 \\
+    \verb|\textgravedbl|         & \textgravedbl           & 131 \\
+    \verb|\textdollaroldstyle|   & \textdollaroldstyle     & 138 \\
+    \verb|\textcentoldstyle|     & \textcentoldstyle       & 139 \\
+    \verb|\textnaira|            & \textnaira              & 143 \\
+    \verb|\textguarani|          & \textguarani            & 144 \\
+    \verb|\textpeso|             & \textpeso               & 145 \\
+    \verb|\textrecipe|           & \textrecipe             & 147 \\
+    \verb|\textpertenthousand|   & \textpertenthousand     & 152 \\
+    \verb|\textpilcrow|          & \textpilcrow            & 153 \\
+    \verb|\textbaht|             & \textbaht               & 154 \\
+    \verb|\textdiscount|         & \textdiscount           & 156 \\
+    \verb|\textopenbullet|       & \textopenbullet         & 158 \\
+    \verb|\textservicemark|      & \textservicemark        & 159 \\
+    \verb|\textlquill|           & \textlquill             & 160 \\
+    \verb|\textrquill|           & \textrquill             & 161 \\
+    \verb|\textasciidieresis|    & \textasciidieresis      & 168 \\
+    \verb|\textcopyleft|         & \textcopyleft           & 171 \\
+    \verb|\textcircledP|         & \textcircledP           & 173 \\
+    \verb|\textasciimacron|      & \textasciimacron        & 175 \\
+    \verb|\textasciiacute|       & \textasciiacute         & 180 \\
+    \verb|\textreferencemark|    & \textreferencemark      & 184 \\
+    \verb|\textsurd|             & \textsurd               & 187
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{2}
+    and higher}
+  \label{tab:ts1-subset-2}
+\end{table}
+
+As these days many font families are set up to end in |-LF| (lining
+figures), |-OsF| (oldstyle figures), etc. the declaration supports a
+shortcut: if the \m{font family} name ends in |-*| then the star gets
+replaced by these common ending, e.g.,
+\begin{verbatim}
+   \DeclareEncodingSubset{TS1}{Alegreya-*}{2}
+\end{verbatim}
+is the same as writing
+\begin{verbatim}
+   \DeclareEncodingSubset{TS1}{Alegreya-LF}  {2}
+   \DeclareEncodingSubset{TS1}{Alegreya-OsF} {2}
+   \DeclareEncodingSubset{TS1}{Alegreya-TLF} {2}
+   \DeclareEncodingSubset{TS1}{Alegreya-TOsF}{2}
+\end{verbatim}
+If only some are needed then one can define them individually but in
+many cases all four are wanted, hence the shortcut.
+
+\begin{table}[tbp]
+  \centering\footnotesize
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|textlangle|                & \textlangle               & 60 \\
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textrangle|               & \textrangle               & 62 \\
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{3}
+    and higher}
+  \label{tab:ts1-subset-3}
+
+  \par\vspace{\intextsep}
+
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textleftarrow|            & \textleftarrow            & 24  \\
+    \verb|\textrightarrow|           & \textrightarrow           & 25  \\
+    \verb|\textuparrow|              & \textuparrow              & 94  \\
+    \verb|\textdownarrow|            & \textdownarrow            & 95
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textcolonmonetary|        & \textcolonmonetary        & 141 \\
+    \verb|\textwon|                  & \textwon                  & 142 \\
+    \verb|\textlira|                 & \textlira                 & 146 \\
+    \verb|\textdong|                 & \textdong                 & 150
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{4}
+    and higher}
+  \label{tab:ts1-subset-4}
+
+  \par\vspace{\intextsep}
+
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textnumero|               & \textnumero               & 155
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textestimated|            & \textestimated            & 157
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{5}
+    and higher}
+  \label{tab:ts1-subset-5}
+
+  \par\vspace{\intextsep}
+
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textflorin|               & \textflorin               & 140
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textcurrency|             & \textcurrency             & 164
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{6}
+    and higher}
+  \label{tab:ts1-subset-6}
+
+  \par\vspace{\intextsep}
+
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textfractionsolidus|      & \textfractionsolidus      & 47 \\
+    \verb|\textminus|                & \textminus                & 61
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textohm|                  & \textohm                  & 87 \\
+    \verb|\textmu|                   & \textmu                   & 181
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{7}
+    and higher}
+  \label{tab:ts1-subset-7}
+
+  \par\vspace{\intextsep}
+
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textblank|                & \textblank                & 32 \\
+    \verb|\textinterrobang|          & \textinterrobang          & 148
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\textinterrobangdown|      & \textinterrobangdown      & 149
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{8}
+    and higher}
+  \label{tab:ts1-subset-8}
+
+  \par\vspace{\intextsep}
+
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\texttwelveudash|          & \texttwelveudash          & 21  \\
+    \verb|\textthreequartersemdash|  & \textthreequartersemdash  & 22  \\
+    \verb|\textbardbl|               & \textbardbl               & 134 \\
+    \verb|\textcelsius|              & \textcelsius              & 137
+  \end{tabular}\qquad
+  \begin{tabular}[t]{@{}lp{1.5em}l@{}}
+    \verb|\texttwosuperior|          & \texttwosuperior          & 178 \\
+    \verb|\textthreesuperior|        & \textthreesuperior        & 179 \\
+    \verb|\textonesuperior|          & \textonesuperior          & 185
+  \end{tabular}
+  \caption{Symbols unavailable in \texttt{TS1} sub-encoding \texttt{9}}
+  \label{tab:ts1-subset-9}
 \end{table}
 
 \section{If you need to know more \ldots}





More information about the latex3-commits mailing list.