LyXinserting cases environment

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
libuz
Posts: 7
Joined: Thu Oct 18, 2012 11:40 am

inserting cases environment

Post by libuz »

I am beginner of Latex and Lyx. I tried to insert case environment from the menu, like ={a b
but I am getting an error

Code: Select all

! Misplaced alignment tab character &.
 a &
          b\end{cases}$
I can't figure out why you would want to use a tab mark
here. If you just want an ampersand, the remedy is
simple: Just type `I\&' now. But if some right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.
How can I fix this?
Last edited by cgnieder on Thu Oct 18, 2012 5:51 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

inserting cases environment

Post by scottkosty »

libuz wrote:I am beginner of Latex and Lyx. I tried to insert case environment from the menu, like ={a b
but I am getting an error
! Misplaced alignment tab character &.
a &
b\end{cases}$
I can't figure out why you would want to use a tab mark
here. If you just want an ampersand, the remedy is
simple: Just type `I\&' now. But if some right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.

How can I fix this?
Hi libuz,

Welcome to the forum!

To insert 'cases' in LyX, go to Insert > Math > Cases Environment. If you get an error with this, it's probably because you need to change
Document > Settings > Math Options
to load the correct packages.

Does that work? If not, please post a minimum working example .lyx file.

Scott
libuz
Posts: 7
Joined: Thu Oct 18, 2012 11:40 am

inserting cases environment

Post by libuz »

Hi Scott,
Thank you very much. It worked after I selected:
Use AMS math package automatically
in the Math Option.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

inserting cases environment

Post by scottkosty »

libuz wrote:Hi Scott,
Thank you very much. It worked after I selected:
Use AMS math package automatically
in the Math Option.
Great! Thanks for posting back that it worked.

Scott
Post Reply