On Fri, Dec 11, 1998 at 11:45:09AM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Peter" == Peter Drummond <[EMAIL PROTECTED]> writes:
>
> Peter> (2) If you IMPORT a \tilde{\textbf A} combination from a valid
> Peter> latex equation, reLyx modifies it to an invalid latex file,
> Peter> which generates latex error messages. These can't be fixed,
> Peter> since exporting the latex, correcting it, then re-importing it
> Peter> just gives the same problem again. Need to have a native tex
> Peter> file structure here!
>
> The problem is not at reLyX level, since it converts it fine, but at
> mathed level: mathed does not understand \textbf, which is rather for
> real text. However, it does correctly understand \mathbf, which is the
> correct forms to use here.
>
Ah. Good point. However, this points out another reLyX bug which is still
lurking. If a person writes $\bf a$ (i.e., using LaTeX209 type syntax), then
reLYx will convert that to $\textbf a$, which is wrong.
Now, using the new "math mode converter", I *could* have \textbf in math mode
translated to \mathbf. Unfortunately, this is a kludge on top of a kludge. The
problem is that the first pass reLyX makes, where it translates \bf to
\textbf, it doesn't know when it's in math mode and when it isn't. In the
second pass, reLyX does know, so it does the correct thing, e.g., it
translates an \ensuremath to nothing in math mode, but to a \(...\) in text
mode.
This fix will create a new bug, where $a + \mbox{\textbf b}$ will translate to
$a + \mbox{\mathbf b}$ which is wrong. A nicer fix would be to change the
first pass to understand when it's in math mode and when it's not.
While we're talking about mbox: are there plans to support text mode within
math mode, Alejandro?
> In theory, reLyX could translate \textbf to \mathbf in math formulas,
> but is it really a good idea? I'm not sure what the difference is
> really.
Ah. I guess my fix is what you were suggesting. I still don't know if it's a
good idea.
-Amir