Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
\begin{equation} 
f = \frac{1}{t_{on} + t_{off}} \label{eq:f}
\end{equation} 
\end{minipage} 
\hspace{0.05\linewidth} 
\begin{minipage}{0.45\linewidth} 
\begin{equation} 
\frac{1}{f} = t_{on} + t_{off} \label{eq:invf}
\end{equation} 
\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 \begin{equation} 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}.

share|improve this question

migrated from stackoverflow.com Apr 19 '13 at 11:07

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

1 Answer 1

up vote 3 down vote accepted

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

enter image description here

\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}
\begin{equation}
  f = \frac{1}{t_{\text{on}} + t_{\text{off}}} \label{eq:f}
\end{equation}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\begin{equation}
  \frac{1}{f} = t_{\text{on}} + t_{\text{off}} \label{eq:invf}
\end{equation}
\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.)
\begin{equation}
  f = \frac{1}{t_{\text{on}} + t_{\text{off}}} \label{eq:ff}
\end{equation}
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)?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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