I write the following very simple lines, and I just want to left align the equality signs in two lines. But a lot of extra space appear before the second equality sign in each line. How can I align them without having these extra spaces. Thank you very much in advance.
I tried 3 different ways and have the same problem in all:
***********************
\begin{align}
X&=X+W&=f\\
x&=x&=f_2.
\end{align}
************************
\begin{align}
X&=X+W&&=f\\
x&=x&&=f_2.
\end{align}
************************
\begin{align}
X&=X+W&=&f\\
x&=x&=&f_2.
\end{align}
***********************
General ⇒ A simple problem with extra space in "aligning"
NEW: TikZ book now 40% off at Amazon.com for a short time.

A simple problem with extra space in "aligning"
Perhaps alignat would be suitable?
If not, then consider some kind of matrix or array environment.
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat}{2}
X&=X+W& &=f\\
x&=x & &=f_2.
\end{alignat}
\end{document}
Re: A simple problem with extra space in "aligning"
Thank you very much! "alignat" solved the problem.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
A simple problem with extra space in "aligning"
Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.
Thorsten
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