6

I have a string of equations, each with a label that I would like to format nicely. I want the equation labels to be at the same horizontal position and the start of the equation to be at the same horizontal location. Additionally, I want each equation to have a label.

There seem to be a large number of ways this could be done, but I can't get anything to work correctly. A tabbing seems to not work with equations. Also tried putting the equation in a \vbox with tabbing, but that kills the formatting.

Example:

      Label:           Equation
      Longer label:    Equation
      Lab:             Equation

What I'm working with

%+++++++++++
\begin{equation}
\label{e:failuniaxlocal}
Uniaxial Local Buckling: MOS=\frac{\sigma_Y}{\sigma}-1
\end{equation}
%+++++++++++


%+++++++++++
\begin{equation}
\label{e:failuniaxlocal}
Uniaxial Local Buckling:
\end{equation}
%+++++++++++

%+++++++++++
\begin{equation}
\label{e:failshearlocal}
Shear Local Buckling:
\end{equation}
%+++++++++++

%+++++++++++
\begin{equation}
\label{e:failinterlocal}
Uniaxial-Shear Interaction:
\end{equation}
%+++++++++++

%+++++++++++
\begin{equation}
\label{e:failstffbck}
Stiffener buckling: MOS=\frac{pi^2 H_{22}}{P L^2}-1
\end{equation}
%+++++++++++

enter code here
  • Do you want equations to be numbered? – user11232 Feb 27 '14 at 0:35
  • If you want them numbered then this tex.stackexchange.com/questions/159800/… can help. And since you say you want labels, I think it is a pretty good assumption that you want them numbered (or else, what will you \ref?) – Steven B. Segletes Feb 27 '14 at 0:49
5

If you're going to spread out the content with some paragraphs between them, then you could surely use a construction like the one below:

enter image description here

\documentclass{article}%
\newcommand{\labeleqn}[3][150pt]{%
  \makebox[0pt]{\makebox[\linewidth][l]{#2}}% Set label
  \makebox[0pt]{\makebox[\linewidth][l]{\hspace*{#1}$\displaystyle#3$}}}% Set equation

\begin{document}

%+++++++++++
\begin{equation}
\labeleqn{Uniaxial Local Buckling:}{MOS = \frac{\sigma_Y}{\sigma} - 1}
\label{e:failuniaxlocal}
\end{equation}
%+++++++++++

%+++++++++++
\begin{equation}
\labeleqn{Shear Local Buckling:}{f(x)=ax^2 + bx + c}
\label{e:failshearlocal}
\end{equation}
%+++++++++++

%+++++++++++
\begin{equation}
\labeleqn{Uniaxial-Shear Interaction:}{e = mc^2}
\label{e:failinterlocal}
\end{equation}
%+++++++++++

%+++++++++++
\begin{equation}
\labeleqn{Stiffener buckling:}{MOS=\frac{\pi^2 H_{22}}{P L^2} - 1}
\label{e:failstffbck}
\end{equation}
%+++++++++++

\end{document}

\labeleqn[<width>]{<label>}{<eqn>} sets <eqn> starting <width> (default is 150pt) from the left margin while also adding <label> flush with the left margin.

Alternatively one can use amsmath's align environment to align the equations at the =.

  • Thanks, this works well. I did try amsmath align, but was having trouble getting it to work with the equation numbering. – August Feb 27 '14 at 2:42
5

Another solution using alignat:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{alignat}{2}
&\text{Uniaxial Local Buckling:}     &\qquad &MOS=\frac{\sigma_Y}{\sigma}-1   \label{e:failuniaxlocal}\\
&\text{Shear Local Buckling:}        &       &MOS=\frac{1}{2}                 \label{e:failshearlocal}\\
&\text{Uniaxial-Shear Interaction:}  &       &MOS=\frac{1}{4}                 \label{e:failinterlocal}\\
&\text{Stiffener buckling:}          &       &MOS=\frac{pi^2 H_{22}}{P L^2}-1 \label{e:failstffbck}
\end{alignat}

\end{document} 

enter image description here

  • Interesting, I attempted this, but it must have conflicted with other settings in my document. The equation numbers don't show up in my document. – August Feb 27 '14 at 16:46
  • @August you have probably used alignat* (starred version) instead of alignat – karlkoeller Feb 27 '14 at 17:50

Your Answer

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

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