[Tex/LaTex] Align all equal signs in the document

alignequationshorizontal alignment

Is there a way to align all the equal signs in all equations all over the document? I write a theses (scrbook) and like all equal signs to line up. At least in a chapter if not possible for the whole document.

The \begin{align} or \begin{eqnarray} just do that for the small group. And to use \intertext for a whole chapter is unpractikal.

Example how it is at the moment:

\begin{align}    
F_L^{\rightarrow}   & =     q ( E_{eFeld}^{\rightarrow} + v^{\rightarrow} \times B^{\rightarrow} )
    \end{align}

much text

    \begin{align}
    F_{Lx}  & =     q ( E_{eFeld} + v_{gx} * B )
    \end{align}

    little text

    \begin{align}
    T   & =     F_{L1} - F_{L2}                                         \\
        & =     q ( E_{eFeld} + v_{g1} * B - E_{eFeld} - v_{g2} * B )   \\
        & =     q*B ( v_{g1} - v_{g2} )         
    \end{align}                     

    \subsection{new subsection}

    very little text

    \begin{align}
    P_{Photon}  & =     hf * nAc                \\
                & =     \frac{E_{Photon}}{t}    
    \end{align}

    more text

    \begin{align}
    F_{0}       & =     2nhfA               \\
                & =     \frac{2 P_{Photon}}{c}  
    \end{align}

And I would like to have something like:

A  = b+C

Text

A  = longe equation

**New Headline**

B  = also nice equation

And so on. I guess you get what I want. Can you help me? Thank you

Best Answer

Starting with my answer on align separate equations, I found I needed to change a few things, specifically because the OP for this question wanted to include multiline equations. As such, I had to reinstate \arraystretch to a non-zero value (in fact, I set it to 1.2). But with that, I had to do some \vspace manipulations going into and out of the algneqn environment I created.

But in the end, all the equal signs are aligned, per the OP's request. Setting the values of \leftalgn and \rightalgn will determine where on the overall line the alignment tab will be set.

\documentclass{article}
\usepackage{amsmath}
\def\leftalgn{0.3}\def\rightalgn{0.6}
\def\algnrow{\rule{\leftalgn\textwidth}{0ex}&\rule{\rightalgn\textwidth}{0ex}}
% CONSTRAINTS:
% equation label must fit in {1 -\leftalgn -\rightalgn}\textwidth
% \leftalgn must be larger than any text to left of align character
% \rightalgn must be larger than any text to right of align character
\newenvironment{algneqn}{%
  \vspace{-1.6\baselineskip}%
  \arraycolsep=0ex\renewcommand\arraystretch{1.2}%
  \begin{equation}%
  \begin{array}{rl}%
  \algnrow\\%
}%
 {\\\algnrow%
  \end{array}\vspace{-\baselineskip}%
  \end{equation}\ignorespacesafterend%
}
\def\snug#1{\vspace*{-#1\baselineskip}}
\begin{document}
\begin{algneqn}    
F_L^{\rightarrow}   & =     q ( E_{eFeld}^{\rightarrow} + v^{\rightarrow} \times B^{\rightarrow} )
    \end{algneqn}

much text

    \begin{algneqn}
    F_{Lx}  & =     q ( E_{eFeld} + v_{gx} * B )
    \end{algneqn}

    little text

    \begin{algneqn}
    T   & =     F_{L1} - F_{L2}                                         \\
        & =     q ( E_{eFeld} + v_{g1} * B - E_{eFeld} - v_{g2} * B )   \\
        & =     q*B ( v_{g1} - v_{g2} )         
    \end{algneqn}                     

    \subsection{new subsection}

    very little text

    \begin{algneqn}
    P_{Photon}  & =     hf * nAc                \\
                & =     \dfrac{E_{Photon}}{t}    
    \end{algneqn}

    more text

    \begin{algneqn}
    F_{0}       & =     2nhfA               \\
                & =     \dfrac{2 P_{Photon}}{c}  
    \end{algneqn}
\end{document}

enter image description here