2

I am using the achemso package to submit a paper to Environmental Science and Technology. When I include a reference to a figure (\ref{Fig1}), the figure number appears preceded by the word "Figure." I would like to reference "Figures 1-2", but using \ref{Fig1,Fig2} gives an error and \ref{Fig1}-\ref{Fig2} gives "Figure 1-Figure 2."

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Adam Liter Jul 29 '14 at 23:18
  • 1
    You have an old version of achemso installed. For various reasons I dropped some time ago the 'auto-magic' addition of 'Figure' or similar to cross-references. The current release doesn't do this, so would just require e.g. Figures~\ref{fgr:one}--\ref{fgr:two}. Note that as the ACS re-typeset your papers once accepted, there is not really a big issue here in any case (other than the fact that referees sometimes comment on this sort of thing even though it's not actually an issue!). – Joseph Wright Jul 30 '14 at 6:42
2

Use the cleveref package and the \cref command. It automatically sorts and compress the references. For instance, typesetting \cref{Fig1, Fig5, Fig2, Fig3} will print figures 1-3 and 5 (if they're labelled so). If later your figures become another structure (say a table), the names will change accordingly. It has a multilingual support.

For the current versions of achemso and cleveref (7/2015), this looks like the following. You might want to read the cleveref manual on how to get a hyphen instead of the word "to".

% arara: pdflatex

\documentclass{achemso}
\title{title}
\usepackage{cleveref}

\begin{document}    
\begin{figure}
    \rule{1cm}{1cm}
    \caption{captioneins}\label{fig:labeleins}
\end{figure}
\begin{figure}
    \rule{1cm}{1cm}
    \caption{captionzwei}\label{fig:labelzwei}
\end{figure}
\begin{figure}
    \rule{1cm}{1cm}
    \caption{captiondrei}\label{fig:labeldrei}
\end{figure}

\Cref{fig:labeleins}, \cref{fig:labeleins,fig:labelzwei}, \cref{fig:labeleins,fig:labeldrei}, and \cref{fig:labeleins,fig:labelzwei,fig:labeldrei}
\end{document}

enter image description here

  • Won't work here. Older versions of achemso load either cleverref or varioref implicitly, but that caused various issues so I dropped it! – Joseph Wright Jul 30 '14 at 6:41
  • @JosephWright please see my edit above. Looks as if this is working fine at the moment. Or do you see some drawbacks for cleveref used with your documentclass? – LaRiFaRi Jul 21 '15 at 14:13

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.