2

Is it possible to align equations to "=" without merging the below equations into one environment?

\documentclass{article}
\begin{document}
Sample
\begin{equation}
a + b = c
\end{equation}

\begin{equation}
aaaa + bbbb = sss
\end{equation}

\end{document}

This is necessary because the document will be converted into XML.

For XML purpose, each equation should have unique id and citation link, for that purpose the equation have to be separated, but for PDF/DVI view, the equations should be in aligned format.

This will be done with typesetting services (Latex->PDF and XML).

18

1 Answer 1

1

This is just an implementation of the suggestion in Thruston's first comment (Mar 1) to OP, aligning the = signs in the center, and assuming no side of any equation is longer than 2in. Of course these can easily be adjusted.

A much more complete solution by Steven Segletes (allowing changing of the aligning throughout the document) is linked in his Sep 21 comment (also to OP). One of those links is marked as a duplicate, but Steven's answer (not the selected one) is not a duplicate.

It seems that OP may be looking for a simple solution, but I don't want to give the appearance of using someone else's answer as my own. If this is inappropriate, let me know and I'll delete this answer. (Still relatively new to TeX.SX).

enter image description here

Code is here:

\documentclass{article}

\newcommand{\aligneq}[2]{\makebox[2in][r]{#1}=\makebox[2in][l]{#2}}

\begin{document}
Sample
\begin{equation}
\aligneq{a+b}{c}
\end{equation}
\begin{equation}
\aligneq{aaaa + bbbb}{sss}
\end{equation}

\end{document}

You must log in to answer this question.

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