I am currently using the \autoref command from the hyperref package to refer to my theorems etc. However, I want to be able to (easily) refer to two or more theorems/lemmas/..., e.g. by calling something like \autoref{lemma1,lemma2,lemma5} -- where of course lemmas 1, 2 and 5 are labeled lemma1, lemma2 and lemma5 respectively -- so that the reference shows: "Lemmas 1, 2 and 5".

Can anyone help me with this? It doesn't seem to me like the hyperref package provides this functionality.

Minimal example

This is the first equation
a^2 + b^2 = c^2
and this is the second equation
\alpha^2 + \beta^2 = \gamma^2
Referring to second equation here: \eqref{test}.
  • 6
    Have you checked out the cleveref package? It allows multiple references, with sorting and collapsing (e.g. turns "1,3,2,7" into "1--3 and 7"), among other nice things.
    – Aaron
    Apr 13, 2011 at 17:47
  • 1
    Yes, I have. But it doesn't seem to work well in my document. See an example here: codeviewer.org/view/code:197c If I remove the cleveref package, the reference works. It seems to conflict with mathtools' showonlyrefs option.
    – smlange
    Apr 13, 2011 at 20:06
  • 2
    Yes, mathtools redefines the eqref command to do some extra things (writing to the aux file, specifically). Cleveref also wants to patch the reference system, and the two don't play well together. I think that it would be non-trivial to graft them together, because you'd need to pull apart a comma-separated list of label names then write them all to the aux file to make mathtools happy.
    – Aaron
    Apr 13, 2011 at 22:40

1 Answer 1


EDIT added a way to set the plural names, which in effect gives foreign language support

I decided that I needed this feature of \autoref today and then I was surprised that I was unable to find it...so here is one way to define an \Autoref command that will do it. Specifically,


will expand into the plural of the first reference followed by hyperlinks for all of the references. Here's the sample output from the MWE below:

Sample for multiple <code>\autoref</code>'s

There are a few minor(?) limitations in that the macro assumes that:

  • all of the references are of the same "type" (so all lemmas, or all theorems etc)

  • doesn't handle the optional argument to \autoref or the *-form (would be easy to fix...)

  • it probably does not play well with equation references

  • by default the plural form is obtained simply by adding an s to the "singular" name (so it is English centric). This can be overridden by defining a plural version of the autorefname, for example \providecommand*{\lemmaautorefnameplural}{Lots of lemmas}. A more realistic application would be to define plurals for other languages. The ...autorefnameplural form is optional

The \Autoref macro behaves like \autoref when it is given one reference.

Anyway, here's the code:


% define a macro \Autoref to allow multiple references to be passed to \autoref
\def\@throw@dot#1.#2@{#1}% discard everything after the dot
\def\@set@refname#1{%    % set \@refname to autoefname+s using \getrefbykeydefault
    \ltx@IfUndefined{\@tmp autorefnameplural}%
         {\def\@refname{\@nameuse{\@tmp autorefname}s}}%
         {\def\@refname{\@nameuse{\@tmp autorefnameplural}}}%
  \ifx#2@\autoref{#1}\let\@nextref\@gobble% only one ref, revert to normal \autoref
    \@set@refname{#1}%  set \@refname to autoref name
    \@refname~\ref{#1}% add autoefname and first reference
    \let\@nextref\@next@ref% push processing to \@next@ref
   \ifx#2@ and~\ref{#1}\let\@nextref\@gobble% at end: print and+\ref and stop
   \else, \ref{#1}% print  ,+\ref and continue

%\providecommand*{\lemmaautorefnameplural}{Lots of lemmas}


By \autoref{one}, \autoref{two} and \autoref{three} we are amazed.

By \Autoref{one} we are not amazed.

By \Autoref{one,two} we are a little amazed.

By \Autoref{one,two,three} we are quite amazed.


If you uncomment the line

\providecommand*{\lemmaautorefnameplural}{Lots of lemmas}

then the output is:

enter image description here

A more realistic use of this feature would be to add foreign language support.

  • Hi, thanks for this! Sorry to bump this so late, but is there any way of changing the plural names? Adding an s at the end doesn't work for other languages..
    – Guido
    Feb 23, 2017 at 14:57
  • 2
    @Guido I have added "foreign language support". It is now possible to define plural versions of the name such as \lemmaautorefnameplural. If these do not exist the plural form is still given by adding an s
    – user30471
    Sep 28, 2017 at 11:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .