Math & ScienceAligning equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
astrak
Posts: 10
Joined: Mon Oct 29, 2012 8:00 pm

Aligning equations

Post by astrak »

Hello!
I would like ask you how to set some equation which is written in more lines to the left side.

I should use $math$ but there is problem that a first equation is a bit more on right side (first white space in the paragraph).
When I use align, array, multline, ... all equations are centered in the midle of page.

Thank you very much!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Aligning equations

Post by Stefan Kottwitz »

You could set the fleqn option to the document class and specify \mathindent to be zero, such as:

Code: Select all

\documentclass[fleqn]{article}
\usepackage{amsmath}
\setlength{\mathindent}{0pt}
Stefan
LaTeX.org admin
astrak
Posts: 10
Joined: Mon Oct 29, 2012 8:00 pm

Re: Aligning equations

Post by astrak »

Thank you Stefan!
Unfortunately fleqn as a document class doesn't work in TeX Works, but when I use \begin{flalign*} it works very well.

So thank you for recomandation!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Aligning equations

Post by Stefan Kottwitz »

fleqn is an option to classes and to amsmath, not a class. It works for me with TeXworks exactly in this way.

Yes, flalign works too, using & to push the formula to the left, however fleqn works document wide also for simple equations.

Stefan
LaTeX.org admin
astrak
Posts: 10
Joined: Mon Oct 29, 2012 8:00 pm

Aligning equations

Post by astrak »

Stefan_K wrote:fleqn is an option to classes and to amsmath, not a class. It works for me with TeXworks exactly in this way.
When I use fleqn as an option to class - it looks like that:

Code: Select all

\documentclass[fleqn][a4paper,11pt]{article}

\usepackage[czech]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage{amsfonts}

\setlength{\mathindent}{0pt}

\begin{document}
...
But with TexWorks it doesn't work - error message is:
! LaTeX Error: File `.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Aligning equations

Post by Stefan Kottwitz »

Hallo,

the syntax of the first line is not correct. It should be:

Code: Select all

\documentclass[fleqn,a4paper,11pt]{article}
Stefan
LaTeX.org admin
astrak
Posts: 10
Joined: Mon Oct 29, 2012 8:00 pm

Re: Aligning equations

Post by astrak »

Now it works with no problems :-)

One again thank you very much :-) It looks great...
Post Reply