2

I'm using WinEdit 9.0 along with MikeTex 2.9.

My document preamble reads as follows:

% ----------------------------------------------------------------
% Article Class (This is a LaTeX2e document)  ********************
% ----------------------------------------------------------------
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm}
\usepackage{amsfonts}
% THEOREMS -------------------------------------------------------
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\theoremstyle{remark}
\newtheorem{rem}[thm]{Remark}
\numberwithin{equation}{section}
% ----------------------------------------------------------------
\begin{document}
...

How do I use the \begin{flushleft} \end{flushleft} commands to cause the content of a \begin{eqnarray*} \end{eqnarray*} to start from the left margin in the .pdf output document, instead of (what it seems to me) its default setting of being centered?

  • 2
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – erik Apr 11 '15 at 16:09
  • 3
    Welcome to TeX.SX! Don't use eqnarray* (it's outdated), there are better ways (e.g align* etc from amsmath). flushleft should be replaced by raggedleft etc. And what erik said above ;-) –  Apr 11 '15 at 16:09

2 Answers2

2

It is better to use the amsmath alignments than eqnarray but either way you get flush left equations by using

\documentclass[12pt,fleqn]{article}
David Carlisle
  • 757,742
1

Here is a solution, patching flalign(*) from mathmath into a leftalign(*) environment, with one optional argument: the equation indent (default \parindent):

    \documentclass[11pt]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[showframe, noheadfoot, nomarginpar]{geometry} 
    \usepackage{mathtools}

    \makeatletter
    \newenvironment{leftalign*}[1][\parindent]{\setlength\hangindent{#1}\start@align\tw@\st@rredtrue\m@ne}{\endalign}
    \newenvironment{leftalign}{\hangindent = \parindent \start@align\tw@\st@rredfalse\m@ne}{\endalign}
    \makeatother

    \begin{document}

    Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

    With \texttt{leftalign*}: 
    \begin{leftalign*}
       A & = B & \\
      C & = D + E + F + D + E + F + D + E + F + D + E + F = 4( D + E + F)& 
    \end{leftalign*}

    Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\\

    With \texttt{flalign*}: 
    \begin{flalign*}
        A & = B & & & & \\
       C & = D + E + F + D + E + F + D + E + F + D + E + F = 4( D + E + F)& &
    \end{flalign*}

    Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\end{document} 

enter image description here

Bernard
  • 271,350