5

I have written 4 equations in two lines and I want to give a single number for all of them without changing their format. My code for the equations is the following:

\begin{center}
$\dot{R}=\frac{66}{364}\ P_R+ \frac{\partial V}{\partial P_R}$\qquad
$\dot{\theta}=2P_{\theta}(\frac{13}{168r^2}-\frac{33}{364R^2})+\frac{\partial V}{\partial P_{\theta}}$
\end{center}
\begin{center}
$\dot{P_{\theta}}=-\frac{\partial V}{\partial \theta}$\qquad
$\dot{P_R}=\frac{66P^2_{\theta}}{364R^3}-\frac{\partial V}{\partial R}$
\end{center}

Any help will be much appreciated.

1
  • Have a look at the gather and aligned environments in amslatex. (Search for gather amsmath)
    – JPi
    May 6, 2015 at 12:47

4 Answers 4

4

If you want to have some more alignment than you have right now I would recommend the following approach:

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{equation}
\begin{alignedat}{2}
    \dot{R}&=\frac{66}{364}\,P_R+ \frac{\partial V}{\partial P_R} \qquad
    &\dot{\theta}&=2P_{\theta}\Bigl(\frac{13}{168r^2}-\frac{33}{364R^2}\Bigr)+\frac{\partial V}{\partial P_{\theta}}\\
    \dot{P_{\theta}}&=-\frac{\partial V}{\partial \theta}
    &\dot{P_R}&=\frac{66P^2_{\theta}}{364R^3}-\frac{\partial V}{\partial R}
\end{alignedat}
\end{equation}
\end{document}

enter image description here

You may align to the very left or very right of every term by moving the & symbols there, of course.

3

You could use an aligned environment inside an equation environment.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'aligned' environment
\begin{document}
\begin{equation}
\begin{aligned}
\dot{R}&=\frac{66}{364}\, P_R+ \frac{\partial V}{\partial P_R} 
&\qquad
\dot{\theta}&=2P_{\theta}\Bigl(\frac{13}{168r^2}-\frac{33}{364R^2}\Bigr)
      +\frac{\partial V}{\partial P_{\theta}}
\\
\dot{P_{\theta}}&=-\frac{\partial V}{\partial \theta}
&
\dot{P_R}&=\frac{66P^2_{\theta}}{364R^3}-\frac{\partial V}{\partial R}
\end{aligned}
\end{equation}
\end{document}
2

Instead of all those math ($…$) and center environments, and since you do not seem to wish any particular alignment, I would recommand an equation environment combined with a gathered environment (with a bit of additional vertical space here between the two lines, but it's not mandatory) from the amsmath package. It does the same job, but much more shortly and elegantly, I think.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  \begin{equation}
    \begin{gathered}
      \dot{R}=\frac{66}{364}\ P_R+ \frac{\partial V}{\partial P_R}\qquad
      \dot{\theta}=2P_{\theta}(\frac{13}{168r^2}-
        \frac{33}{364R^2})+\frac{\partial V}{\partial P_{\theta}}\\[1ex]
      \dot{P_{\theta}}=-\frac{\partial V}{\partial \theta}\qquad
      \dot{P_R}=\frac{66P^2_{\theta}}{364R^3}-\frac{\partial V}{\partial R}
    \end{gathered}
  \end{equation}
\end{document}

enter image description here

1

Here is one way, using a stack. The top set are your originals; the bottom set are my replacement, "without changing their format," as requested.

\documentclass{article}
\usepackage{stackengine}
\stackMath
\begin{document}

\begin{center}
$\dot{R}=\frac{66}{364}\ P_R+ \frac{\partial V}{\partial P_R}\qquad
\dot{\theta}=2P_{\theta}(\frac{13}{168r^2}-\frac{33}{364R^2})+\frac{\partial V}{\partial P_{\theta}}$
\end{center}
\begin{center}
$\dot{P_{\theta}}=-\frac{\partial V}{\partial \theta}\qquad
\dot{P_R}=\frac{66P^2_{\theta}}{364R^3}-\frac{\partial V}{\partial R}$
\end{center}

\begin{equation}
\stackanchor[10pt]{
\dot{R}=\frac{66}{364}\ P_R+ \frac{\partial V}{\partial P_R}\qquad
\dot{\theta}=2P_{\theta}(\frac{13}{168r^2}-\frac{33}{364R^2})+\frac{\partial V}{\partial P_{\theta}}
}{
\dot{P_{\theta}}=-\frac{\partial V}{\partial \theta}\qquad
\dot{P_R}=\frac{66P^2_{\theta}}{364R^3}-\frac{\partial V}{\partial R}
}
\end{equation}
\end{document}

enter image description here

For a slightly altered presentation, here is a tabular stack, wherein the columns are individually centered:

\documentclass{article}
\usepackage{tabstackengine}
\stackMath
\begin{document}
\begin{equation}
\setstacktabulargap{2em}
\tabularstackanchor[10pt]{cc}{
\dot{R}=\frac{66}{364}\ P_R+ \frac{\partial V}{\partial P_R}&
\dot{\theta}=2P_{\theta}(\frac{13}{168r^2}-\frac{33}{364R^2})+\frac{\partial V}{\partial P_{\theta}}
}{
\dot{P_{\theta}}=-\frac{\partial V}{\partial \theta}&
\dot{P_R}=\frac{66P^2_{\theta}}{364R^3}-\frac{\partial V}{\partial R}
}
\end{equation}
\end{document}

enter image description here

You must log in to answer this question.

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