5

I am using the tabbing environment for a list of 5 related equations.

\begin{tabbing} \hspace{.5cm} \= \hspace{.3cm} \= \hspace{3cm} \= \kill
  \(\mathbf{\Omega}\) \> \(=\) \> \(\Omega\hat{\mathbf{k}}\)
  \tagthisline\\[.3cm]
  \(\mathbf{r}\) \> \(=\) \>
  \(x\hat{\mathbf{i}} + y\hat{\mathbf{j}} + z\hat{\mathbf{k}}\)\tagthisline
  \\[.3cm]
  \(\dot{\mathbf{r}}\) \> \(=\) \>
  \(\mathbf{v}_{\text{CG}} + \mathbf{\Omega}\times\mathbf{r}                         
  + \mathbf{v}_{\text{rel}}\)\tagthisline\\[.3cm]
  \(\mathbf{v}_{\text{rel}}\) \> \(=\) \>
  \(\dot{x}\hat{\mathbf{i}} + \dot{y}\hat{\mathbf{j}}                                
  + \dot{z}\hat{\mathbf{k}}\)\tagthisline\\[.3cm]
  \(\mathbf{a}_{\text{rel}}\) \> \(=\) \>
  \(\ddot{x}\hat{\mathbf{i}} + \ddot{y}\hat{\mathbf{j}}                              
  + \ddot{z}\hat{\mathbf{k}}\)\tagthisline
\end{tabbing}

\tagthisline picks up the appropriate numbering from the document. However, I need a \label for each one in the tabbing environment.

  1. Does assigning more than one label in the same environment work?

  2. Even if it does, should a different method be taken here?

  3. If the answer to (2) is yes, how should I set it up?

1 Answer 1

5

Without knowing what \tagthisline looks like, I would opt for a different approach using a straight align:

enter image description here

\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\providecommand{\tagthisline}{X}% Don't know what this means...
\begin{document}
\begin{tabbing} \hspace{.5cm} \= \hspace{.3cm} \= \hspace{3cm} \= \kill
  \(\mathbf{\Omega}\) \> \(=\) \> \(\Omega\hat{\mathbf{k}}\)
  \tagthisline\\[.3cm]
  \(\mathbf{r}\) \> \(=\) \>
  \(x\hat{\mathbf{i}} + y\hat{\mathbf{j}} + z\hat{\mathbf{k}}\)\tagthisline
  \\[.3cm]
  \(\dot{\mathbf{r}}\) \> \(=\) \>
  \(\mathbf{v}_{\text{CG}} + \mathbf{\Omega}\times\mathbf{r}                         
  + \mathbf{v}_{\text{rel}}\)\tagthisline\\[.3cm]
  \(\mathbf{v}_{\text{rel}}\) \> \(=\) \>
  \(\dot{x}\hat{\mathbf{i}} + \dot{y}\hat{\mathbf{j}}                                
  + \dot{z}\hat{\mathbf{k}}\)\tagthisline\\[.3cm]
  \(\mathbf{a}_{\text{rel}}\) \> \(=\) \>
  \(\ddot{x}\hat{\mathbf{i}} + \ddot{y}\hat{\mathbf{j}}                              
  + \ddot{z}\hat{\mathbf{k}}\)\tagthisline
\end{tabbing}

\newcommand{\Lalign}{\phantom{\mathbf{a}_{\text{rel}}}}
\begin{align}
  \mathrlap{\mathbf{\Omega}}\Lalign &= \Omega\hat{\mathbf{k}} \\[\jot]
  \mathrlap{\mathbf{r}}\Lalign &= x\hat{\mathbf{i}} + y\hat{\mathbf{j}} + z\hat{\mathbf{k}} \\[\jot]
  \mathrlap{\dot{\mathbf{r}}}\Lalign & = 
    \mathbf{v}_{\text{CG}} + \mathbf{\Omega}\times\mathbf{r} + \mathbf{v}_{\text{rel}} \\[\jot]
  \mathbf{v}_{\text{rel}} &= \dot{x}\hat{\mathbf{i}} + \dot{y}\hat{\mathbf{j}} + 
    \dot{z}\hat{\mathbf{k}} \\[\jot]
  \mathbf{a}_{\text{rel}} &= \ddot{x}\hat{\mathbf{i}} + \ddot{y}\hat{\mathbf{j}} + 
    \ddot{z}\hat{\mathbf{k}}
\end{align}
\end{document}

Now you can \label and \eqref to your heart's content.


If you wish to have a flush-left alignment, use flalign together with an additional alignment character & at the end of one of the equations. Also, for obtaining a similar lcl alignment to that of your tabbing environment, you can adjust the regular align preamble (\align@preamble). I've done the necessary adjustment in the definition of a new environment lflalign below:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\makeatletter
\newenvironment{lflalign}{%
  \def\align@preamble{%
     &\strut@
      \setboxz@h{\@lign$\m@th\displaystyle{####}$}%
      \ifmeasuring@\savefieldlength@\fi
      \set@field
      \hfil
      \tabskip\z@skip
     &\setboxz@h{\@lign$\m@th\displaystyle{{}####}$}%
      \ifmeasuring@\savefieldlength@\fi
      \set@field
      \hfil
      \tabskip\alignsep@
  }
  \flalign}
  {\endflalign}
\makeatother
\begin{document}
\begin{flalign}
  f(x) &= ax^2 + bx + c &\\
  f(x)+g(x) &= d
\end{flalign}

\begin{lflalign}
  f(x) &= ax^2 + bx + c &\\
  f(x)+g(x) &= d
\end{lflalign}
\end{document}
7
  • So align can have each line labeled? Then can IEEEeqnarray have each line labeled too?
    – dustin
    Commented Jun 14, 2013 at 1:05
  • 1
    @dustin: Yup...
    – Werner
    Commented Jun 14, 2013 at 1:15
  • That is what I will probably use than. You don't need to change your answer though.
    – dustin
    Commented Jun 14, 2013 at 1:16
  • How can I left align IEEEeqnarray? Is flalign an added option in []?
    – dustin
    Commented Jun 14, 2013 at 2:35
  • that is great. What do you read to obtain this information on how to change the environments?
    – dustin
    Commented Jun 14, 2013 at 14:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .