3

I'm searching for a way to enforce text figures in LaTeX tables, figures, and the references (and cross-referencing) to tables and figures.

For instance, the table number should be written with text figure format.

Please let me know if something is not clear. Any idea would be helpful.

  • try \renewcommand{\thefigure}{\oldstylenums{\arabic{figure}}} for example – touhami Sep 14 '16 at 15:31
  • Added comment to the answer – tandem Sep 14 '16 at 15:48
2

Here is a solution

\documentclass{article}

%---------------------
% just for the example
\usepackage{mwe}
\setcounter{figure}{18}
\setcounter{table}{68}
%---------------------

\renewcommand{\thefigure}{\oldstylenums{\arabic{figure}}}
\renewcommand{\thetable}{\oldstylenums{\arabic{table}}}

\begin{document}
\listoffigures
\listoftables

my nice figure \ref{nf} and  my table \ref{nt}\lipsum[1]
\begin{figure}
\centering
\includegraphics[scale=.45]{example-image}
\caption{Nice  figure}
\label{nf}
\end{figure}
\begin{table}
\caption{Nice table}\label{nt}
\centering
\begin{tabular}{|c|c|}
\hline 
a & 1 \\ 
\hline 
b & 2 \\ 
\hline 
\end{tabular} 
\end{table}
\end{document}

Update if chapters used

\renewcommand{\thefigure}{%
\ifnum\value{chapter}>0 \oldstylenums{\arabic{chapter}}.\fi
\oldstylenums{\arabic{figure}}}
\renewcommand{\thetable}{%
\ifnum\value{chapter}>0 \oldstylenums{\arabic{chapter}}.\fi\oldstylenums{\arabic{table}}}

enter image description here

  • This works great if you are referring to a figure in a section.. not when the figure is in a given section of a chapter. – tandem Sep 14 '16 at 15:47
  • @tandem answer updated. – touhami Sep 14 '16 at 17:28
  • thanks for the update. but now there is an error.. here it is: Package textcomp Warning: Oldstyle digits unavailable for family ptm. (textcomp) Lining digits used instead on input line 102. – tandem Sep 14 '16 at 19:14
  • @tandem you didn't provide a minimal example so i can't guess what fonts and packages are used. – touhami Sep 14 '16 at 19:24
  • 1
    @tandem I copied the short block that has the Update above (answer) and the line mentioned in my last comment. – Johannes_B Sep 19 '16 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.