# Automatically add a vertical spacing in formula numbering [duplicate]

I have a document with several equations that fit the text width, so the tag is below the equation in those long formulas. I don't want to use splitting enviroments but in some cases, specially in cases environment with \frac{}{}, I would like more distance between the tag and the equation. I know it is possible to manually add this space with \raisetag command. Is it possible to automatically increment this vertical spacing only for those equations that fit the line width?

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
$$a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a \begin{cases} \frac{1}{2}\\ \frac{1}{3} \end{cases}$$
\end{document}


## marked as duplicate by Werner, David Carlisle, Heiko Oberdiek, Adam Liter, MalipivoMay 5 '14 at 19:58

• @Werner -- one-line equation isn't handled very well in that answer (read the comments); the answer i've given here does work in that environment. – barbara beeton May 5 '14 at 19:40
• @Werner Thank you for the comment but I would like an automatic procedure to avoid checking all the equations in the document. – Diego May 5 '14 at 20:06
• @Diego you may wish to highlight the fact that you want an automatic implementation. I know you mention it, but you might want to say that this is why this is not a duplicate. I'll vote to reopen, though it seems like this might be a difficult problem ... – Adam Liter May 5 '14 at 21:31
• @AdamLiter Thank you, I've edited the question (and the title) to try to highlight this fact. Anyway, from your comments, it seems that there is no way to automate this issue... – Diego May 5 '14 at 22:12
• @Diego There may very well be a way to do so, but if there is, then it's beyond me. Hopefully someone else might know how to do this. – Adam Liter May 5 '14 at 22:13

this is really a hack, and it isn't automatic ... you can insert a zero-width rule with extra depth after the \end{cases}. for example,

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
$$a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a \begin{cases} \frac{1}{2}\\ \frac{1}{3} \end{cases} \vrule width0pt depth20pt$$
\end{document}


(first time i've ever seen this asked. usually, it's "how do i move the equation number onto a shorter line in the group?")

edit: as david carlisle has pointed out in the answer to Equation number too close to my equation, \raisetag{-<dimen>} will work with the multi-line structures defined in amsmath when the equation number has been moved out of its default location because it doesn't fit, but it doesn't work with equation. and it's not recommended to use a multi-line structure when only a single line is involved.

• Thank you very much for the answer. Add vertical space was my first attempt but I want to avoid checking all equations in the document. As you point out, it seems difficult... – Diego May 5 '14 at 20:06