2

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:

An illustration to the problem

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

  • 1
    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
  • 1
    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
2

Compare your expression with and without amsmath:

enter image description here

\documentclass{article}

%\usepackage{amsmath}

\begin{document}

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.