# Oldstyle numbers in body, newstyle numbers in section headings

I'm using the eco package to get oldstyle numbers in my manuscript, but I'm trying to get the section numbers (in the mainmatter and the table of contents as well) to be "newstyle numbers" (ie. lining figures) and having a tough time with it.

Can anyone shed some light on the matter please?

PS: It would be nice to get lining figures in the table and figure numbers as well.

Edit: posting a mwe below (regarding doncherry's suggestion).

\documentclass{book}

\usepackage{eco}

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\renewcommand{\thechapter}{{\fontfamily{cmr}\selectfont\arabic{chapter}}}
\renewcommand{\thesection}{{\fontfamily{cmr}\selectfont\arabic{section}}}
\renewcommand{\thesubsection}{{\fontfamily{cmr}\selectfont\arabic{subsection}}}
\renewcommand{\thesubsubsection}{{\fontfamily{cmr}\selectfont\arabic{subsubsection}}}
\renewcommand{\theparagraph}{{\fontfamily{cmr}\selectfont\arabic{paragraph}}}
\renewcommand{\thesubparagraph}{{\fontfamily{cmr}\selectfont\arabic{subparagraph}}}
\renewcommand{\thefigure}{{\fontfamily{cmr}\selectfont\arabic{figure}}}
\renewcommand{\thetable}{{\fontfamily{cmr}\selectfont\arabic{table}}}

\begin{document}

\tableofcontents{}

\part{One}
\chapter{One--One}
\section{One--One--One}
\subsection{One--One--One--One}
\subsubsection{One--One--One--One--One}
\paragraph{One--One--One--One--One--One}
\subparagraph{One--One--One--One--One--One--One}
\subparagraph{One--One--One--One--One--One--Two}
\subparagraph{One--One--One--One--One--One--Three}
\paragraph{One--One--One--One--One--Two}
\subparagraph{One--One--One--One--One--Two--One}
\subparagraph{One--One--One--One--One--Two--Two}
\subparagraph{One--One--One--One--One--Two--Three}

\end{document}

-
Welcome to TeX.SE!. Could you give a MWE that illustrates the problem including the \documentclass so that those trying to help don't have to recreate it. – cmhughes Oct 18 '11 at 16:54
Done! Sorry, didn't realize at first. – mpr Oct 18 '11 at 18:49
You can upload the picture (via the button) and remove the ! from the beginning of the line. Then a higher-rep user will edit the post to display the picture. – doncherry Oct 18 '11 at 18:57

Change the font back to Computer Modern (cmr) for the relevant counters, similarly as eco's \newstylenumbers{} does:

\documentclass{article}

\usepackage{eco}
\usepackage[T1]{fontenc}

\renewcommand{\thesection}{\fontfamily{cmr}\selectfont\arabic{section}}

\renewcommand{\thefigure}{{\fontfamily{cmr}\selectfont\arabic{figure}}}

\renewcommand{\thetable}{{\fontfamily{cmr}\selectfont\arabic{table}}}

\begin{document}

% setting the counters to higher values just to see some more digits
\setcounter{page}{123}
\setcounter{figure}{455}
\setcounter{table}{788}

\tableofcontents

\listoffigures

\listoftables

\section{Section 9876543210}

\begin{figure}[bh]
123456789
\caption{123456789}
\end{figure}

\subsection{Subsection 9876543210}

\begin{table}[bh]
123456789
\caption{123456789}
\end{table}

\subsubsection{Subsubsection 9876543210}
\end{document}

The page numbers are still in old style figures, I couldn't change them, you didn't ask for that either. Numbers within section (etc.) titles and captions are still in osf as well.

Edit:

There's no need to redefine more than the highest level you're using, the changed font will be used throughout the sectionlevel number, you just need to get rid of the extra { and }, which form a group, limiting the scope of the changed font. Also, notice how they're all just a single number in your example, but should be like "1.1.1.1.1.1"? Just get rid of all redefinitions except chapter (and table and figure of course). Furthermore, the page numbers won't get pushed to the side if you put in an actual title and not an unknown and awkwardly long word like "One-One-One-One-One-One-One". Replacing the dashes -- with spaces is sufficient:

\documentclass{book}

\usepackage{eco}

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\renewcommand{\thechapter}{\fontfamily{cmr}\selectfont\arabic{chapter}}
%\renewcommand{\thesection}{{\fontfamily{cmr}\selectfont\arabic{section}}}
%\renewcommand{\thesubsection}{{\fontfamily{cmr}\selectfont\arabic{subsection}}}
%\renewcommand{\thesubsubsection}{{\fontfamily{cmr}\selectfont\arabic{subsubsection}}}
%\renewcommand{\theparagraph}{{\fontfamily{cmr}\selectfont\arabic{paragraph}}}
%\renewcommand{\thesubparagraph}{{\fontfamily{cmr}\selectfont\arabic{subparagraph}}}

\renewcommand{\thefigure}{{\fontfamily{cmr}\selectfont\arabic{figure}}}
\renewcommand{\thetable}{{\fontfamily{cmr}\selectfont\arabic{table}}}

\begin{document}

\tableofcontents{}

\part{One}
\chapter{One One}
\section{One One One}
\subsection{One One One One}
\subsubsection{One One One One One}
\paragraph{One One One One One One}
\subparagraph{One One One One One One One}
\subparagraph{One One One One One One Two}
\subparagraph{One One One One One One Three}
\paragraph{One One One One One Two}
\subparagraph{One One One One One Two One}
\subparagraph{One One One One One Two Two}
\subparagraph{One One One One One Two Three}

\end{document}

If the titles get longer than that, they'll be broken into several lines, but you might want to consider using a short title for the ToC then, using \section[short title for ToC and header]{long title for the place in the paper where it actually appears}.

-
Thanks! This does get new style numerals on the section headings and the table of contents, but it also messes up the toc's spacing between the section number and the section title. (I can't seem to figure how to post a code excerpt here, sorry :( ) – mpr Oct 18 '11 at 18:09
It's new style numerals for the numbers (1, 1.1, 1.1.1), but not for the titles (9876543210). In this example, the spacing doesn't seem messed up; are you loading any other packages, a different document class or changing anything else that might have an influence here? If you want to post more than a few words of code, it's probably best to edit your question and to put it at its bottom. – doncherry Oct 18 '11 at 18:39
(original question edited) :) – mpr Oct 18 '11 at 18:48
BTW, yes, it was indeed like that: lining figures for the "automatic" part of the sectioning, the section title's "text" is of no consequence. – mpr Oct 18 '11 at 18:52
It's lining ("new style") figures for the automatic numbering, old style figures for everything else. – mpr Oct 18 '11 at 19:21