Math & Scienceleft align just some equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ebjikki
Posts: 4
Joined: Sun Jun 03, 2012 12:11 am

left align just some equations

Post by ebjikki »

Hello there,

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.
Last edited by ebjikki on Mon Jun 04, 2012 8:19 pm, edited 1 time in total.

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

left align just some equations

Post by Stefan Kottwitz »

Hi,

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
LaTeX.org admin
ebjikki
Posts: 4
Joined: Sun Jun 03, 2012 12:11 am

Re: left indent just some equations

Post by ebjikki »

Hello, thanks for welcome and for reply.

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!
ebjikki
Posts: 4
Joined: Sun Jun 03, 2012 12:11 am

left align just some equations

Post by ebjikki »

Hey there, I then solved the problem. I post here a small example.

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}
This way I can have selected (blocks of) equations left aligned to the same margin as the text. Hope it helps to some of you, too. If you also use minipage, check out some issues of the nccmath package with minipage. I don't need it for the moment.
Post Reply