# Putting an equation with a long tag on a single line

I m trying to put this equation with the author tag (Oppenheimer & Volkoff 1939) but the tag is too large to fit in one line. how do I put the equation and then the tag on the right side fitting in one line ?

\frac {dP}{dr}=- \frac {(P+\rho c^2 )\nu '} {2} \tag {Oppenheimer & volkoff 1939}


\documentclass[12pt,a4paper]{article}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\begin {document}
\frac {dP}{dr}=\frac {-(P+\rho c^2 )\nu '} {2} \tag {Oppenheimer \& Volkoff 1939

\end{document}


and it's simply not working.

• It fits in one line for me: i.stack.imgur.com/nQ7T8.png . Can you post a complete exaple starting from \documentclass{} and ending at \end{document}? – user11232 Aug 5 '14 at 6:27
• My answer to the closely related question might be of help: tex.stackexchange.com/questions/191993/… – Bernard Aug 5 '14 at 9:57
• First of all, type \tag{Oppenheimer \& Volkoff 1939}, as the simple & is an error when a literal ampersand is wanted. – egreg Aug 5 '14 at 9:58
• @ Haqrish Kumar, can you please rewrite the code for me? unfortunately It's not fitting in my code – Tazkera Haque Trina Aug 5 '14 at 11:47

Try this:

\documentclass[12pt,a4paper]{article}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{fourier}
\begin {document}
$\frac{dP}{dr}=\frac{-(P+\rho c^2 )\nu'} {2} \tag {Oppenheimer \& Volkoff 1939}$
\end{document}


You forgot $...$ and \usepackage{amsmath}.

Here is how I would do it:

\documentclass{article}

\usepackage{mathtools}
\usepackage{fourier}

\newcommand*\horse{\noindent Text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text.}
\newcommand*\differential{\mathop{}\!\mathrm{d}}
\newcommand*\diff[3][\differential]{\frac{#1 #2}{#1 #3}}

\begin{document}

\horse
$$\diff{P}{r} = \frac{-\left(P + \rho c^{2}\right)\nu'}{2} \tag{Oppenheimer \& Volkoff, 1939}$$
\horse

\end{document}


Notice that this answer is somewhat similar to Papiro's in as much as I also use the \tag command.