Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to make an 2-line equation tag, for a single equation. I am using the \tag command, and it works as long as I don't store a label for the equation. The moment I store a label, LaTeX barfs at me. In other words this code fails:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\label{mylabel}
\tag{\parbox[c][3em][c]{4em}{1st tag \\ 2nd tag}}
x = y^2
\end{equation}
\end{document}

But this code works:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
%\label{mylabel}
\tag{\parbox[c][3em][c]{4em}{1st tag \\ 2nd tag}}
x = y^2
\end{equation}
\end{document}

Any ideas?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

The value for \label is written into the .aux file, thus you need \protect for the fragile \parbox:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\label{mylabel}
\tag{\protect\parbox[c][3em][c]{4em}{1st tag \\ 2nd tag}}
x = y^2
\end{equation}
\end{document}

Result

A tabular fixes at least the right white space:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\label{mylabel}
\tag{\protect\begin{tabular}{@{}l@{}}1st tag \\ 2nd tag\protect\end{tabular}}
x = y^2
\end{equation}
\end{document}

Result

But I would avoid two line tags, too many problems remain:

  • Confusion for the reader: two tags for one equation.
  • The parentheses are too small.
  • Two line references would not look too well.

Therefore I would use one line, e.g.:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\label{mylabel}
\tag{1st tag/2nd tag}
x = y^2
\end{equation}
\end{document}

Result

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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