0

I've searched this site and found various methods to left-justify math in display style, including adding fleqn to \documentclass, \setlength{\mathindent}{0pt}, and using & within the align environment. But I can't get any of them to work, regardless of which display I environment I use.

I'd like to know how to get every equation in a document to be left-justified, as well as how to get selected equations to be left-justified, hopefully in the simplest way possible. Here's my code:

%&latex
\documentclass[fleqn,9 pt]{article}
\usepackage{diffcoeff}
\usepackage{mathtools}
\usepackage{extsizes}
\usepackage{esdiff, nccmath}
\usepackage{booktabs}
\usepackage[showframe]{geometry}
\usepackage[bottom=.5in,top=1in]{geometry}%ALLOWS ME TO SET MARGINS



\setlength{\voffset}{-0.75in} 
\setlength{\parindent}{0pt} 
\setlength{\parskip}{15pt} 
\setlength{\mathindent}{0pt}

\newcommand{\ffrac}[2]{\ensuremath{\frac{\displaystyle #1}{\displaystyle
#2}}}

\title{\vspace{-25cm}}
\author{}
\date{}
\begin{document}

\section*{Left align minimum working example$} 

$$\ln K_P=\sum_{i} \ln\left(\ffrac{p_i^{eq}}{p^o}\right)^{\nu_i}$$

\[
\ln K_P=\sum_{i} \ln\left(\ffrac{p_i^{eq}}{p^o}\right)^{\nu_i}
\]

\begin{align}
& \ln K_P=\sum_{i} \ln\left(\ffrac{p_i^{eq}}{p^o}\right)^{\nu_i}
\end{align}

\begin{gather}
\ln K_P=\sum_{i} \ln\left(\ffrac{p_i^{eq}}{p^o}\right)^{\nu_i}
\end{gather}

\begin{equation}
\ln K_P=\sum_{i} \ln\left(\ffrac{p_i^{eq}}{p^o}\right)^{\nu_i}
\end{equation}


\end{document}

Currently, everything remains centered:

enter image description here

  • 4
    Your code throws errors since \usepackage{diffcoeff} and \usepackage{esdiff} clash. If I remove the clash, everything is left-aligned except for the $$ ..$$ line, but $$ should not be used anyway. – user121799 Mar 8 at 6:25
  • @marmot Thanks! I did see many errors, but didn't know to interpret them as a package conflict. – theorist Mar 9 at 0:40
  • 1
    @marmot has said that $$ shouldn't be used, but hasn't said why. The reason is that amsmath (loaded by mathtools) defines fleqn to operate only on display structures defined by basic LaTeX or by amsmath, and $$ is a carryover from plain TeX and is not modified for LaTeX. (And that is why it shouldn't be used -- because in cases such as you show here, it won't work.) – barbara beeton Mar 9 at 1:28
  • @barbarabeeton Thanks Barbara. Agreed. I included $$ just to be comprehensive (a good thing, as it was instructive for me to learn another instance where $$ fails), as I'm somewhat aware of the issues from having read tex.stackexchange.com/questions/40492/… and tex.stackexchange.com/questions/321/align-vs-equation/325#325 – theorist Mar 9 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.