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?

4
  • 1
    have you loaded the amsmath package that defines pmatrix ? Aug 19, 2014 at 22:28
  • @DavidCarlisle : it must be included automatically, doesn't it?
    – PhysiXxx
    Aug 19, 2014 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 Aug 19, 2014 at 22:37
  • LyX doesn't load amsmath automatically unless you use some of its features via the menus/toolbars in LyX. Aug 20, 2014 at 5:15

1 Answer 1

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
  • 1
    Thank you! The package "AMS Math" wasn't enabled in the document's options.
    – PhysiXxx
    Aug 19, 2014 at 23:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .