Math & ScienceUsing fleqn with aligned or split

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
tmac
Posts: 2
Joined: Tue Aug 31, 2010 9:17 pm

Using fleqn with aligned or split

Post by tmac »

Hi!

I'm using an article documentclass with the fleqn option and amsmath package.

My document contains single equations, using the equation environment, but also pairs of equations that share the same label. These pairs of equations are aligned on their left sides. This is achieved in this way:

Code: Select all

\begin{equation}
\begin{aligned}
 & \omega^{\theta}:=rd\theta\\
 & \omega^{\phi}:=r\sin(\theta)d\phi\,,
\end{aligned}
\label{eq:on_base}
\end{equation}
I have also done the same using the split environment inside equation.

The trouble is that these "double equations" are not pushed as far to the left as the single equations. Remember, I'm using the "fleqn" documentclass option. The difference is quite small, but I'd like to get it perfect if someone knows the solution. Otherwise, I'll just live with it.

How can I get pairs of equations, using a common label at the average vertical position, and both equations are pushed as far left as my single equations, when using fleqn? Right now there is a difference around half a character.

Best regards
Torquil Sørensen

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

Using fleqn with aligned or split

Post by Stefan Kottwitz »

Hi Torquil,

there's a \thinspace in the definition of \start@aligned in amsmath.sty:

Code: Select all

\newcommand{\start@aligned}[2]{%
    \RIfM@\else
        \nonmatherr@{\begin{\@currenvir}}%
    \fi
    \savecolumn@ % Assumption: called inside a group
    \null\,%
    \if #1t\vtop \else \if#1b \vbox \else \vcenter \fi \fi \bgroup
        \maxfields@#2\relax
        \ifnum\maxfields@>\m@ne
            \multiply\maxfields@\tw@
            \let\math@cr@@@\math@cr@@@alignedat
            \alignsep@\z@skip
        \else
            \let\math@cr@@@\math@cr@@@aligned
            \alignsep@\minalignsep
        \fi
        \Let@ \chardef\dspbrk@context\@ne
        \default@tag
        \spread@equation % no-op if already called
        \global\column@\z@
        \ialign\bgroup
           &\column@plus
            \hfil
            \strut@
            $\m@th\displaystyle{##}$%
            \tabskip\z@skip
           &\column@plus
            $\m@th\displaystyle{{}##}$%
            \hfil
            \tabskip\alignsep@
            \crcr
}
You can see it in the 6th line. You can remove it by redefining that macro using \renewcommand, which is not much more than copy & paste, or patch it. The latter can be done using the etoolbox package, write in your document preamble after \usepackage{amsmath}:

Code: Select all

\usepackage{etoolbox}
\makeatletter
\patchcmd{\start@aligned}{\null\,}{\null}{}{}
\makeatother
Stefan
LaTeX.org admin
Post Reply