# Left-aligning specific text in math-mode

I currently have

via

\documentclass{scrartcl}
\KOMAoptions{
fontsize = 10pt   ,
}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{siunitx}
\begin{document}
\begin{multicols*}{2}
\section*{Electric Charge}
\textsf{Coulomb's Law} describes the electrostatic force between point electric charges $q_1$ and $q_2$ at (or nearly at) rest and separated by distance r:
%
\begin{align}
F_c &= \frac{1}{4\pi\epsilon_0}\frac{|q_1||q_2|}{r^2} = \frac{k|q_1||q_2|}{r^2}\\
\end{align}
\end{multicols*}
\end{document}


and wish to produce the following:

Coulomb's Law describes the electrostatic force
between point electric charges q1 and q2 at (or
nearly at) rest and separated by distance r:

F = (1/4πe_0)(|q1||q2|)/r^2      (1)
where     e0 = 8.85*10^-12 C^2/N*m^2        (2)
and        k = 8.99*10^9 N*m^2/C^2          (3)


In math-mode, how would I left-align specific text (e.g., via a command) such that the text is pushed as far to the left as possible? I wish to preserve the default centered style in math-mode.

-
The MWE you posted doesn't quite generate the output image you posted above it. (When I run your MWE, I get a measure (line width) that's narrower than what you show in the image.) You may want to either change the output image file or the MWE so that the two pieces correspond exactly. –  Mico Jun 27 '12 at 1:11
@Mico: Sorry about that. The MWE should now reproduce the output in the image. –  user2473 Jun 27 '12 at 1:48

Given the rather narrow text measure that's in effect, I can't help but feel but that this example would be suited ideally for use of the \shortintertext command provided by the mathtools package (a superset of the amsmath package).

\documentclass{scrartcl}
\KOMAoptions{fontsize = 10pt, headings = normal}
\usepackage{mathtools}
\usepackage{multicol}
\usepackage{siunitx}
\newcommand{\abs}[1]{\lvert#1\rvert}
\begin{document}
\begin{multicols*}{2}
\section*{Electric Charge}
\textsf{Coulomb's Law} describes the electrostatic force between
point electric charges $q_1$ and $q_2$ at (or nearly at) rest and
separated by distance~$r$:
\begin{align}
F_c &= \frac{1}{4\pi\epsilon_0}\frac{\abs{q_1}\abs{q_2}}{r^2}
= \frac{k\abs{q_1}\abs{q_2}}{r^2}\\
\shortintertext{where}
e_0 &= \SI{8.85e-12}{\coulomb\squared\per\newton\per\meter\squared}\\
\shortintertext{and}
k &= \SI{8.99e9}{\newton\meter\squared\per\coulomb\squared}\,.
\end{align}
\end{multicols*}
\end{document}


-
While not a direct answer to the original question, I think this looks more natural and flows better. Thanks. –  user2473 Jun 27 '12 at 1:43

This is not an answer to the problem. However I think you might select something that is less distracting in terms of emphasis (personal opinion!). Currently they look like extra equations and we try to find the variables on the right hand side in the units.

\documentclass{article}
\usepackage{amsmath,mathtools}
\usepackage{multicol}
\usepackage{siunitx,lipsum}
\setlength\textwidth{15cm}
\begin{document}
\begin{multicols*}{2}
\textsf{Coulomb's Law} describes the electrostatic
force between point electric charges $q_1$ and
$q_2$ at (or nearly at) rest and separated by distance r:
%
$$F_c = \frac{1}{4\pi\epsilon_0}\frac{|q_1||q_2|}{r^2} = \frac{k|q_1||q_2|}{r^2}\\$$
where $e_0 = \SI{8.85e-12}{\coulomb\squared\per\newton\per\meter\squared}$ and
$k = \SI{8.99e9}{\newton\meter\squared\per\coulomb\squared}$.

\textsf{Coulomb's Law} describes the electrostatic
force between point electric charges $q_1$ and
$q_2$ at (or nearly at) rest and separated by distance r:
\begin{align}
F_c &= \frac{1}{4\pi\epsilon_0}\frac{|q_1||q_2|}{r^2} = \frac{k|q_1||q_2|}{r^2}\\
\shortintertext{where}
e_0 &= \SI{8.85e-12}{\coulomb\squared\per\newton\per\meter\squared} \notag\\
k &= \SI{8.99e9}{\newton\meter\squared\per\coulomb\squared}.\notag
\end{align}

\lipsum[1-4]
\end{multicols*}

\end{document}


The first one completely buries the constants into the text if the numerical values are not important and the second one gives an independent space for those numbers if we want some attention on them.

-

amsmath's flalign environment works well for this, pushing elements outward (left and right) in the alignment:

\documentclass{article}
\usepackage[margin=1in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage{multicol}% http://ctan.org/pkg/multicol
\usepackage{siunitx}% http://ctan.org/pkg/siunitx
\begin{document}
\begin{multicols*}{2}
\textsf{Coulomb's Law} describes the electrostatic force between point electric charges $q_1$ and $q_2$ at (or nearly at) rest and separated by distance r:
%
\begin{flalign}
&& F_c &= \frac{1}{4\pi\epsilon_0}\frac{|q_1||q_2|}{r^2} = \frac{k|q_1||q_2|}{r^2} && \\
\text{where} && e_0 &= \SI{8.85e-12}{\coulomb\squared\per\newton\per\meter\squared} &&\\
\rlap{\text{and}}\phantom{\text{where}} && k &= \SI{8.99e9}{\newton\meter\squared\per\coulomb\squared} &&
\end{flalign}
\end{multicols*}
\end{document}


The addition of geometry was in an attempt to duplicate the output in the original post. More specifically, it was used to widen the multicol columns yet may not be needed in the eventual output. Also, using \nonumber would remove equation numbering for those equations that do not require a number (like, perhaps, (2) and (3)).

-

There is the same question (with more specific requirements) in Left-aligned text inside an equation. The final solution I got involves patching some amsmath stuff and creating the command \beforetext:

\documentclass[a5paper]{article}
\usepackage{amsmath,etoolbox}
\usepackage{siunitx}

\makeatletter
\newif\if@gather@prefix
\preto\place@tag@gather{%
\if@gather@prefix\iftagsleft@
\kern-\gdisplaywidth@
\rlap{\gather@prefix}%
\kern\gdisplaywidth@
\fi\fi
}
\appto\place@tag@gather{%
\if@gather@prefix\iftagsleft@\else
\kern-\displaywidth
\rlap{\gather@prefix}%
\kern\displaywidth
\fi\fi
\global\@gather@prefixfalse
}
\preto\place@tag{%
\if@gather@prefix\iftagsleft@
\kern-\gdisplaywidth@
\rlap{\gather@prefix}%
\kern\displaywidth@
\fi\fi
}
\appto\place@tag{%
\if@gather@prefix\iftagsleft@\else
\kern-\displaywidth
\rlap{\gather@prefix}%
\kern\displaywidth
\fi\fi
\global\@gather@prefixfalse
}
\def\math@cr@@@align{%
\ifst@rred\nonumber\fi
\if@eqnsw \global\tag@true \fi
\omit
\kern-\alignsep@
\if@gather@prefix\tag@true\fi
\iftag@
\setboxz@h{\@lign\strut@{\make@display@tag}}%
\place@tag
\fi
\ifst@rred\else\global\@eqnswtrue\fi
\global\lineht@\z@
\cr
}
\newcommand*{\beforetext}[1]{%
\ifmeasuring@\else
\gdef\gather@prefix{#1}%
\global\@gather@prefixtrue
\fi
}
\makeatother

\begin{document}
\textsf{Coulomb's Law} describes the electrostatic force between point electric charges $q_1$ and $q_2$ at (or nearly at) rest and separated by distance $r$:
\begin{align}
F_c &= \frac{1}{4\pi\epsilon_0}\frac{|q_1||q_2|}{r^2} = \frac{k|q_1||q_2|}{r^2}\\
\beforetext{where} \epsilon_0 &= \SI{8.85e-12}{\coulomb\squared\per\newton\per\meter\squared}\\
\beforetext{and} k &= \SI{8.99e9}{\newton\meter\squared\per\coulomb\squared}
\end{align}
\end{document}


Note: If this is the real text you are using, you probably want to use $r$ instead of r and \epsilon_0 instead of e_0.

The advantage over the use of flalign is that it works with gather too, and you don't need to change the normal coding of the equation.

-