Once I seem to have worked on a system where, for some reason, latex code containing

     $\array{a & b \\ c & d }$

seems to have worked. (Note that, in particular, the "alignment" options of the {rcrcr} kind, standard in the usual \begin{align} \end{align} construction, is missing here. Now I need to compile this on what is a more or less standard latex installation, and it does not compile as is. Of course, one option would be to edit everything into the standard \begin{align} \end{align}.

Question: can you recommend an alternative, so as to be able to compile such code with as little editing overhead as possible? Some package or option in the preamble?


2 Answers 2


If you don't want to change the syntax at all, just [re]define \array, but I would not do that, as array is a widely used beginning to the array environment of LaTeX. I would rename it as \myarray, which can be defined to be an aligned TABstack.

\setstackgap{L}{1.2\normalbaselineskip}% inter-row baselineskip
\setstackaligngap{1em}% horizontal gap between align groups
$\myarray{a =& b \\ c =& d }$\quad
$\myarray{y =& mx + b \\ E =& mc^2 }$ or this
$\myarray{a =& b & y =& mx + b\\ c =& d& E =& mc^2 }$

enter image description here

  • Useful solution, thank you. I marked it as answered since the portions of my "legacy" code I had been testing so far worked with your method. Now (working incrementally) I reached a place where I used the \overset{}{} command, and suddenly there are error messages, in particular "Missing control sequence inserted. <inserted text> \inaccessible". Do you know a solution to this, from these information alone? (I know that one possibly should isolate the problem and post a minimal non-working example, but I am checking first whether there is a quick "the reason must be this or that" solution.) Commented Jun 30, 2017 at 15:14
  • @PeterHeinig I would have to see some code, though mabe all you need is to include the amsmath package. Unfortunately, I am going offline for a few days, starting NOW! Commented Jun 30, 2017 at 15:46

As @egreg has already pointed out in a comment, you may be thinking of the \matrix command. For sure, the following code, which sets up a macro called \myarray, compiles properly.

enter image description here

\usepackage{amsmath} % for 'matrix' environment
$\myarray{a & b \\ c & d }$

You must log in to answer this question.

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