Math & Science ⇒ left align just some equations
left align just some equations
I wish to keep most of my equations (within equation, gathered, etc.) centered as by default. However, there are some pretty long formulas in my document which I need to spread over several lines.
Commands like \shoveleft{} and some others, within the appropriate environments, take care of the alignment, but not of the math indentation itself. I read about the possibility to set length of the math indentation under the package amsmath when loaded with option [fleqn]. (There seems to be much confusion about that anyway, if one reads various posts...) Doing that destroys, however, the look of the rest of my document.
Please, is there a possibility to get a zero math indentation on the left, but without fleqn? So that most of my equations will stay centered, but it will be visible with some pretty long ones? Thank you so much for helping.
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
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
left align just some equations
welcome to the board!
You could use the
flalign
environment for this. Add & at the right of rows to push the equations to the left.Stefan
Re: left indent just some equations
Unfortunately, that suggestion didn't seem to work with my document. What happens: In \documentclass[10pt]{article} and using the amsmath package, when I add flalign in between of a gather environment, it makes the equations aligned right, alongside the same column, which is fine - I just need to achieve this on the left. As said, I do not want to use the fleqn option, because about a half of all formulas I want to stay centered.
Secondly, I think that anyway I would want to adjust the blank space on the left. I have read about various posts on adjusting the mathindent, @mathmargin, etc., but neither of the typically proposed alternatives worked for me. Upon compilation, LaTeX reported 'undefined control sequence'.
So, my two questions are:
- How to get the alignment on the left?
- Please, can someone post the RIGHT combination of commands (including appropriate placement in the preamble or within document) to get zero math margins on the left (to be used under amsmath package, but without fleqn)?
I hope herewith my questions are more precise and very concrete. I need to finish quite a tough document, so your helping is very appreciated!
left align just some equations
Code: Select all
\documentclass[10pt]{article}
\usepackage{amsmath, nccmath}
\begin{document}
\noindent This is text.
\begin{fleqn}[0pt]
\begin{alignat}{2}
& a = b + c \\
& d = e + f
\end{alignat}
\end{fleqn}
\noindent This is text 2.
\begin{equation}
g = h + i
\end{equation}
\end{document}