Math & ScienceSimple left Alignment of Equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
gremlint
Posts: 16
Joined: Tue Oct 09, 2012 6:04 am

Simple left Alignment of Equations

Post by gremlint »

I would like to simply align a math formula to the left margin. I've read several previous posts about this and tried everything, but nothing works. I tried this:

Code: Select all

\begin{align*}
...
\end{align*}
And I get error messages. I tried the fleqn option, and there's either zero effect, or I get more error messages.

And so on ...
Last edited by localghost on Mon Nov 05, 2012 10:00 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Simple left Alignment of Equations

Post by localghost »

Kindly prepare a self-contained and minimal example to avoid random shots and guesswork. This would clarify how you tried to use the fleqn option. Usually it is given to the document class.


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

Simple left Alignment of Equations

Post by Stefan Kottwitz »

gremlint wrote:I've read several previous posts about this and tried everything, but nothing works.
Which posts, what did you try? If you would tell this to us, we could save repeating all those suggestions. And if you would tell it in detail, we could tell for sure what was wrong in your code.
gremlint wrote:And I get error messages. I tried the fleqn option, and there's either zero effect, or I get more error messages.
Please always tell the error messages. Copy and paste them here. The simple fact that you got error messages tells nothing, because there are hundreds possible. The best would be showing the code that produced the error.

A simple demonstration of the fleqn option, where I additionally set the indentation of displayed math to zero:

Code: Select all

\documentclass[fleqn]{article}
\usepackage{amsmath}
\setlength{\mathindent}{0pt}
\begin{document}
\section{Left aligned equations}
text
\[
  f(x) = \frac {1} {1 + 9x^2}
\]
\end{document}
alignment.png
alignment.png (3.6 KiB) Viewed 7281 times
Stefan
LaTeX.org admin
gremlint
Posts: 16
Joined: Tue Oct 09, 2012 6:04 am

Simple left Alignment of Equations

Post by gremlint »

localghost wrote:to avoid random shots and guesswork
I don't know what that means. If you want to help, then please don't use jargon.
Usually it is given to the document class.
The instruction manual makes no mention of document classes with regard to alignment of equations. I'm using the manual that came with the software, "More Math into LaTeX," by George Gratzer. If there is a better manual that I should be using, kindly tell whoever is in charge, that they should include that one instead.
gremlint
Posts: 16
Joined: Tue Oct 09, 2012 6:04 am

Simple left Alignment of Equations

Post by gremlint »

Stefan_K wrote:Which posts, what did you try?
I don't know, and I didn't bookmark them. Next time I will.
Please always tell the error messages. Copy and paste them here.
I tried your suggestion, and it didn't work. I will try to include what you requested, as best as I can understand what that is.

The source file.

Code: Select all

\documentclass[12pt][fleqn]{article}
\usepackage{geometry}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}

\setlength{\mathindent}{0pt}

\begin{document}
\section{Left aligned equations}

\[
	24. \int \frac {ln(1-x)} {x} \, dx
\]

\end{document}
An the obtained log.

Code: Select all

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
 restricted \write18 enabled.
entering extended mode
(./Alignment Test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, 
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
 polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, 
welsh, loaded../Alignment Test.tex:1: Missing number, treated as zero.
<to be read again> 
                   [
l.1 \documentclass[12pt][f
                          leqn]{article}
? 

! LaTeX Error: File `.cls' not found.

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

Enter file name:
Last edited by localghost on Sat Nov 10, 2012 10:54 am, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Simple left Alignment of Equations

Post by localghost »

gremlint wrote:I don't know what that means. If you want to help, then please don't use jargon. […]
This is no jargon, but clear and common language. If you don't understand, consult a dictionary. Furthermore it can't do any harm to follow given links for instructions.
gremlint wrote:[…] The instruction manual makes no mention of document classes with regard to alignment of equations. I'm using the manual that came with the software, "More Math into LaTeX," by George Gratzer. If there is a better manual that I should be using, kindly tell whoever is in charge, that they should include that one instead. […]
Then don't start with a manual about math stuff. It is obviously not the right one for you. Read something more basic if you are a beginner (see remarks below).


Options for the document class (and for packages as well) are usually put into a comma separated list enclosed by square brackets.

Code: Select all

\documentclass[12pt,fleqn]{article}
Some remarks:
gremlint
Posts: 16
Joined: Tue Oct 09, 2012 6:04 am

Simple left Alignment of Equations

Post by gremlint »

localghost wrote:clear and common language
Your referral to my attempt to use this software and "random" and "guesswork" was merely a gratuitous insult, without any use. If you're not interested in actually helping me, but more interested in defending some sort of turf, then please don't reply to me.
localghost wrote:consult a dictionary
More insults. Isn't that a violation of your rules, or are you exempt as a moderator?
localghost wrote:Options for the document class (and for packages as well) are usually put into a comma separated list enclosed by square brackets.
That's it. That's all you needed to write. The rest was insults.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Simple left Alignment of Equations

Post by localghost »

gremlint wrote:Your referral to my attempt to use this software and "random" and "guesswork" was merely a gratuitous insult, without any use. If you're not interested in actually helping me, but more interested in defending some sort of turf, then please don't reply to me. […]
I was never intended to insult you of anything. Perhaps you should look what you are writing. Claiming me to use jargon was simply incorrect and I could consider that as an insult, too. But I didn't. I only tried to encourage you to give useful information in order to enable us to help you. And I don't have to defend here anything at all.
gremlint wrote:[…] More insults. Isn't that a violation of your rules, or are you exempt as a moderator? […]
You wrote that you didn't know what I meant. So this was only an advice in the belief that there might be a language problem. Never meant to be as an insult.
gremlint
Posts: 16
Joined: Tue Oct 09, 2012 6:04 am

Simple left Alignment of Equations

Post by gremlint »

localghost wrote:Never meant to be as an insult.
OK ... thank you. I have spent many hours trying to get this program to work satisfactorily, so its rather frustrating when someone seems to suggest that I'm just randomly poking around.

Is The LaTeX Companion a book you would recommend?

(And why doesn't this posting system accept my straight-forward attempt to embed a link?)
Last edited by cgnieder on Sun Nov 11, 2012 12:12 am, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Simple left Alignment of Equations

Post by cgnieder »

The LaTeX Companion really is the book about LaTeX so it is very recommendable!

You need to leave out the " " when you want to add an url:

Code: Select all

[url=<url starting with http>]text[/url]
Regards
site moderator & package author
Post Reply