3

This question already has an answer here:

i have three equations with number (reference) that i want to left align.

\documentclass[journal]{IEEEtran} 
\usepackage{cite} 
\usepackage{graphicx} 
\usepackage[labelfont=bf, figurename=Figure, font=small]{caption} \usepackage[subrefformat=parens, labelformat=parens, font=small]{subfig} \usepackage{url} 
\usepackage{textcomp} 
\usepackage{hyperref} 
\usepackage{microtype} 
\usepackage[dont-mess-around]{fnpct} 
\usepackage[misc]{ifsym} 
\usepackage[depth=subsubsection]{bookmark} 
\usepackage{booktabs} 
\usepackage{makecell} 
\usepackage{etoolbox} 
\usepackage{authblk} 
\usepackage{hhline} 
\usepackage{multirow} 
\usepackage{xparse} 
\usepackage{cleveref} 

\begin{document}
\begin{equation}\label{eq1}
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\end{equation}

\begin{equation}\label{eq2}
\frac{d}{dx}r^n=nx^{n-1}
\end{equation}

\begin{equation}\label{eq3}
Length=\int_{a}^{b}\sqrt{[f't]^2+[g't]^2}dt
\end{equation}
\end{document}

By default, the equations are center aligned. How can i make them left aligned? I already tried \begin{flalign}...\end{flalign}, \begin{aligned}...\end{aligned} with [fleqn] it did not work for me. Any help will be highly appretiated.

marked as duplicate by Stefan Pinnow, TeXnician, Sebastiano, Mensch, Werner equations Dec 27 '17 at 23:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @bmv I already tried that, didn't work for me – Raja Ayaz Dec 27 '17 at 18:44
  • please show small but complete document. we need to see used preamble (ONLY TO Math related packages). also let us know, if all equation should be left aligned or just this three. – Zarko Dec 27 '17 at 18:51
  • @Zarko I am using no Math related packages, there was no need. And I need all equations left aligned. Equations are centered by default in LaTeX so I guess preamble doesn't has to do anything with equations being centered because its LaTeX default behavior. – Raja Ayaz Dec 27 '17 at 18:56
  • if we not know, what you use, then we cant help you. please consider my previous comment. help us to help you! – Zarko Dec 27 '17 at 18:57
  • 1
    Possible duplicate: How can I use an align environment flush left? – Werner Dec 27 '17 at 19:43
3

sorry, but your question is not very clear, so following solutions are based on pure guessing:

\documentclass[journal]{IEEEtran}
\usepackage{nccmath}

\usepackage{lipsum} % for generating dummy text, not use in real document

\begin{document}
\lipsum[11]
\begin{align}
            x   & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}          \label{eq1} \\
\frac{d}{dx}r^n & = nx^{n-1}                                \label{eq2} \\
\mathrm{Length} & = \int_{a}^{b}\sqrt{[f't]^2+[g't]^2}dt    \label{eq3}
\end{align}
or
\begin{fleqn}
\begin{equation}\label{eq1}
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\end{equation}

\begin{equation}\label{eq2}
\frac{d}{dx}r^n=nx^{n-1}
\end{equation}

\begin{equation}\label{eq3}
Length=\int_{a}^{b}\sqrt{[f't]^2+[g't]^2}dt
\end{equation}
\end{fleqn}
\lipsum[11]

\end{document}

which gives :

enter image description here

or in case that all equation in your document should be left aligned:

\documentclass[journal]{IEEEtran}
\usepackage[fleqn]{amsmath}

\usepackage{lipsum} % for generating dummy text, not use in real document

\begin{document}
\lipsum[11]
 \begin{equation}\label{eq1}
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\end{equation}

\begin{equation}\label{eq2}
\frac{d}{dx}r^n=nx^{n-1}
\end{equation}

\begin{equation}\label{eq3}
Length=\int_{a}^{b}\sqrt{[f't]^2+[g't]^2}dt
\end{equation}
or     
\begin{gather}
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}            \label{eq1} \\
\frac{d}{dx}r^n=nx^{n-1}                    \label{eq2} \\
Length=\int_{a}^{b}\sqrt{[f't]^2+[g't]^2}dt \label{eq3}
\end{gather}
\lipsum[11]

\end{document}

which gives:

enter image description here

edit (1): if you will use solution with fleqn environment, than you can set indentation of equation by environment option (see Bernard's comment below). for example, for indentation of 2em:

\begin{fleqn}[2em]    
\begin{gather}
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}            \label{eq1} \\
\frac{d}{dx}r^n=nx^{n-1}                    \label{eq2} \\
Length=\int_{a}^{b}\sqrt{[f't]^2+[g't]^2}dt \label{eq3}
\end{gather}
\end{fleqn}

will move left border of equations for 2em to right,

edit (2): as Barbara Beeton pointed in her comment below, the use of gather environments has advantages over use of separated equations. you can compare results in the second example (observe spacing between equations). if a page or column break is needed, amsmath provides \allowdisplaybreak command.

for more information about use of amsmath packages see (new) short math guide.

  • Thank you very much @Zarko, that's exactly what I wanted. You solved the problem, highly appreciated, thanks dearie :) – Raja Ayaz Dec 27 '17 at 19:29
  • Note the fleqnaccepts an optional argument – the indentation of the group of equations from the left margin (0pt by default). – Bernard Dec 27 '17 at 19:34
  • @Bernard, thank you for remind me on this. however, i don't know which of provided solutions op will use. so i decided to not confuse him with this ... – Zarko Dec 27 '17 at 19:44
  • @Zarko I used \begin{fleqn}...\end{fleqn} and it worked like a charm. Thanks again :) – Raja Ayaz Dec 27 '17 at 19:48
  • @RajaAyaz, ok, than i will add Bernard comment to my answer. – Zarko Dec 27 '17 at 19:49
1

The flalign environment works, but you have to create at least a second column with an &:

\documentclass[journal]{IEEEtran}
\usepackage{cite}
\usepackage{graphicx}
\usepackage[labelfont=bf, figurename=Figure, font=small]{caption}
\usepackage[subrefformat=parens, labelformat=parens, font=small]{subfig}
\usepackage{url}
\usepackage{textcomp}
\usepackage{hyperref}
\usepackage{microtype}
\usepackage[dont-mess-around]{fnpct}
\usepackage[misc]{ifsym}
\usepackage[depth=subsubsection]{bookmark}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{etoolbox}
\usepackage{authblk}
\usepackage{hhline}
\usepackage{multirow}
\usepackage{xparse}
\usepackage{cleveref}
\usepackage{lipsum}
\usepackage{nccmath}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}

\begin{document}

\lipsum[11]

  \begin{flalign}\label{eq1}
    & x =\frac{-b±\sqrt{b²-4ac}}{2a} & \\
    \label{eq2}
     & \frac{d}{dx}r^n =nx^{n-1} \\
     \label{eq6}
    & \text{Length} =∫_{a}^{b}√{[f't]²+[g't]²}\,dt
  \end{flalign}

Or even with the $ = $ signs aligned:

  \begin{flalign}\label{eqa1}
    x & =\frac{-b±\sqrt{b²-4ac}}{2a} & \\
    \label{eqa2}
    \frac{d}{dx}r^n & =nx^{n-1} \\
    \label{eqa6}
    \text{Length} & =∫_{a}^{b}√{[f't]²+[g't]²}\,dt
  \end{flalign}

\end{document} 

enter image description here

  • Thank you for sparing time to help, yes your solution of flalign also worked. I liked the \usepackage{showframe}, i didn't know it and that was also something i needed. thanks :) – Raja Ayaz Dec 27 '17 at 19:56
  • If you use the geometry package, there's also its [showframe] option. – Bernard Dec 27 '17 at 19:58
  • I think it must be possible, though I have no precise idea at the moment. Anyway, you should post it as a new question. – Bernard Dec 27 '17 at 20:12
  • Thanks @Bernard, I will post a new question regarding this. – Raja Ayaz Dec 27 '17 at 20:14
  • @RajaAyaz: I've just found this answer to a similar question, which might be of interest to you. – Bernard Dec 27 '17 at 20:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.