[latex3-commits] [git/LaTeX3-latex3-latex2e] gh497: fix for #497 (document \labelitemfont in ltnews) (64ff00ed)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Feb 12 11:46:06 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh497
Link       : https://github.com/latex3/latex2e/commit/64ff00ed670a968ae4480f35c7e5c9d47b0ca805

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

commit 64ff00ed670a968ae4480f35c7e5c9d47b0ca805
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Feb 12 11:46:06 2021 +0100

    fix for #497  (document \labelitemfont in ltnews)


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

64ff00ed670a968ae4480f35c7e5c9d47b0ca805
 base/changes.txt      |  1 +
 base/classes.dtx      | 15 +++++++++------
 base/doc/ltnews33.tex | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index ee155320..c3af751c 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,7 @@ are not part of the distribution.
 
 	* classes.dtx (subsubsection{Itemize}):
 	Drop incorrect space in \labelitemiv (gh/496)
+	Document use of \labelitemfont in ltnews33 (gh/497)
 
 2021-02-08  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
diff --git a/base/classes.dtx b/base/classes.dtx
index 3010d655..97c2cb34 100644
--- a/base/classes.dtx
+++ b/base/classes.dtx
@@ -53,7 +53,7 @@
 %<*driver>
 \ProvidesFile{classes.drv}
 %</driver>
-              [2021/02/11 v1.4n
+              [2021/02/12 v1.4n
 %<article|report|book> Standard LaTeX document class]
 %<10pt|11pt|12pt>      Standard LaTeX file (size option)]
 %    \end{macrocode}
@@ -2967,13 +2967,16 @@
 %    produced regardless of surrounding conditions.
 %
 % \changes{v1.4l}{2019/12/20}{Normalize label fonts}
-%    A possible alternative would be
+%    Possible alternatives would be, for example,
 %\begin{verbatim}
-%\renewcommand\labelitemfont{%
-%   \fontseries\seriesdefault
-%   \fontshape\shapedefault\selectfont}
+%  \renewcommand\labelitemfont
+%     {\normalfont\fontfamily{lmss}\selectfont}
+%  \renewcommand\labelitemfont
+%     {\rmfamily\normalshape}
 %\end{verbatim}
-%    which resets series and shape doesn't touch the family.
+%    the first would use symbols from Latin Modern Sans, the second
+%    would only allow changes in the font series so that an
+%    \textt{itemize} in a bold context would produce bolder symbols.
 %    \begin{macrocode}
 \newcommand\labelitemfont{\normalfont}
 %    \end{macrocode}
diff --git a/base/doc/ltnews33.tex b/base/doc/ltnews33.tex
index afff94a9..14c1a81d 100644
--- a/base/doc/ltnews33.tex
+++ b/base/doc/ltnews33.tex
@@ -113,6 +113,39 @@
 
 \section{Other changes to the \LaTeX{} kernel}
 
+\subsection{Adjusting \env{itemize} labels with \cs{labelitemfont}}
+
+The command \cs{labelitemfont} was in fact already introduced with the
+\LaTeX\ release 2020-02-02, but back then we forgot to describe it, so
+we do this now. Its purpose is to resolve some bad formatting issues
+with the \env{itemize} environment and at the same time make it easier
+to adjust its layout if necessary. What could happen in the past was the the
+\env{itemize} labels, e.g., the \textbullet{}, would sometimes react to
+surrounding font changes and could suddenly change shape, for example
+to \textit{\textbullet}.
+
+Now \cs{labelitemfont} is applied to each
+label defaulting to \cs{normalfont} which will prevent this behavior.
+By chosing a different settings other effects can be achieved, for example
+\begin{verbatim}
+  \renewcommand\labelitemfont
+     {\normalfont\fontfamily{lmss}\selectfont}
+  \renewcommand\labelitemfont
+     {\rmfamily\normalshape}
+\end{verbatim}
+The first will take the symbols from Latin Modern Sans so that you get
+%
+\def\myfont#1{{\let\labelitemfont\empty\fontfamily{lmss}\selectfont#1}}
+%
+\myfont\labelitemi, \myfont\labelitemii, \myfont\labelitemiii\ and
+\myfont\labelitemiv, while the second variant freezes the font family
+and shape, but leave the series variable, so that an \env{itemize} in
+a bold context would show bolder symbols. Making it empty would give
+you the buggy old behavior back.
+%
+\githubissue{497}
+
+
 \subsection{\cs{end}\texttt{\textbraceleft document\textbraceright}
   should always start in v-mode}
 





More information about the latex3-commits mailing list.