7

I started to TeX my lectures instead of writing them on a paper, usually this is not a big problem. I can handle most of the formulas in little time.

The only problem I have is to write down matrices. Time spent by the docent to write down a matrix is nearly nil compared to the time I spent typing in: \begin{p + Tab + Enter .

If it would be one or two matrices I could keep up easily.

But the problem with studying mathematics is that if there is one matrix, there are usually a bunch of them following it.

I could try to learn enough TeX Syntax to build this command myself, but as the docent needs nil time writing down a matrix, my free-time as a math-student in the 4th semester is convergent to the same value.


For the tl;dr part of the community

Could somebody help me out building a new shorter command for matrices in a math-environment.

If somebody finds the time to help out. Thanks

8
  • Which editor do you use?
    – Mico
    Dec 2, 2016 at 21:37
  • You should consider writing the matrix in Excel and then export it to LaTeX using Excel2LaTeX.
    – Werner
    Dec 2, 2016 at 21:38
  • how short do you want? you only have to use a single character & between cells and two characters \\ between rows it's hard to get a lot more compact than this Dec 2, 2016 at 21:40
  • @DavidCarlisle The problem is not the size of the matrix, but the amount of times I have to write "\begin{pm" what might not seems much, but will add up if you have to write it often enough. Dec 2, 2016 at 21:53
  • 1
    any editor ought to be able to be customised to add that as a single keystroke, but if you want to do it in tex then \newcommand\m[1]{\begin{pmatrix}#1\end{pmatrix}} then \m{a&b&c\\x&y&z} Dec 2, 2016 at 21:56

1 Answer 1

10

Any editor ought to be able to be customised to add any text such \begin{pmatrix} \end{pmatrix} as a single keystroke, but if you want to do it in tex then

\newcommand\m[1]{\begin{pmatrix}#1\end{pmatrix}} 

then

\m{a&b&c\\x&y&z}

will make a 2 row, 3 column matrix (2,3).

1
  • 1
    Did you mean a 2x3 matrix?
    – Ashirwad
    Jan 17, 2020 at 3:27

You must log in to answer this question.

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