1

I'm trying to use oldstyle numbers only in my body text using pdfLaTeX.

Looking at other questions, I had the idea to use the cfr-lm package and then try to come back with lining numbers in : sectioning, figure counters, heads, enumerations, footnotes.

I've done that :

\documentclass[a4paper,12pt,twoside]{book} \usepackage{cfr-lm} \renewcommand{\thechapter}{{\fontfamily{clm}\selectfont\arabic{chapter}}} \renewcommand{\thesection}{{\fontfamily{clm}\selectfont\arabic{chapter}.\arabic{section}}} \renewcommand{\thesubsection}{{\fontfamily{clm}\selectfont\arabic{chapter}.\arabic{section}.\arabic{subsection}}} \renewcommand{\thesubsubsection}{{\fontfamily{clm}\selectfont\arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}} \renewcommand{\theparagraph}{{\fontfamily{clm}\selectfont\arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}}} \renewcommand{\thesubparagraph}{{\fontfamily{clm}\selectfont\arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}.\arabic{subparagraph}}} \setcounter{tocdepth}{5} \setcounter{secnumdepth}{5} \begin{document} \chapter{test} \section{test} \subsection{test} \subsubsection{test} \subsubsection{test} \end{document} 

As I added in the comments, it works for sectioning.

I'm still looking for ideas for the rest.

6
  • OK, I've found a solution myself ! Just needed to replace lmr by clm. Commented Apr 28, 2024 at 13:19
  • \usepackage{sectsty} \chapterfont{\lstyle} \allsectionsfont{\lstyle} will also get the job done for sectioning headers. (\lstyle is a macro that's provided by the cfr-lm package.) Commented Apr 28, 2024 at 13:38
  • Are you aware of the posting Numbers outside of Math environment? Commented Apr 28, 2024 at 19:33
  • I've read it. I think I still need to distinguish numerals of sectioning (lining numbers) from cardinals of text (oldstyle numbers), since sectioning is not part of the same language as text, in my opinion. Commented Apr 28, 2024 at 20:02
  • Do you want tabular or proportional or a mixture? How are you configuring headers? Commented Apr 30, 2024 at 18:57

1 Answer 1

1

I don't think it's a good idea, from a typographer's point of view. Anyway…

\documentclass[a4paper,12pt,twoside]{book} \usepackage{cfr-lm} \usepackage{enumitem} \usepackage{amsmath} \usepackage{sectsty} \DeclareTextFontCommand{\textlstyle}{\lstyle} \labelformat{chapter}{\textlstyle{#1}} \labelformat{section}{\textlstyle{#1}} \labelformat{subsection}{\textlstyle{#1}} \labelformat{subsubsection}{\textlstyle{#1}} \labelformat{paragraph}{\textlstyle{#1}} \labelformat{subparagraph}{\textlstyle{#1}} \labelformat{figure}{\textlstyle{#1}} \labelformat{table}{\textlstyle{#1}} \labelformat{equation}{\textlstyle{#1}} \labelformat{enumi}{\textlstyle{#1}} \allsectionsfont{\lstyle} \setlist{font=\lstyle} \makeatletter \def\maketag@@@#1{\hbox{\m@th\normalfont\lstyle#1}} \NewCommandCopy{\org@makecaption}{\@makecaption} \renewcommand{\@makecaption}[2]{\org@makecaption{\textlstyle{#1}}{#2}} \NewCommandCopy{\org@numberline}{\numberline} \renewcommand{\numberline}[1]{\org@numberline{\textlstyle{#1}}} \makeatother \setcounter{tocdepth}{5} \setcounter{secnumdepth}{5} \begin{document} \tableofcontents \chapter{test}\label{A} \section{test}\label{B} \subsection{test} \subsubsection{test} \subsubsection{test} \paragraph{test} \subparagraph{test} \begin{enumerate} \item\label{C} test \item test \item test \end{enumerate} \begin{equation}\label{D} 1+1=2 \end{equation} \begin{figure}[htp] \caption{Test}\label{E} \end{figure} \begin{table}[htp] \caption{Test}\label{F} \end{table} Refs: \ref{A}, \ref{B}, \ref{C}, \ref{D} and \eqref{D}, \ref{E}, \ref{F} \end{document} 

enter image description here

enter image description here

Don't do that to page numbers, please.

6
  • It does not work for me on refs and enumeration with your very code, I don't know why (I've given up a little). Why do you think it's a bad idea? In fact, I want only cardinals and dates from texts to be in a different font, in order to distinguish the language from the metalanguage. Commented Apr 28, 2024 at 18:52
  • 2
    @LouisLascaud “It does not work“ is not enough, sorry. For your need I believe it should be the other way around: mark up where you actually want lowercase digits. Commented Apr 28, 2024 at 19:28
  • I agree, I will look at it that way from now on. Thanks for you help anyway! Commented Apr 28, 2024 at 19:47
  • Does \textl conflict with something? While it is only a convention, there's a principled distinction between commands ending in style/shape etc. in the support package and the text font commands. Given the code doesn't actually fully work at the moment, I don't know whether that matters. (Though the number style stuff does work as far as I know. At least, it works for me.) cc @LouisLascaud Commented Apr 30, 2024 at 19:07
  • 1
    @cfr I seem to have overlooked the existence of \textl. Commented Apr 30, 2024 at 21:06

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.