# Two labeled equations on the same line with labels lining up vertically

I'm using the following LaTeX code within the amsmath environment in LaTeX (MiKTeX 2.9 and TeXnicCenter under Windows):

Let $f$ represent the resulting number of such two-step cycles that operate per second (expressed in Hz.)

\makebox[0.9\textwidth][c]{
\begin{minipage}{0.45\linewidth}
$$f = \frac{1}{t_{on} + t_{off}} \label{eq:f}$$
\end{minipage}
\hspace{0.05\linewidth}
\begin{minipage}{0.45\linewidth}
$$\frac{1}{f} = t_{on} + t_{off} \label{eq:invf}$$
\end{minipage}
} \break

The total time required per cycle is the inverse of frequency of those cycles.


My desire is to place two numbered equations (I wouldn't mind learning to also support subequation lettering, but it's not necessary in this case) on the exact same line, with their own equation labels displayed. I am using numbering on the left side, not the right side, for this document and I would like the left equation number of the above pair to line up with the equation number that occurs when I only place a single equation using or \begin{align}. Without the \makebox part, the numbering does NOT line up. So I pushed it with the \makebox. It does line up the way I show it above, but I receive multiple "bad box" errors, which I'd like to understand better and possibly remove. Also, I'd like any advice about a better way to do this without having to nudge things with a wrapped box.

I have searched around for a while and tried many different approaches without good success, including \begin{subeqnarray} and \begin{subequations}.

-

## migrated from stackoverflow.comApr 19 '13 at 11:07

This question came from our site for professional and enthusiast programmers.

Sure, this is not absolutely perfect, but it is very close without going into too much finicky detail about the spacing (click to enlarge):

\documentclass[leqno]{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
Let~$f$ represent the resulting number of such two-step cycles that operate per second (expressed in Hz.)

\noindent\begin{minipage}{0.5\linewidth}
$$f = \frac{1}{t_{\text{on}} + t_{\text{off}}} \label{eq:f}$$
\end{minipage}%
\begin{minipage}{0.5\linewidth}
$$\frac{1}{f} = t_{\text{on}} + t_{\text{off}} \label{eq:invf}$$
\end{minipage}\par\vspace{\belowdisplayskip}

The total time required per cycle is the inverse of frequency of those cycles.

\newpage

Let~$f$ represent the resulting number of such two-step cycles that operate per second (expressed in Hz.)
$$f = \frac{1}{t_{\text{on}} + t_{\text{off}}} \label{eq:ff}$$
The total time required per cycle is the inverse of frequency of those cycles.

\end{document}


The generic view on the "two-column look" is

\noindent\begin{minipage}{0.5\linewidth}
...
\end{minipage}%
\begin{minipage}{0.5\linewidth}

\end{minipage}


Some highlights:

• \noindent avoids a regular \parindent (which is a common source of "overfull \hbox warnings" in this case);
• Each minipage is exactly half the width of the text block (0.5\linewidth);
• The use of % at the end of the first minipage is crucial to avoid an extra inter-word space between the minipages (you only have \linewidth to work with, not \linewidth +\space). See What is the use of percent signs (%) at the end of lines?

The final \vspace is to accommodate for an imperfect skip after a minipage. In fact, this is a known problem that using minipages causes some skip of the baseline to be not ideal. More on this conundrum is available from How to keep a constant \baselineskip when using minipages (or \parboxes)?

-