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.

My MWE:

\documentclass{report}
\usepackage{amsmath}

\begin{document}

The partial derivatives are given by:
\begin{subequations}
\begin{align}
\frac{\partial \beta_{2,1}}{\partial x_1} &= \gamma_2x_2 \cos(x_1), &&\frac{\partial \beta_{2,1}}{\partial x_2} = \gamma_2 \sin(x_1), &&&\frac{\partial \beta_{2,1}}{\partial u} = 0\\
\frac{\partial \beta_{2,2}}{\partial x_1} &= 0, &&\frac{\partial \beta_{2,2}}{\partial x_2} = \gamma_2 x_2, &&&\frac{\partial \beta_{2,2}}{\partial u} = 0\\
\frac{\partial \beta_{2,3}}{\partial x_1} &= 0, &&\frac{\partial \beta_{2,3}}{\partial x_2} = \gamma_2 u, &&&\frac{\partial \beta_{2,3}}{\partial u} = \gamma_2x_2
\end{align}
\end{subequations}

\end{document}

The result: enter image description here

However, I would like to obtain the following result: enter image description here

share|improve this question

2 Answers 2

up vote 5 down vote accepted

To have fuller control on the spacing of equations, you can use the alignat environment. In addition, to simplify typing partial derivatives (fist order only), I introduce a macro, \pder with one argument — actually two, separated by a comma, based on the esdiff package and on xparse. Here is an example, where the groups of equations are separated by 0.8em:

\documentclass{report}
\usepackage{amsmath}
\usepackage{esdiff}
\usepackage{xparse}

\NewDocumentCommand\pder{>{\SplitArgument{1}{,}}m}{\pderaux#1}
\NewDocumentCommand\pderaux{m m}{\diffp{{#1}}{{#2}}}

\begin{document}

The partial derivatives are given by:

\begin{subequations}
\begin{alignat}{5}
\pder{\beta_{2,1}, x_1} & = \gamma_2x_2 \cos(x_1), &\hspace{0.8em}   \pder{\beta_{2,1}, x_2} & = \gamma_2 \sin(x_1), &\hspace{0.8em}    \pder{\beta_{2,1}, u} &= 0\\
\pder{\beta_{2,2}, x_1} & = 0,& \pder{\beta_{2,2}, x_2}&= \gamma_2 x_2,&  \pder{\beta_{2,2}, u} &= 0 \\
\pder{\beta_{2,3}, x_1} & = 0, & \pder{\beta_{2,3}, x_2} & = \gamma_2 u, &  \pder{\beta_{2,3}, u} &  = \gamma_2x_2
\end{alignat}
\end{subequations}

\end{document} 

enter image description here

share|improve this answer

Tell LaTeX more accurately what spacing you want, by inserting more ampersands.

enter image description here

Please note that putting the ampersand after the equals sign (=&) will produce less spacing between the equals sign and the character that follows. Putting the ampersand before (i.e. &=) will produce slightly prettier spacing.

\documentclass{report}
\usepackage{amsmath}

\begin{document}

The partial derivatives are given by:
\begin{subequations}
\begin{align}
\frac{\partial \beta_{2,1}}{\partial x_1} &= \gamma_2x_2 \cos(x_1),     &\frac{\partial \beta_{2,1}}{\partial x_2} &= \gamma_2 \sin(x_1),   &\frac{\partial \beta_{2,1}}{\partial u} &= 0\\
\frac{\partial \beta_{2,2}}{\partial x_1} &= 0,                 &\frac{\partial \beta_{2,2}}{\partial x_2} &= \gamma_2 x_2,     &\frac{\partial \beta_{2,2}}{\partial u} &= 0\\
\frac{\partial \beta_{2,3}}{\partial x_1} &= 0,                 &\frac{\partial \beta_{2,3}}{\partial x_2} &= \gamma_2 u,       &\frac{\partial \beta_{2,3}}{\partial u} &= \gamma_2x_2 
\end{align}
\end{subequations}

\end{document}
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.