# Lyx doesn't display matrix correctly

I have tried to insert following LaTeX code for matrix in Lyx:

$u_{L}(k) = \sqrt{E}\begin{pmatrix} 0 \\ 1 \\ 0 \\ -1 \end{pmatrix}$.


In all LaTeX-based sites this code is displayed correctly, but Lyx have disappointed me: pdf-viewer Adobe Reader (which displayed all before that) shows that:

The question: how to force Lyx to convert LaTeX code for matrices correctly?

• have you loaded the amsmath package that defines pmatrix ? – David Carlisle Aug 19 '14 at 22:28
• @DavidCarlisle : it must be included automatically, doesn't it? – PhysiXxx Aug 19 '14 at 22:35
• I have no idea about lyx but your output suggests pmatrix environment is not defined and you are getting the \pmatrix command (inherited from plain TeX) which is just taking the 0 as argument – David Carlisle Aug 19 '14 at 22:37
• LyX doesn't load amsmath automatically unless you use some of its features via the menus/toolbars in LyX. – Torbjørn T. Aug 20 '14 at 5:15

Compare your expression with and without amsmath:

\documentclass{article}

%\usepackage{amsmath}

\begin{document}

$u_{L}(k) = \sqrt{E}\begin{pmatrix} 0 \\ 1 \\ 0 \\ -1 \end{pmatrix}$

\end{document}

• Thank you! The package "AMS Math" wasn't enabled in the document's options. – PhysiXxx Aug 19 '14 at 23:00