### LaTeX users online

In total there are**7**users online :: 0 registered, 0 hidden and 7 guests (based on users active over the past 5 minutes)

Most users ever online was

**1327**on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 7 guests

## multiple alignment points and \split environment## LaTeX Forum: Math & ScienceAdd tags
4 posts
• Page
1 of 1
Hi there,
I'd like to display a two line equation aligned in more than one place across two lines, but only supply it with one number. I.e. in an equation like: a=b=c ab=bc=c^2 I'd like the = signs to be aligned vertically, and I want 1 equation number to the right halfway between the two lines. I know alignment can be done with \alignat, and the numbering can be done with \split, but I can't seem to get both things at once. MWE: - Code: Select all • Open in online LaTeX editor
`\documentclass[10pt,a4paper]{article}` \usepackage{amsmath} \begin{document} \section{Test} \begin{alignat}{3} a&={}&b&={}&c\\ ab&={}&bc&={}&c^2 \end{alignat} \begin{alignat}{3} a&=b&=c\\ ab&=bc&=c^2 \end{alignat} \begin{equation} \begin{split} a&=b=c\\ ab&=bc=c^2 \end{split} \end{equation} \end{document}
Also, alignat seems to require an extra {}& per equal sign that I don't quite understand (top equation in the MWE, since the one below has strange spacing). Could someone explain this to me? Furthermore, the split environment will produce error messages if I put more & symbols on one line. For example, inserting this in the MWE will produce error messages: - Code: Select all • Open in online LaTeX editor
`\begin{equation}` \begin{split} a&=b&=c\\ ab&=bc&=c^2 \end{split} \end{equation}
Could someone help me align and number things the way I like? Thanks in advance. (Some more details I'm not quite sure are useful: I use WinEdt 6.0 with MikTex 2.8 and PDFTexify) Last edited by Drugbird on Thu Sep 2nd, 2010, edited 1 time in total.
- Drugbird
**Posts:**2**Joined:**Tue Aug 31st, 2010
It has to look a bit different. The code below shows only the relevant part.
- Code: Select all • Open in online LaTeX editor
`\begin{equation}` \begin{alignedat}{2} a &= b & &= c\\ ab &= bc & &= c^2 \end{alignedat} \end{equation}
See the amsmath manual for details. More stuff about math typesetting can be found in the »Math mode« document. Best regards and welcome to the board Thorsten LaTeX Community Moderator
How to make a "Minimal Example" Board Rules Avoidable Mistakes ¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351) ² Posting stopped indefinitely due to offenses -
localghost - Site Moderator
**Posts:**9218**Joined:**Fri Feb 2nd, 2007**Location:**Braunschweig, Germany
Thanks a lot, localghost. This is exactly what I was looking for.
I'm still not quite sure though why you need three & symbols per line. My reasoning is that there are only two equal signs that need to be aligned, so you'd also need two & symbols. I tried searching the amsmath documentation, but was unable to find it... Any help? - Drugbird
**Posts:**2**Joined:**Tue Aug 31st, 2010
Consider the alignat environment as an array with special alignment of the columns. - Code: Select all • Open in online LaTeX editor
`\begin{array}{@{}r@{\,=\,}lr@{\,=\,}l@{}}` a & b & c \\ aa & bb & cc \end{array}
If you declare an alignat environment with n as its mandatory argument for the number of equal signs to be aligned, you will need n+1 alignment characters (ampersands) to get the right alignment. Take a look at Sections 3.6 and 3.7 of the amsmath manual. You can find similar descriptions in the »Math mode« document. LaTeX Community Moderator
How to make a "Minimal Example" Board Rules Avoidable Mistakes ¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351) ² Posting stopped indefinitely due to offenses -
localghost - Site Moderator
**Posts:**9218**Joined:**Fri Feb 2nd, 2007**Location:**Braunschweig, Germany
4 posts
• Page
1 of 1
## LaTeX users onlineUsers browsing this forum: No registered users and 7 guests |