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'd like to align my equation to that it (and its label) fit on three lines.

MWE

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{xfrac}
\usepackage{transparent}
\usepackage{mathtools}

\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.0in,
          left=1.0in, right=1.0in}


\usepackage[usenames,dvipsnames]{color}

\newcommand{\Cline}[2][red]{
\text{\oalign{$#2$\cr\color{#1}\leaders\hrule height 0.80pt\hfil\cr}}}

\begin{document}

\begin{equation}
\begin{split}
R_{\sigma\mu\rho\nu} &= \bar{R}_{\sigma\mu\rho\nu}\\
&
+\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\mu}h_{\nu\sigma} 
+\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\nu}h_{\tau\sigma}
+\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\nu\tau}}
-\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\sigma}h_{\mu\nu} 
-\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\nu}}
-\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\nu}h_{\mu\tau}\\
&
-\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\mu}h_{\rho\sigma} 
-\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\rho}h_{\tau\sigma}
-\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\rho\tau}}
+\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\sigma}h_{\mu\rho} 
+\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\rho}}
+\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\rho}h_{\mu\tau}.
\end{split}
\end{equation}

\end{document}

Note that in my actual document, this equation has the number 6.18, as shown below. Here, I've drawn the red lines on where the margins start.

enter image description here

Here is an approximate mock-up of what I'd like:

enter image description here

share|improve this question
    
Did you try \documentclass[11pt, fleqn]{article}? Or is it just for some equations? Then I suggest you take a look at: tex.stackexchange.com/q/16840 –  Count Zero Apr 18 '13 at 13:50
    
@CountZero I'd like a local change. –  User 17670 Apr 18 '13 at 13:51
    
you might enter the left-hand expression as \qquad\llap{$R_{\sigma\mu\rho\nu}$} which will shove it to the left; the \qquad is intended to leave enough space that it doesn't go past the left margin. another option is to use \scalebox. the alignment is meaningful, so it would be a shame to make it less so, just for the sake of an extra line. –  barbara beeton Apr 18 '13 at 14:03
    
@barbarabeeton Could you provide a MWE please? –  User 17670 Apr 18 '13 at 14:11
add comment

4 Answers

up vote 5 down vote accepted

Two options: one using a multline environment and the other one using flalign (notice the use of \raisetag in the latter):

\documentclass[11pt]{book}
\usepackage[a4paper,showframe]{geometry}
\geometry{top=1.0in, bottom=1.0in,left=1.0in, right=1.0in}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xfrac}
\usepackage{transparent}
\usepackage{mathtools}
\usepackage[usenames,dvipsnames]{color}

\newcommand{\Cline}[2][red]{
  \text{\oalign{$#2$\cr\color{#1}\leaders\hrule height 0.80pt\hfil\cr}}}

\begin{document}
\setcounter{chapter}{5}
\chapter{Test}
\setcounter{equation}{17}
\setlength\multlinegap{0pt}
\begin{multline}
R_{\sigma\mu\rho\nu} = \bar{R}_{\sigma\mu\rho\nu}\\
+\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\mu}h_{\nu\sigma} 
+\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\nu}h_{\tau\sigma}
+\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\nu\tau}}
-\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\sigma}h_{\mu\nu} 
-\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\nu}}
-\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\nu}h_{\mu\tau}\\
-\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\mu}h_{\rho\sigma} 
-\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\rho}h_{\tau\sigma}
-\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\rho\tau}}
+\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\sigma}h_{\mu\rho} 
+\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\rho}}
+\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\rho}h_{\mu\tau}.
\end{multline}

\begin{flalign}
R_{\sigma\mu\rho\nu} &= \bar{R}_{\sigma\mu\rho\nu} &\nonumber \\
&+\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\mu}h_{\nu\sigma} 
+\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\nu}h_{\tau\sigma}
+\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\nu\tau}}
-\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\sigma}h_{\mu\nu} 
-\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\nu}}
-\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\nu}h_{\mu\tau}\nonumber & \\
&-\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\mu}h_{\rho\sigma} 
-\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\rho}h_{\tau\sigma}
-\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\rho\tau}}
+\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\sigma}h_{\mu\rho} 
+\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\rho}}
+\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\rho}h_{\mu\tau}.&
\raisetag{\baselineskip}
\end{flalign}

\end{document}

enter image description here

The showframe option for geometry only draws a frame as a visual guide.

share|improve this answer
    
Only thing is, my equation is numbered (6.18) and so it makes the third line wonky compared to the second line. –  User 17670 Apr 18 '13 at 13:55
    
@User17670 please see my updated answer. –  Gonzalo Medina Apr 18 '13 at 14:14
add comment

here's the adjusted example from the original question, as requested.

unfortunately, with the setup i'm using, there's an option clash with the color package, resulting in output without the desired colors.

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{xfrac}
\usepackage{transparent}
\usepackage{mathtools}

\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.0in,
          left=1.0in, right=1.0in}

\usepackage[usenames,dvipsnames]{color}

\newcommand{\Cline}[2][red]{
\text{\oalign{$#2$\cr\color{#1}\leaders\hrule height 0.80pt\hfil\cr}}}

\numberwithin{equation}{section}

\begin{document}

\setcounter{section}{6}
\setcounter{equation}{17}

\noindent Here is some text to establish the left margin.
\begin{equation}
\begin{split}
\qquad\llap{$R_{\sigma\mu\rho\nu}$}
&= \bar{R}_{\sigma\mu\rho\nu}\\
&
+\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\mu}h_{\nu\sigma} 
+\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\nu}h_{\tau\sigma}
+\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\nu\tau}}
-\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\sigma}h_{\mu\nu} 
-\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\nu}}
-\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\nu}h_{\mu\tau}\\
&
-\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\mu}h_{\rho\sigma} 
-\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\rho}h_{\tau\sigma}
-\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\rho\tau}}
+\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\sigma}h_{\mu\rho} 
+\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\rho}}
+\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\rho}h_{\mu\tau}.
\end{split}
\end{equation}

\end{document}

output of example code

sorry about the size; this didn't scale well.

share|improve this answer
    
If you want to, I can upload an image with the original colors. –  Gonzalo Medina Apr 18 '13 at 14:32
    
@GonzaloMedina -- thanks for the offer, but actually, i like your (accepted) answer better anyhow. i was prepared to delete this one, but someone may get some value from the use of spacing plus \llap. –  barbara beeton Apr 18 '13 at 14:34
    
+1 Nice. Visually, it's exactly what I was after (see my answer). –  User 17670 Apr 18 '13 at 14:41
add comment

Here are two suggestions:

Sample output

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{xfrac}
\usepackage{transparent}
\usepackage{mathtools}

\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.0in,
          left=1.0in, right=1.0in}


\usepackage[usenames,dvipsnames]{color}

\newcommand{\Cline}[2][red]{
\text{\oalign{$#2$\cr\color{#1}\leaders\hrule height 0.80pt\hfil\cr}}}

\numberwithin{equation}{section}

\begin{document}

\setcounter{section}{6}
\setcounter{equation}{17}

Either you can squeeze the binary operators
\begin{equation}
\begin{split}
R_{\sigma\mu\rho\nu} &= \bar{R}_{\sigma\mu\rho\nu}\\
&\quad
{+}\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\mu}h_{\nu\sigma} 
{+}\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\nu}h_{\tau\sigma}
{+}\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\nu\tau}}
{-}\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\sigma}h_{\mu\nu} 
{-}\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\nu}}
{-}\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\nu}h_{\mu\tau}\\
&\quad
{-}\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\mu}h_{\rho\sigma} 
{-}\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\rho}h_{\tau\sigma}
{-}\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\rho\tau}}
{+}\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\sigma}h_{\mu\rho} 
{+}\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\rho}}
{+}\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\rho}h_{\mu\tau}.
\end{split}
\end{equation}
Or you can name a subexpression
\begin{equation}
  \begin{aligned}
      R_{\sigma\mu\rho\nu} &= \bar{R}_{\sigma\mu\rho\nu} +
      S_{\sigma\mu\rho\nu} - S_{\sigma\mu\nu\rho},\\
      &\begin{aligned}
        \text{where}\quad S_{\sigma\mu\rho\nu}=&
        \tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\mu}h_{\nu\sigma}
        +\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\nu}h_{\tau\sigma}
        +\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\nu\tau}}\\&\quad
        -\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\sigma}h_{\mu\nu}
        -\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\nu}}
        -\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\nu}h_{\mu\tau}.
      \end{aligned}
  \end{aligned}
\end{equation}
This assumes \( h_{ab} \) is symmetric.

\end{document}
share|improve this answer
    
+1 Thanks for the suggestions! The idea of a subexpression never occurred to me, I got too focused on the LaTeX. It's a bit awkward to introduce at this point in the document however, so I've opted for a modified version of Gonzalo's answer. I'll add it in a minute. –  User 17670 Apr 18 '13 at 14:30
add comment

This is what I went for in the end (a modified version of Gonzalo Medina's great answer):

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xfrac}
\usepackage{transparent}
\usepackage{mathtools}
\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.0in,
          left=1.0in, right=1.0in}
\usepackage[usenames,dvipsnames]{color}
\newcommand{\Cline}[2][red]{
\text{\oalign{$#2$\cr\color{#1}\leaders\hrule height 0.80pt\hfil\cr}}}
\setcounter{section}{5}
\numberwithin{equation}{section}
\begin{document}
\section{Hello}
\setcounter{equation}{17}
\begin{flalign}
\,\,R_{\sigma\mu\rho\nu} &= \bar{R}_{\sigma\mu\rho\nu} &\nonumber \\ 
%NOTE THE \,\, TO MOVE THE WHOLE EQUATION TO THE RIGHT A BITPART MAKES THE EQUATION
%NUMBER VERTICALLY CENTRED.
&+\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\mu}h_{\nu\sigma} 
+\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\nu}h_{\tau\sigma}
+\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\nu\tau}}
-\tfrac{1}{2}\bar{\nabla}_{\!\rho}\bar{\nabla}_{\!\sigma}h_{\mu\nu} 
-\tfrac{1}{2}\Cline[Red]{\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\nu}}
-\tfrac{1}{2}\partial_{\rho}\bar{\Gamma}^{\tau}_{\sigma\nu}h_{\mu\tau}\nonumber & \\
&-\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\mu}h_{\rho\sigma} 
-\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\rho}h_{\tau\sigma}
-\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\mu\sigma}h_{\rho\tau}}
+\tfrac{1}{2}\bar{\nabla}_{\!\nu}\bar{\nabla}_{\!\sigma}h_{\mu\rho} 
+\tfrac{1}{2}\Cline[Blue]{\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\mu}h_{\tau\rho}}
+\tfrac{1}{2}\partial_{\nu}\bar{\Gamma}^{\tau}_{\sigma\rho}h_{\mu\tau}.&
\raisetag{1.4cm} 
%THIS 1.4cm PART MAKES THE EQUATION NUMBER VERTICALLY CENTRED.
\end{flalign}
\end{document}

Output:

enter image description here

share|improve this answer
add comment

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.