6

I have this journal template that insists that I do not use amsmath in any way and forces me to use eqnarray. I am very used to amsmath and have things like cases environment, \tag, \text, etc. in my code. How to have those in eqnarray?

The template has its own class/style files... cant figure out how to add those here... but a search for "agu latex format" should give all easily...

  • Good job finding a valid pretext for asking a question about eqnarray :) – Ryan Reich Jan 5 '14 at 19:43
6

Default LaTeX includes the \cases command from plain TeX which has the rather non-LaTeX syntax:

\cases{x  & if $x>0$\cr
       -x & otherwise\cr}

Sample output

\documentclass{article}

\begin{document}

\begin{eqnarray}
  \label{eq:f}
  f(x) &=& \cases{x,&if \( x>0 \)\cr -x,&if \( x\le 0 \)\cr}\\
  \label{eq:g}
  g(x) &=& \cases{\sin(x),&if \( -1<x<1 \)\cr
  \cos(1-x),&otherwise.\cr}
\end{eqnarray}

\end{document}

\text can be replaced by \mbox or \parbox, but you will have to take care of some sizing yourself.

It turns out that a replacement for \tag is provided by the class file agutex.cls (at least the Feb 9, 2008 version):

Sample output

\documentclass{agutex}

\lefthead{A. N. Author}
\righthead{Article Title}

\begin{document}

\begin{eqnarray}
  \label{eq:f}
  f &=& x + y\\
  \label{eq:h}
  h &=& x - y\specialeqnum{h}
\end{eqnarray}
Equations (\ref{eq:f}) and (\ref{eq:h})

\end{document}
  • Sorry for late answer :) was cooking and texing simultaneously and the food needed more of my attention :) ..... The ideas do work fine and I found that \mathletter works in place of \tag..... Please add the tag of agutmpl with this question (as I cant) and lots of geo people who tex will be really thankful :D – ankhi Jan 5 '14 at 17:31

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.