3
votes
0answers
36 views

Creating a Macro for an n-by-m Matrix in LyX

Specifically, I'd like to create a matrix such as $\left[\begin{array}{cc|c} a_{1} & a_{2} & a_{3}\\ b_{1} & b_{2} & b_{3}\\ c_{1} & c_{2} & c_{3} \end{array}\right]$ But in ...
3
votes
2answers
128 views

Issue with \\ in custom command

So I'm trying to make my own command to make matrices less painful My current command is: \newcommand{\mat}[2]{ \left(\begin{array}{#1}{#2}\end{array}\right)} with the intention to use it as: ...
7
votes
2answers
230 views

Passing an argument with the alignment operator (&) to a macro within another aligned environment

I am trying to write macros for quickly formatting matrices in math mode. Here is a simple, working example: \documentclass{article} \usepackage{amsmath} ...
4
votes
2answers
257 views

How to build macros for vector-matrix operators?

Can anybody build macros for doing the following vector operations? Or are there already such macros? For example, 1) Example data: \def\a{(5,3,0)} \def\b{(5,1,6)} ...
5
votes
2answers
554 views

Foreach loop with command inside Tikz matrix

This question is directly related to Foreach inside a TikZ matrix. But I can't expand it with a macro inside, such that: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} ...
3
votes
1answer
241 views

How to align macros to correct order in TikZ matrix?

How to fix the broken placement of macros in matrix? \documentclass{article} \usepackage{tikz} \begin{document} \newcommand{\macroA}{ \begin{tikzpicture} \node[minimum height=1.5cm,minimum ...
7
votes
3answers
1k views

How to make a newcommand producing a matrix

I would like to do something like this \newcommand{\pmat}[1][2][3][4]{\begin{pmatrix} #1 & #2 \\ #3 & #4\end{pmatrix}} But this produces the error ERROR: LaTeX Error: Missing ...
25
votes
5answers
37k views

typesetting column vector

I would like to define a command which typesets a column vector. For one vector I can have something like: \left( \begin{array}{c} a\\ b\\ \end{array} \right) I would like the command to produce ...
2
votes
4answers
874 views

Defining a good tab-able macro for matrices.

I want to declare some macros in my preamble which allow me to create 2 x 2 matrices more quickly, and in particular, I want to be able to tab through the four entry positions. I feel like this is ...
12
votes
2answers
2k views

Problem with defining shortcuts for TikZ matrices.

For answering a question yesterday I wanted to define a shortcut for creating a matrix inside a tikzpicture. As a minimal example, consider \newcommand\mymatrix[1]{ \begin{tikzpicture} ...