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.

My problem is that I want to reuse the spacing in a certain math equation like:

\begin{equation}
\begin{array}{l@{\hspace{3mm}}c@{\hspace{3mm}}l}
... & := &  ... \\[4mm]
    & =: &  ...
\end{array}
\end{equation}

This equation is followed by some text and then I want to repeat the above equation with the same spacings between array-columns. Is it possible? Out of the box I will get another spacing made by tex on the basis of the math symbols.

Perhaps it is possible to stick to one equation environment and insert the text in the equation. However \mbox{...} or \text{...} is not good enough because the text must show up in paragraph mode, left aligned w.r.t. the page.

W.r.t. the answer of Harish Kumar a MWE of my problem:

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{relsize}
\usepackage{stmaryrd}
\usepackage{bm}

\begin{document}

\noindent 
Example 1 (not ok):
\begin{align}
\begin{array}{l@{\hspace{3mm}}c@{\hspace{3mm}}l}
a \cdot b & := &  a \cdot \mathlarger{\llbracket\,} 0, \, b \mathlarger{\,\rrbracket} \\[4mm]
    & =: &  ...
\end{array}
\intertext{In the group this means that ... }
\begin{array}{l@{\hspace{3mm}}c@{\hspace{3mm}}l}
a & = &  b.
\end{array}
\end{align}
Example 2 (ok):
\begin{align}
\begin{array}{l@{\hspace{3mm}}c@{\hspace{3mm}}l}
a \cdot b & := &  a \cdot b \\[4mm]
    & =: &  ...
\end{array}
\intertext{In the group this means that ... }
\begin{array}{l@{\hspace{3mm}}c@{\hspace{3mm}}l}
a & = &  b.
\end{array}
\end{align}

\end{document}
share|improve this question

2 Answers 2

up vote 4 down vote accepted

You can use align and (short)intertext:

\documentclass{article}
\usepackage{mathtools,lipsum}
\begin{document}
  \begin{align}
\begin{array}{l@{\hspace{3mm}}c@{\hspace{3mm}}l}
... & := &  ... \\[4mm]
    & =: &  ... 
\end{array}
\intertext{\lipsum*[1]}      %% or \shortintertext{\lipsum*[1]} from mathtools
\begin{array}{l@{\hspace{3mm}}c@{\hspace{3mm}}l}
... & := &  ... \\[4mm]
    & =: &  ... 
\end{array}
\end{align}
\end{document}

enter image description here

Dealing the edited question:

You can get rid of array too:

\documentclass{article}
\usepackage{showframe}   %% just for demo
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{relsize}
\usepackage{stmaryrd}
\usepackage{bm}

\newcommand{\h}[1]{\widehat{\bm{#1}}}
\newcommand{\he}{\ensuremath{\tfrac{1}{2}}}
\newcommand{\quat}[2]{\mathlarger{\llbracket\,} \cos{(\he#2)}, \, \sin{(\he#2)} \,\h{#1} \mathlarger{\,\rrbracket}}
\newcommand{\quatv}[1]{\mathlarger{\llbracket\,} 0, \,\h{#1} \mathlarger{\,\rrbracket}}

\begin{document}

\begin{align}
 \quatv{b} \cdot \quatv{a} & := \mathlarger{\llbracket} -\h{b}\cdot\h{a}, \, \h{b}\times\h{a} \mathlarger{\,\rrbracket} \quad \equiv \quad \mathlarger{\llbracket\,} \h{a}\cdot\h{b}, \, \h{a}\times\h{b} \mathlarger{\,\rrbracket} = \\[4mm]
 & =:  \quat{n}{\gamma}.\\
\intertext{In the group this means that ... }
 L_b \circ L_a & =:   R(\gamma \h{n}).
\end{align}

\end{document}

enter image description here

If this goes for long, you may add \allowdisplaybreaks in your preamble.

share|improve this answer
    
This would be perfect. In my case however the spacing doens't align. I added a MWE in my question, it uses some extra definitions, would it be possible for you to ...? –  Gerard May 11 at 13:24
    
@Gerard Please see the edit. –  Harish Kumar May 11 at 13:44

Another solution with a somewhat simpler, hence more readable code. I use mathtools in place of amsmath, and xparse, with allows to define a \Braket command with a simple syntax (1 argument). I use the coloneqq and eqqcolon commands, which produce a vertically centred colon (which is not the case with :=). The alignment ànd numbering themselves are obtained through nesting aligned environments in an align container.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{stmaryrd}
\usepackage{bm}

\newcommand{\h}[1]{\widehat{\bm{#1}}}
\newcommand{\he}{\ensuremath{\tfrac{1}{2}}}
\newcommand{\myquat}[2]{\Brackets[\big]{\cos{(\he#2)}, \sin{(\he#2)} \,\h{#1}}}
\newcommand{\myquatv}[1]{\Brackets[\big]{0,\h{#1}}}
%
\usepackage{xparse}
\DeclarePairedDelimiterX{\Brackets}[1]{\llbracket}{\rrbracket}{\setargs{#1}}
\NewDocumentCommand{\setargs}{ >{\SplitArgument{1}{,}}m }
 {\setargsaux#1}
\NewDocumentCommand{\setargsaux}{ m m }
 {#1,\,#2\mkern1.5mu}

\begin{document}

\begin{align}
 \myquatv{b} \cdot \myquatv{a} &
\begin{aligned}[t]{}\coloneqq {}& \Brackets[\big]{-\h{b}\cdot\h{a},\h{b}\times\h{a}}\equiv  \Brackets[\big]{ \h{a}\cdot\h{b}, \h{a}\times\h{b}} = \\[4mm]
\eqqcolon {}& \myquat{n}{\gamma}.% \mathllap{}
\end{aligned}
\intertext{In the group this means that ... }
 L_b \circ L_a &\begin{aligned}[t]
 {}\eqqcolon{} &    R(\gamma \h{n}).
\end{aligned}
\end{align}

\end{document} 

enter image description here

share|improve this answer
    
Not a very easy but a well-designed solution. I will look into it later on, thanks! –  Gerard May 11 at 15:34
    
Is there documentation for \begin{aligned}? Why do you use [t]{} and {}&? What is mathllap for? –  Gerard May 11 at 19:13
    
There is no specific documentation: fundamentally, it's the same as align*, inside another math environment. You have examples in amsmath documentation or in Herbert Voss's mathmode. The [t] option is to specify the vertical alignment with respect to the first part. It stands for "top"; the default is [m], and you can choose [b]. You can check it changes the placement of the equation number. The pair of {} is here to ensure proper horizontal spacing on the left and the right of the = sign. –  Bernard May 11 at 19:16

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.