Text FormattingLeft Alignment of all Equations

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
11202101
Posts: 2
Joined: Sat Sep 08, 2012 10:41 pm

Left Alignment of all Equations

Post by 11202101 »

I have a document with five simple expressions. I need to align the expressions to the left hand side of the page to produce the following:
http://www.as.ysu.edu/~angie/forstudent ... nment1.pdf

What I have is this code. The limits must be aligned alongside the numbers, exactly as in the previous example. If anyone can help me I would greatly appreciate it, as I've spent a great deal of time trying to figure out this simple formatting.

Code: Select all

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

\title{1586H \LaTeX\ Assignment 1}   % defines the title

\begin{document}
\maketitle  % generates the title

\raggedright
1.$$\lim_{x \to 0} \frac{\sec x}{1- \sin x}$$
2.$$\lim_{x \to 0} \frac{x^3}{\tan^3(2x)}$$
3.$$\lim_{x \to 0} \frac{\sin x}{x+\tan x}$$
4.$$\lim_{x \to -\infty} x+\sqrt{x^2+2x}$$
5.$$\lim_{x \to \infty}x\sin \frac{1}{x}$$
\end{document}

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Left Alignment of all Equations

Post by Stefan Kottwitz »

Hi,

welcome to the board!

Use inline math $...$ instead of displayed math $$...$$. You still can have the "display" style as below:

Code: Select all

\documentclass[a4paper,11pt,fleqn] {article}
\usepackage{alltt}
\usepackage{amsmath}
% define the title
\title{1586H \LaTeX Assignment 1}
\begin{document}
% generates the title
\maketitle
\raggedright
\begin{enumerate}
\item $\displaystyle\lim_{x \to 0} \frac{\sec x}{1- \sin x}$

\item $\displaystyle\lim_{x \to 0} \frac{x^3}{\tan^3(2x)}$

\item $\displaystyle\lim_{x \to 0} \frac{\sin x}{x+\tan x}$

\item $\displaystyle\lim_{x \to -\infty} x+\sqrt{x^2+2x}$

\item $\displaystyle\lim_{x \to \infty}x\sin \frac{1}{x}$
\end{enumerate}
\end{document}
Here I used the {enumerate} environment for an automatically numbered list.

Stefan
LaTeX.org admin
11202101
Posts: 2
Joined: Sat Sep 08, 2012 10:41 pm

Re: Left Alignment of all Equations

Post by 11202101 »

Thank you for your help!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Left Alignment of all Equations

Post by localghost »

Never ever use $$ … $$ to introduce unnumbered displayed equations. This is TeX syntax. Use \[ … \] instead, which is LaTeX syntax. Besides bad spacing such equations are not affected by the fleqn option for the document class (see below code).

Code: Select all

% TeX program = pdflatex
\documentclass[11pt,fleqn]{article}
\usepackage[T1]{fontenc}

\begin{document}
  \[ E=mc^2 \]
  $$ E=mc^2 $$
\end{document}

Best regards and welcome to the board
Thorsten
Post Reply