Quantcast

Very confused About the error "Misplaced alignment tab character"

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Very confused About the error "Misplaced alignment tab character"

Whitman
I just begun to use lyx for days and when i was trying to input a math equation like this(base on the IEEtrans template),
-----------------------------------------------
$f(x)=\begin{cases} 1 & x>0\\ 0 & x<0\end{cases}$
------------------------------------------------
it supposed to looked like this:
after compiling i'm always getting this error:



and when I copy the same equation above to a new empty Lyx file, and unbelievablely it passed !!! if I deleted the equation in the IEEEtrans Lyx-doc, it can also be correctly compiled!
It means I can't write such an equation in a Lyx file that's based on a template but must creat a new empty file to reedit and reconfigure, that's really baffling ! (Is it a bug or sth else???) sb could give a hand ? thx.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

Paul A. Rubin
Whitman wrote:

> I just begun to use lyx for days and when i was trying to input a math
> equation like this(base on the IEEtrans template),
>
> -----------------------------------------------
>
> $f(x)=\begin{cases}
> 1 & x>0\\
> 0 & x<0\end{cases}$
>
> ------------------------------------------------
>
> it supposed to looked like this:
>
> http://www.nabble.com/file/p16918124/Fx.png 
>
>
> after compiling i'm always getting this error:
>
> http://www.nabble.com/file/p16918124/Error.png 
>
>
> and when I copy the same equation above to a new empty Lyx file, and
> unbelievablely it passed !!!
> if I deleted the equation in the IEEEtrans Lyx-doc, it can also be correctly
> compiled!
>
>
> It means I can't write such an equation in a Lyx file that's based on a
> template but must creat a new empty file to reedit and reconfigure, that's
> really baffling ! (Is it a bug or sth else???)
>
> sb could give a hand ? thx.
>
>
>

Using the IEEETran template, you need to go to Document -> Settings...
-> Math Options and check either "Use AMS math package" or "Use AMS math
package automatically".  For whatever reason, the "automatically" option
is on by default when you start a new document and set the class to
"article (IEEEtran)" but is off when you use the template.  I'm not sure
if I'd call it a bug, but it might be a good idea for the developers to
switch AMS on in the template.

/Paul

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

Whitman
Paul A. Rubin wrote
Whitman wrote:
> I just begun to use lyx for days and when i was trying to input a math
> equation like this(base on the IEEtrans template),
>
> -----------------------------------------------
>
> $f(x)=\begin{cases}
> 1 & x>0\\
> 0 & x<0\end{cases}$
>
> ------------------------------------------------
>
> it supposed to looked like this:
>
> http://www.nabble.com/file/p16918124/Fx.png 
>
>
> after compiling i'm always getting this error:
>
> http://www.nabble.com/file/p16918124/Error.png 
>
>
> and when I copy the same equation above to a new empty Lyx file, and
> unbelievablely it passed !!!
> if I deleted the equation in the IEEEtrans Lyx-doc, it can also be correctly
> compiled!
>
>
> It means I can't write such an equation in a Lyx file that's based on a
> template but must creat a new empty file to reedit and reconfigure, that's
> really baffling ! (Is it a bug or sth else???)
>
> sb could give a hand ? thx.
>
>
>

Using the IEEETran template, you need to go to Document -> Settings...
-> Math Options and check either "Use AMS math package" or "Use AMS math
package automatically".  For whatever reason, the "automatically" option
is on by default when you start a new document and set the class to
"article (IEEEtran)" but is off when you use the template.  I'm not sure
if I'd call it a bug, but it might be a good idea for the developers to
switch AMS on in the template.

/Paul
Thanks a lot for the hint, it seems that the problem happens not only to IEEEtrans template but also to other Templates as well. Hope the coming version will solve it.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

woodvorg
In reply to this post by Paul A. Rubin
Paul A. Rubin wrote
Using the IEEETran template, you need to go to Document -> Settings...
-> Math Options and check either "Use AMS math package" or "Use AMS math
package automatically".
Hi, I already had "Use AMS math package" checked, yet I still get the error. I'm using a layout which is based on report document class. Any ideas?

I should just go with pure latex as I seem to be spending more time hunting for fixes like this than actually writing my thesis!

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

Jürgen Spitzmüller-2
woodvorg wrote:
> Hi, I already had "Use AMS math package" checked, yet I still get the
> error. I'm using a layout which is based on report document class. Any
> ideas?

Could you provide an example file? If I insert your example cases construct
into the IEEEtran template, I get the error you describe (which actually
shouldn't happen). However, if I switch on "use AMS math automatically" in
Document->Settings->Math-Options), the document compiles without errors.

Jürgen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

woodvorg
Jürgen Spitzmüller-2 wrote
Could you provide an example file? If I insert your example cases construct
into the IEEEtran template, I get the error you describe (which actually
shouldn't happen). However, if I switch on "use AMS math automatically" in
Document->Settings->Math-Options), the document compiles without errors.
Thanks for the quick reply! In the process of making an example file... I discovered that if I manually add \usepackage{amsmath} to the latex preamble, it works. So for some reason my layout is ignoring the "use AMS math" options.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

Jürgen Spitzmüller-2
woodvorg wrote:
> Thanks for the quick reply! In the process of making an example file... I
> discovered that if I manually add \usepackage{amsmath} to the latex
> preamble, it works. So for some reason my layout is ignoring the "use AMS
> math" options.

This is strange. Do you have a modified *.layout file for the class that
happens to have

Provides amsmath 1

defined?

Jürgen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

woodvorg
Can't seem to find anything like that in the layout file. The layout was originally based on amsbook class, I modified it slightly to work with report class, perhaps that could have something to do with it.

unswthesis.layout
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

Jürgen Spitzmüller-2
woodvorg wrote:
> Can't seem to find anything like that in the layout file.

But you have
        Input amsdefs.inc
in there which itself has
        Provides amsmath         1

This is because the ams classes, for which amsdefs.inc is written, load
amsmath by themselves, and therefore LyX must not load it again.

Writing
        Provides amsmath         0
somewhere _after_ the amsdefs inclusion in your layout file might fix the
problem.

HTH,
Jürgen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

Jean-Marc Lasgouttes
Jürgen Spitzmüller <[hidden email]> writes:

> woodvorg wrote:
>> Can't seem to find anything like that in the layout file.
>
> But you have
> Input amsdefs.inc
> in there which itself has
> Provides amsmath         1
>
> This is because the ams classes, for which amsdefs.inc is written, load
> amsmath by themselves, and therefore LyX must not load it again.

This probably means that we should move the Provides to the classes
themselves.

JMarc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Very confused About the error "Misplaced alignment tab character"

sabahmed
This post has NOT been accepted by the mailing list yet.
In reply to this post by Whitman
I am facing the same problem. I am not following IEEE format but i have to deal with same type of equation
\left\{\begin{matrix}
true &...& embed\\
false &...&skip \\
\end{matrix}\right.
i get 2 errors
1)$ missing
2) & misplaced alignment tab character
Loading...