On Fri, Mar 02, 2001 at 01:42:02PM +0100, Andi wrote:
> Then I try to align the equations by using C-Return I get an error message " \tag
>not allowed here".
>
>
> a+b -> c+d (R. 1.1)
>
> a+y+d+f -> s (R. 1.2)
The \tag{} command doesn't work inside eqnarray, but it does work inside
the align environment (from AMS math). Unfortunately, LyX currently doesn't
support the align environment (the next version will!)
One solution is to force latex to use align instead of eqnarray.
This solution assumes you only use numbered eqnarrays.
Put the following line in the preamble:
\let\eqnarray=\align
\let\endeqnarray=\endalign
\newcommand{\x}[1]{}
Then put \x in the middle column of each aligned equation, (and put nothing
else there).
Another solution is to use the following code in the preamble (instead of the
old code):
\newcounter{reaction}
\numberwithin{reaction}{chapter}
\newcommand{\reaction}{\refstepcounter{reaction}
\renewcommand{\theequation}{R.\thereaction}
\addtocounter{equation}{-1}}
\newcommand{\Reaction}[1]{\renewcommand{\theequation}{R. \thereaction}#1}
You will need to put \Reaction{ in latex mode before an aligned reactions,
and } after it, so the LyX display will be
\Reaction{
a+b -> c+d reaction (#)
a+y -> s reaction (#)
}
For single line reaction you don't need to use \Reaction.
Note that when you make a reference to a reaction, you will get '1.2' and not
'R. 1.2' like before.
> The second problem is, that i tried to combine an eps-figure and an equation
> by creating an eps-file containing a placeholder and replaced this by using
> psfrag
>
>
> \psfrag {placeholder} {formula\reaction}
>
>
> to get something like this
>
>
> /---\
>
> | eps | + e -> d +s (R. 1.3)
>
> \___/
>
>
> I inserted the formula via "Math-Math mode". By doing this, I get the same
> error as above, which is clear to me, because I didn�t inserted it via "Math-Display
> mode". Unfortunately I�m not able to insert it like this, because I get an
> Error: "Bad mathmode delimiter".
1. Write the following in latex mode:
\begin{equation}\begin{array}{c}\mbox{}\end{array}\reaction\end{equation}
2. Go to the \mbox{}, and put the cursor between the { and the }
Insert your figure (as inline!)
3. Use \psfrag{placeholder}{formula} (without \reaction!)