New answers tagged

2

Another solution with blkarray and \makebox: \documentclass{article} \usepackage{mathtools} \usepackage{blkarray} \newcommand\chd[1]{\makebox[1.33em]{#1}}% \begin{document} \[ \begin{blockarray}{*{16}{c}} & \chd{all} & \chd{dog} & \chd{dogs} & \chd{eat} & \chd{fleas} & \chd{go} & \chd{has} & \chd{heaven} & \chd{in}% ...


5

Create a macro, here \fxtxt, which places the overtext entries in a fixed width box of appropriate width, here chosen as 3.5ex. \documentclass{article} \usepackage{amsmath} \newcommand\fxtxt[1]{\makebox[3.5ex]{#1}} \begin{document} \[ \bordermatrix{\fxtxt{} & \fxtxt{all} & \fxtxt{dog} & \fxtxt{dogs} & \fxtxt{eat} & \fxtxt{fleas} & \...


3

You can modify the \xmatrix macro to accept ^ alternatively to *: \documentclass[12pt,a4paper]{article} \usepackage{xparse} \usepackage{physics} \newtoks\matrixtoks % not inside the macro!!!! \newcount\rowcount % not inside the macro!!!! \newcount\colcount % not inside the macro!!!! \DeclareDocumentCommand\xmatrix{ s t^ m m m } {% {% \global\...


3

I copied the definition of \xmatrix as \Xmatrix and changed the _ to ^. \documentclass[12pt,a4paper]{article} \usepackage{xparse} \usepackage{physics} \makeatletter \DeclareDocumentCommand\Xmatrix{ s m m m } { { \newtoks\matrixtoks \global\matrixtoks = {} \newcount\rowcount \newcount\colcount \loop \...


1

You can put your matrices in an array environment, that way you can easily put title on top of your columns. As for the extra space, you can then set the desired length using arraycolsep. Edit: as egreg stated in the comments, \arraycolsep affects the placement of pmatrix, so to set extra space between the matrices, use \begin{array{@{}c@{\hspace{20pt}}c@{\...


1

One can make a stack. \documentclass{article} \usepackage{stackengine} \begin{document} \[ \setstackgap{L}{1.2\baselineskip} y = \bracketVectorstack{x_1 x_2 \abovebaseline[-3pt]{\vdots} x_m} \] \end{document}


3

No amsmath needed, using \left[...\right] and an array environment in between, just 'ordinary' math - content from LaTeX: \documentclass{article} \begin{document} $y = \left[\begin{array}{@{}c@{}} x_{1} \\ x_{2} \\ \vdots \\ x_{m} \end{array} \right]$ \end{document}


2

Simpler, for some definition of simple. \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{blkarray} \usepackage{lipsum} % just for the example \begin{document} \lipsum*[2] \[ \begin{blockarray}{ccccc|c} \smash{\makebox(0,0){\rotatebox{90}{$M$ Rules\hspace{6em}}}} & \BAmulticolumn{4}{c|}{N \text{ Vars}} & G \\ \begin{...


4

Here's a solution that use an array environment, no TikZ. \documentclass{article} \usepackage{amsmath,graphicx,array} \begin{document} \begin{equation}\label{eqn:designRule} \renewcommand\arraystretch{1.33} \begin{array}{@{}c@{\hspace{\arraycolsep}}c|c@{}} & \text{$N$ Vars} & G \\[0.5ex] \rotatebox[origin=c]{90}{$M$ Rules} & \begin{...


4

Here a solution with tikz matrix library Code \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,calc} \begin{document} \begin{equation} \begin{tikzpicture}[baseline=(current bounding box.center)] \matrix(M) [matrix of math nodes,left delimiter={[},right delimiter={]},nodes={minimum width=1cm}] { a_{11} & a_{12} & \cdots & a_{...


3

This shows a solution using OP's TiKZ code: Original code contains a typo which avoids drawing second dashed line. Node m-6-1 is referenced while it should be n-6-1. So I've replaced \draw[dashed] ($0.5*(m-6-1.south west)+0.5*(m-7-1.north west)$) --($0.5*(m-6-9.south east)+0.5*(m-7-9.north east)$); with \draw[dashed] (n.center-|n-1-1.west) --(n.center-|...


3

First of all, you should avoid eqnarray. There are some spacing issues around the alignment point. Then, instead of Tikz I would use an equation environment, here displaymath and use array to draw the matrices. To get the braces right there are some font dependent distances that you might want to change. It is probably not the nicest solution but I think it ...


5

The problem is in the & tokens in the subsidiary environment, that should be protected from the outer environment. One of Knuth's dirty tricks that's often used in LaTeX is available. \documentclass{article} \usepackage{amsmath} \makeatletter \newcommand{\@MatrixWithoutBracs}[1]{% \begin{matrix} #1% content \end{matrix}% } \...


4

As @RunarTrollet has pointed out, you need to load the correct packages. My comment had been made upon the following addition to your example code. \documentclass{article} \begin{document} \begin{equation} \psi= \begin{pmatrix} [{\overrightarrow{\sigma}\cdot(\overrightarrow{P}-e\overrightarrow{A})+(p_{0}-eA_{0})+m}]\phi \\ [{\...


5

The problem is the internal usage of the array environment by amsmath's pmatrix. At some point \array{*\c@MaxMatrixCols c} is executed which prepares a table with MaxMatrixCols columns (default is 10). (This makes it that you do not have to insert the number of columns in your table/matrix on your own. Some work around it is done to ensure that the ...



Top 50 recent answers are included