Tagged Questions
7
votes
2answers
143 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
183 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
350 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}
...
2
votes
1answer
191 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
585 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 ...
16
votes
3answers
14k 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 ...
1
vote
4answers
576 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 ...
9
votes
2answers
1k 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}
...