Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've been trying to add a new command to LyX to easen my way through physics, when mostly 3x3 determinants are used.

I clicked Document -> Settings -> Preamble and wrote the following:

% det 3x3
\newcommand{\ninedet}{$\begin{vmatrix}\\
\\
\\
\end{vmatrix}$}

Now, there are a few problems:

  1. I understand that this code is supposed to make a 3x1 det, not 3x3.
  2. It doesn't seem to work either way.

Thoughts? Any help would be deeply appreciated. :)

share|improve this question

migrated from stackoverflow.com Mar 20 '13 at 18:47

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Mar 20 '13 at 23:52

1 Answer 1

I do not see the need of defining something new. With following approach, LyX will make use of the vmatrix environment automatically.

Use "Insert > Math > Matrix..." or alternatively, in math mode the toolbar to create an empty 3x3 matrix possible with some decoration like "|...|". Then you can copy and paste this matrix (either empty or already filled) to other locations in the document.

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.