Multiple alignment points in LaTeX

In summary, the conversation is about align and alignat environments and how to handle long equations with multiple equalities in them. The desired result is to have the equations align properly, but when using align or alignat, the output is not satisfactory. The suggestion is to use two separate align environments instead of one, as the desired result may not be possible with one environment.
  • #1
Fredrik
Staff Emeritus
Science Advisor
Gold Member
10,877
422
If I have two strings of equalities within the same align or alignat environment, and the first one is long enough to need two lines, I would want the result to look like
Code:
A+B+C=D=E
     =F=G=H
I=J
rather than
Code:
A+B+C=D=E
     =F=G=H
    I=J
Is there a way to do this? I suppose it can be done with an array, but I thought either align or alignat would be able to handle this. I get garbage results like these:

\begin{alignat}{3}
&F_k &=(f\chi_E)^{-1}(v_k)=\{x\in X|f(x)\chi_E(x)=v_k\}=\{x\in X|f(x)=v_k\}\cap E\\
&&=f^{-1}(v_k)\cap E=E_k\cap E\in\Sigma,\\
&\mu\big(F_k)=\mu(E_k\cap E)\leq\mu(E_k)<\infty.
\end{alignat}

\begin{alignat}{4}
&F_k && =(f\chi_E)^{-1}(v_k) =\{x\in X|f(x)\chi_E(x)=v_k\}=\{x\in X|f(x)=v_k\}\cap E\\
&&&=f^{-1}(v_k)\cap E=E_k\cap E\in\Sigma,\\
&\mu\big(F_k)=\mu(E_k\cap E)\leq\mu(E_k)<\infty.
\end{alignat}
 
Physics news on Phys.org
  • #2
Have you tried using two separate \begin{align}...\end{align} environments? What you are trying to achieve, might not be possible within one environment.
 

What is multiple alignment in LaTeX?

In LaTeX, multiple alignment refers to the ability to align several lines of text or equations at specific points, such as at equal signs or decimal points. This allows for a visually organized and professional-looking document.

How do I create multiple alignment in LaTeX?

To create multiple alignments in LaTeX, you can use the "align" or "aligned" environment, depending on whether you want the alignment to span multiple lines or just a single line. Within these environments, you can use the "&" symbol to indicate where you want the alignment points to be.

Can I customize the alignment points in LaTeX?

Yes, you can customize the alignment points in LaTeX by using the "alignat" environment, which allows you to specify the number of alignment points and their positions. You can also adjust the spacing between the alignment points by using the "&" symbol with a specified space, such as "&\quad" or "&\hspace{1cm}".

What are some common mistakes when using multiple alignment in LaTeX?

Some common mistakes when using multiple alignment in LaTeX include forgetting to use the "align" or "aligned" environment, using the incorrect number of "&" symbols, or not properly indicating the end of a line with the "\\" command. It is important to double check your code and use proper syntax to avoid these mistakes.

Are there any packages or tools that can help with multiple alignment in LaTeX?

Yes, there are several packages and tools that can assist with multiple alignment in LaTeX, such as "amsmath" for advanced math typesetting, "array" for creating tables with customized alignment, and "mathtools" for additional alignment options. There are also online tools and guides available to help with creating and troubleshooting multiple alignments.

Similar threads

  • Introductory Physics Homework Help
Replies
2
Views
633
  • Classical Physics
Replies
17
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Replies
1
Views
929
  • Calculus and Beyond Homework Help
Replies
2
Views
160
  • Calculus and Beyond Homework Help
Replies
2
Views
497
  • Classical Physics
Replies
0
Views
146
  • Special and General Relativity
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
302
Back
Top