Consider the following MWE:






a=b\quad c=d\quad e=f 
\tag{\ref*{a},$,$ \ref*{c},$,$ \ref*{e}}


When I compile it, it doesn't show the third tag and gives me two errors:

  • paragraph ended before @firstoffive was complete
  • argument of @firstoffive has an extra }

I think the problems are due to the hyperref package because by removing it and substituting \tag* with \tag it doesn't give me any error whatsoever. In addition, when using hyperref I've to manually insert the commas in a math environment in order for them to be shown.

What are those errors? How can I get rid of them and have the file to compile correctly?

Thank you for your time, it is very appreciated.


For more clarity, this is what the code erringly compiles to:

enter image description here

This is how I want it to compile, and how correctly compiles without using the hyperref package:

enter image description here

  • What's the purpose of the two $,$ items in the argument of \tag? And what are you trying to achieve by using \latexlabel rather than \label directly?
    – Mico
    Commented Nov 18, 2018 at 20:15
  • @Mico I've to insert manually the commas in a math environment because otherwise, for some obscure reason, it doesn't plot the commas between the tag numbers. I've not written the code myself, I took it from tex.stackexchange.com/questions/120670/… Commented Nov 18, 2018 at 20:53
  • @Mico question edited, now it should be more clear what is asked, thank you. Commented Nov 18, 2018 at 21:03

1 Answer 1


In order for the code to compile correctly, \AtBeginDocument{\let\latexlabel\label} has to be loaded after the hyperref package. Doing so, not only the code compiles correctly but the commas in the math environment can and should be removed too.

You must log in to answer this question.

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