Hannan Sadar wrote:

In LyX we can write
\matrix and then use M - m  c i to increase Collins and also  M - m d
i for raws. I would like to create my own borders, from one side it
would be a straight line and from the other side it would be ">".
After i would define this, how could i create for it a shortcut?

To insert a matrix with the shortcut "M-m a" add the following line to the file math.bind:

\bind "M-m a"                 "math-insert \matrix"

(don't forget to restart LyX)

For your special case with two different delimiters around the matrix you can define a new command in the preamble with:

\newcommand{\ketmatrix}[1]{\left|#1\right>}

When you now type

\ketmatrix{

in a formula, you can insert the matrix with the defined shortcut in the appearing blue box, see attached example.

regards Uwe

p.s. defining the shortcut as

\bind "M-m a"                 "math-insert \left|\matrix \right>"

produces the following buggy LaTeX-output:

\left|\begin{matrix}\end{matrix}>\right\\]
\[
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\begin_preamble
\newcommand{\ketmatrix}[1]{\left|#1\right>}
\end_preamble
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 1
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 1
        1
        34
        -1
\end_bullet
\bullet 2
        2
        35
        -1
\end_bullet
\bullet 3
        2
        7
        -1
\end_bullet

\layout Standard


\begin_inset Formula \[
\left|\begin{matrix}\end{matrix}>\right\\]

\end_inset 


\the_end

Reply via email to