[texhax] Multiple column math equations with tags / multicols questions

Johan Glimming glimming at kth.se
Thu Aug 12 20:43:08 CEST 2004


Hello

Thanks. I tried to improve the code, but I am unable to use the \tag  
outside a gather-environment (see code below, removing #2 fails if  
\tag{..} is in #1 instead). Also I have to tweak math mode for some  
obscure reason - I have to use ensuremath before invoking the command.

My main idea is to have this:

\begin{multieqn}
x^2+x = 1                  \tag{$\alpha$}     \\
\dfrac{x^3+x^2}{e^x} = 2   \tag{2nd one}      \\
...
\end{multieqn}

Is there a way of reusing the //-separators to insert an occurrence of  
my \multieqn on every separate line here?

Med vänliga hälsningar / Yours Sincerely,
Johan Glimming

---

\documentclass{article}
\usepackage{amsmath}

\newlength{\eqwidth}
\newcommand{\multieqn}[2]{\settowidth{\eqwidth}{$$#1$$}\begin{minipage}{ 
.3\textwidth}
   \begin{gather} \ensuremath{#1} \tag{#2} \end{gather}  
\end{minipage}\hfill}

\begin{document}

\multieqn{\ensuremath{1^2=1}}{test}
\multieqn{\ensuremath{2=2}}{2nd}
\multieqn{\ensuremath{another~beast~equation}}{3rd}

% two problems: \tag not handlded nicely
% and ensuremath work-around needed.

\end{document}



More information about the texhax mailing list