tabular numbers in tables, proportional in text
Yes, please provide an MWE so we know more about your specific situation. If for now we assume you're using fontspec
like most people, what you're looking for is pretty easily done. I'd use the \AtBeginEnvironment
from the etoolbox
package to automatically invoke a font change at the begin of every tabular.
This is a matter of just one line:
\AtBeginEnvironment{tabular}{\setmainfont[Numbers={OldStyle,Monospaced}]{Minion Pro}}
so, as figure style selection is already implemented in fontspec
, there is no need for an additional package -- etoolbox
is likely to get loaded by other common packages anyways (biblatex
etc.). Here's the complete example:
\documentclass{article}
\usepackage{fontspec, etoolbox}
\setmainfont[Numbers={OldStyle,Proportional}]{Minion Pro}
\AtBeginEnvironment{tabular}{\setmainfont[Numbers={OldStyle,Monospaced}]{Minion Pro}}
\begin{document}
\raggedright
12345\\
00000
\begin{table}[h]
\begin{tabular}{l}
12345\\
00000\\
\end{tabular}
\end{table}
12345\\
00000
\end{document}
NB: besides its simplicity, another nice thing here is you can insert additional table formatting as well. E.g., I usually want my tables \footnotesize
:
\AtBeginEnvironment{tabular}{\setmainfont{...}\footnotesize}
There is a package called tabfigures which I have not tried yet.