New answers tagged

1

Like this: \documentclass[11pt]{book} \usepackage{amsmath,amsfonts,amssymb,amsthm} \usepackage{xcolor} \definecolor{ocre}{RGB}{0,173,239} \usepackage{blkarray} \makeatletter \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{% \hskip -\arraycolsep \let\@ifnextchar\new@ifnextchar \array{#1}} \makeatother \usepackage{tikz} ...


3

\documentclass{article} \usepackage{delarray} \begin{document} \[ \begin{array}[t]\lbrack{c}\rbrack 1\\2\\3\end{array} + \begin{array}[t]\lbrack{c}\rbrack 1\\2\\3\\4\\5\end{array} \] \end{document}


5

The simplest way is write matrix as TikZ matrix and add desired column frame and note to it: \documentclass[11pt]{book} \usepackage{amsmath,amsfonts,amssymb,amsthm} \usepackage{tikz} \usetikzlibrary{arrows.meta,bending,matrix,positioning} \begin{document} \begin{equation} \begin{tikzpicture}[ node distance=1mm and 0mm, baseline] ...


1

You can adapt my answer http://tex.stackexchange.com/a/145718/4427 \documentclass{article} \usepackage{amsmath} \newcommand{\underbracedmatrix}[2]{% \left(\; \smash[b]{\underbrace{ \begin{matrix}#1\end{matrix} }_{#2}} \;\right) \vphantom{\underbrace{\begin{matrix}#1\end{matrix}}_{#2}} } \begin{document} \[ \Delta_n=\det \underbracedmatrix{ ...


1

For the first problem, look at Long dashes for denoting omitted columns of a matrix For the second problem, the result will not be pretty: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{pmatrix} \makebox[9em]{\dotfill} \\ \makebox[9em]{\dotfill} \\ \makebox[9em]{\dotfill\ $2^{i+j}$ \dotfill} \\ \makebox[9em]{\dotfill} \\ ...


12

I am not sure how you want to make it "better" but I suggest using \dfrac to put the fractions into "display mode" and adding extra space between the rows by adding \\[4mm] at the end of the first row. This gives: Here is the full code: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} G(s)=\begin{bmatrix} ...


2

It's a simple matrix, but embedded in \mathrel: \documentclass{article} \usepackage{amsmath} \newcommand{\relstack}[1]{\mathrel{\begin{matrix}#1\end{matrix}}} \begin{document} \[ \begin{pmatrix} 3 & 2 & -2 & 7 & 4 \\ -2 & 4 & 1 & 3 & -2 \\ 1 & 5 & 1 & 0 & 3 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ ...


4

You can set these as part of a regular array: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{pmatrix} 3 & 2 & -2 & 7 & 4 \\ -2 & 4 & 1 & 3 & -2 \\ 1 & 5 & 1 & 0 & 3 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ x_5 \end{pmatrix} ...


3

Disclaimer: Because a minimal example is missing, I do not know, where your large vertical space comes from. I had to increase the spacing to get it square with a plain document class. Usually the vertical spacing inside a tabular or array can be influenced by setting \arraystretch: \documentclass{article} \usepackage{arydshln}% \hdashline ...


1

Texstudio/Texmaker (both cross platform) have a wizard (see User manual Texstudio "Inserting a table" for tables, matrices etc, by giving the number of rows and columns.


1

A solution with TikZ matrix was missing! \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{matrix, positioning} \begin{document} \begin{tikzpicture}[% mynode/.style={minimum width=1cm, minimum height=0.5cm, draw, fill=#1, outer sep=0pt}, mynode/.default={black!60}, N1/.style={mynode}, N2/.style={mynode=black!30}, ...


1

Another solution based on the psmatrix environment, from pstricks: \documentclass[11pt, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{geometry} \usepackage[x11names]{xcolor} \usepackage{pst-node, auto-pst-pdf} \begin{document} \centering\noindent \begin{pspicture} \begin{psmatrix}[mnode=p, ...


6

An ordinary tabular and colortbl will do: \documentclass[11pt, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[x11names]{xcolor} \usepackage{array, colortbl} \begin{document} \centering \begin{tabular}{|*{4}{p{0.6cm}|}} \hline \rowcolor{SlateGray4!60} & & & \\ \hline ...


7

Well, when I needed to do similar task, I wrote \Rect function \documentclass{article} \usepackage{tikz} \newcommand{\Rect}[5]{ \draw[#1] (#2,#3) rectangle(#2+#4,#3-#5); } \begin{document} \begin{tikzpicture} \Rect{}{0}{4}{6}{4} \Rect{fill=red}{0}{4}{2}{1} \Rect{fill=red}{2}{4}{2}{1} \Rect{fill=red}{4}{4}{2}{1} \Rect{fill=gray}{0}{3}{2}{1} ...


3

After lot of manual tweaking ... well if you liked to have something like this: For above I use ordinary tabular. For space between rows I employ \addlinespace from booktabs, align is from mathtools (amsmath). With geometry I set margins to 20mm (assuming A4 paper size) ... Code: \documentclass{article} \usepackage[margin=20mm]{geometry} ...


14

The amsmath package provides a number of options. The leading letter before matrix indicates the delimiter that is used: p for parens, b for brackets, v for verts, B for braces, V for double verts. \documentclass{article} \usepackage{amsmath,tabstackengine} \begin{document} \[ \begin{matrix} 1&2&3\\ 4&5&6\\ 7&8&9 \end{matrix} \quad ...


0

Here, I just turn all pmatrix environments into \parenMatrixstacks and \parenVectorstacks. The inter-column gap in the matrix is governed by \setstacktabbedgap{} and the inter-row baselineskip is governed by \setstackgap{L}{}. This answer requires my tabstackengine package. \documentclass[12pt,a4paper]{report} \usepackage{amsmath,tabstackengine} ...


3

For consistency reasons, I don't think that increasing the \arraystretch is a good idea. However, if we correctly understand the cause of this behavior, we may come with a simple and exact solution. The main cause of this problem here is writing symbols of different heights in the three matrices, namely, the \vdots and \ddots symbols which are higher than ...


3

I think the easiest solution, i.e., the one that requires the least amount of additional typing, involves increasing the value of \arraystretch. Its default value is 1.0; increasing it to about 1.8 at the start of the equation environment should do the job. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation}\label{eq:xyz} ...


3

You can use Tikz' tikzmark for this: \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc,tikzmark} \begin{document} \[ \epsilon_i = \left ( \begin{array}{c} \vdots \\ 0 \tikzmark{lineOne}\\ 1 \tikzmark{lineTwo}\\ 0 \\ \vdots \end{array} ...


4

To get both separators to span the full height of the array, you need to replace the code in the first and third row of the array, viz. \\ with & & \\ Actually, adding a single & symbol to row, viz. & \\ works too. \documentclass{article} \begin{document} \[ A = \left ( \begin{array}{c|c|c} & & \\ C_1 & \cdots & ...


2

Nested matrices; the trick is to add some big invisible object: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{bmatrix} \begin{bmatrix} \makebox[4em]{$\Bigg.C_{N}$} \end{bmatrix} & \begin{bmatrix} \makebox[1em]{$\Bigg.\mathbf{k}$} \end{bmatrix} \\[3.5ex] \begin{bmatrix} \makebox[4em]{$\mathbf{k}^T$} \end{bmatrix} & ...


1

Another simple solution with the blkarray package: \documentclass{article}% \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathtools, blkarray} \begin{document} {\boldmath \[ \begin{bmatrix} \begin{blockarray}{cccc} \begin{block}{[ccc][c]} & & & \\ & C_N & & \boldsymbol{k} \\ & & &\\ ...


2

Here, I use stacks, with some \makeboxes to pad the horizontal width, \addstackgap to pad the vertical height, and a \vcenter to get it all vertically centered. \documentclass{article} \usepackage{stackengine,eulervm} \stackMath \begin{document} \[ \left[\vcenter{\hbox{\addstackgap[1pt]{% \stackanchor{\Biggl[\makebox[10ex]{$C_N$}\Biggr] ...


6

You can use the nicefrac package: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fourier} \usepackage{mathtools} \usepackage{nicefrac} \begin{document} \[ \begin{bmatrix} \nicefrac{1}{6} & \nicefrac{5}{6} & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & \nicefrac{1}{6} & 0 ...


4

Instead of writing \frac{a}{b}, use a/b: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{bmatrix} 1/6 & 5/6 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1/6 & 0 & 5/6 \\ 5/6 & 0 & 0 & 1/6 \end{bmatrix} \qquad \renewcommand{\frac}[2]{#1/#2} \begin{bmatrix} ...


5

\color does not take the text to be coloured in an argument, you should use \textcolor{red}{\textbf{Translation}} not \color{red}{\textbf{Translation}} As noted in the color package documentation \color at the start of a table cell can affect the positioning, use of \textcolor starts the paragraph before the colour change so avoids that problem.


2

Without the transparency stuff the solution is quite straigth forward with the matrix plot* feature of PGFPlots v1.13 (section 4.6.12 on page 168 of the manual). I simplified your example a little bit so it is easier to see the main points. \documentclass{standalone} \usepackage{xcolor} \definecolor{cr3}{RGB}{177,11,69} ...



Top 50 recent answers are included