Hello,
The following code will not execute in latex:
\begin{align*}
\left[a + b &= c + d\right] \\
\left[e + f &= g + h\right]
\end{align*}
The problem has to do with the "\left" and "\right" commands for the brackets. If I remove the "&" in front of both equal signs the code compiles, but the equations are not aligned properly. Is there a way to align the equations and use the "\left" and "\right" commands simultaneously?
Thanks for the help!
Page Layout ⇒ Using align and \left \right commands at same time.
-
- Posts: 2
- Joined: Thu Sep 08, 2011 4:29 pm
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Using align and \left \right commands at same time.
Every side of the equations represents a group. So scalable delimiters of this kind don't work across those boundaries. You have to insert some intermediate invisible delimiters.
The same applies in a similar way to delimiters across several lines.
Best regards and welcome to the board
Thorsten
Code: Select all
Code, edit and compile here:
\documentclass[11pt]{article}\usepackage[T1]{fontenc}\usepackage{mathtools} % loads »amsmath«\begin{document}\begin{align*}\left[a + b\right. &=\left. c + d\right] \\\left[e + f\right. &=\left. g + h\right]\end{align*}\end{document}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 2
- Joined: Thu Sep 08, 2011 4:29 pm
Re: Using align and \left \right commands at same time.
Hello,
The code posted works well, except for one minor problem. If the right side of the equation (d in this case) is taller than the left side (a in this case), then the right bracket is larger than the left. Is there a way to match the heights of both brackets?
Thank you.
The code posted works well, except for one minor problem. If the right side of the equation (d in this case) is taller than the left side (a in this case), then the right bracket is larger than the left. Is there a way to match the heights of both brackets?
Thank you.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Using align and \left \right commands at same time.
I see two possible approaches.
For more stuff about math typesetting have a look at the excellent »Math mode« document.
- Insert a vertical phantom on the left side to get the automatic scaling right.
- Adjust the delimiters manually and you only need one real pair of them.
Code: Select all
Code, edit and compile here:
\documentclass[11pt]{article}\usepackage[T1]{fontenc}\usepackage{mathtools} % loads »amsmath«\begin{document}\begin{align*}\left[a + b\vphantom{\frac{0}{0}}\right. &=\left. c + \frac{x-d}{x+d}\right] \\\bigg[e + f &= g + \frac{x-h}{x+h}\bigg]\end{align*}\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10