Tag Info

1

Taken from Stefan's answer in http://tex.stackexchange.com/a/2244/46716 \documentclass{article} \usepackage{amsmath} \makeatletter \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{% \hskip -\arraycolsep \let\@ifnextchar\new@ifnextchar \array{#1}} \makeatother \begin{document} $\begin{bmatrix}[*3c|c] 2 & 5 & 0 & 7 \\ ... 4 Vertical spacing is inconsistent in mathmode and behaves differently from that of textmode, that is why simply adding \\[length] wouldn't work. I suggest adding a zero-length \rule of a chosen height can solve the problem. Of course, adding a zero-length \rule inevitably adds a space of {}, so I also put an equal negative space length \! to compensate for ... 2 Here I added a stacking gap (default 3pt, settable with optional argument) to one of the matrices on row 2. It adds the gap above and below the item. Note, though, that if there are other matrix or vector terms in the same equation (not shown), you may need to add gap to those as well, in order to keep rows on the same vertical level. ... 12 Here's how I'd change it. The beauty of a table can be subjective but I think that the lines only add noise and make it "harder" to read the table comfortably. I prefer to use only (sparse) horizontal lines, or alternate row colours, like in this case. Any added packages or commands have been commented in the code as a quick explanation. Post a comment if ... 13 A couple of possibilities: \documentclass[11pt,a4paper]{article} \usepackage{dcolumn} \newcolumntype{d}{D..{3.1}} \begin{document} \noindent X\dotfill X \bigskip \begin{table}[htp]% not ever [!h] \centering \setlength\tabcolsep{.37pt} \small \begin{tabular}{@{}|D..{2.0}|*{14}{d|}@{}} \hline \multicolumn{1}{|c|}{\footnotesize\bfseries SVM} & ... 2 Here's a solution that applies displaystyle-math automatically in pmatrix and bmatrix environments. It should be obvious how the setup may be extended to other math environments. \documentclass{article} \usepackage{amsmath} % for 'pmatrix' and 'bmatrix' environments \usepackage{etoolbox} % for '\AtBeginEnvironment' macro ... 0 I like the following easy solution for vertical lines. V = \begin{pmatrix} \mid & \mid & & \mid \\ {\bf v}_{1} & {\bf v}_{2} & \cdots & {\bf v}_{r}\\ \mid & \mid & & \mid \\ \end{pmatrix} 1 Yet another method is to use the array construct from amsmath package. \documentclass{article} \usepackage{amsmath} \begin{document} \left| \begin{array}{@{}*{19}{c}@{}} 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 0 & 0 ... 3 Edit Given the OPs comment I have rewritten this an simplified it. The single row row vectors and single column column vectors I have put inside \myRow and \myColumn macros that are just a bmatrices. As the size of a bmatrix is dependent on its entries it is not enough to make these the same size as the the bigger corner matrices to I have fudged this using ... 2 To get rid of the line break between the two minipage environments, remove the blank line that's currently between them. Remember: When TeX is in "text mode", blank lines act as paragraph breaks. You may also want to simplify and streamline your code a bit. For instance, there's no real need (I think) to make the font size of the math material "tiny". The ... 2 An example with tcolorbox \documentclass{article} \usepackage[most]{tcolorbox} \usepackage{amsmath, amssymb} \begin{document} \begin{tcolorbox} \[ \begin{bmatrix} 1 & 2 & 3 \\[0.3em]\end{bmatrix}.* \begin{bmatrix} 4 \\[0.3em] 2 \\[0.3em] 1 \\[0.3em] \end{bmatrix} =\text{ERROR}$ \[\begin{bmatrix} 1 \\[0.3em] 2 \\[0.3em] 3 \\[0.3em] ...

3

Use adjustbox to get the right vertical alignment: \documentclass[12pt,a4paper]{article} \usepackage{amsmath,adjustbox} \newenvironment{Pbmatrix}[1][c] {\begin{adjustbox}{valign=#1}$\begin{bmatrix}} {\end{bmatrix}$\end{adjustbox}} \newcommand{\matt}[5]{ \begin{bmatrix} \begin{Pbmatrix}[b] 2+r & -1 \\ -1 & 2+r & -1 \\ & ...

2

Remove the extra \\ after the node closing semicolon and it works \PassOptionsToPackage{table}{xcolor} \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \newcommand{\agente}[3] {% \node[draw,inner sep=0] {\tabcolsep=0cm% \begin{tabular}{m{1em}m{1em}} #1 & #2 \\ #3 & \\ \end{tabular} };} \def\semagente{\agente{}{}{}} ...

2

You have to apply the split directly inside the node. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric,matrix,fit,shapes,backgrounds} \begin{document} \begin{figure}[htb] \centering \begin{tikzpicture} \tikzset{ status/.style={draw=black, minimum width=2em, minimum height=2em, text=gray, anchor=center}, ...

2

Use a nested matrix; in this case, adding a small vertical space between the rows seems better. Using bm is recommended; when it's loaded, \boldsymbol becomes equivalent to \bm, but the latter command is easier to type. \documentclass{scrartcl} \usepackage{amsmath,bm} \begin{document} \begin{pmatrix} \bm{\Phi}_{l,t}^F \\[1ex] ...

2

Since the pmatrix environment is set up to typeset its content without much whitespace, it may not be the most suitable environment for the application at hand. I suggest you use a plain and simple array environment. Incidentally, you may want to load the bm package and use \bm instead of \boldsymbol. \documentclass[]{scrartcl} \usepackage{amsmath,bm} ...

2

You can use \multicolumn{}{}{} to get a value centered. The first argument is the total number of columns you want to merge (2 in your case). The second argument is the horizontal alignment (c in your case). The third argument is the value you want to center (\Phi in your case). This gives you \multicolumn{2}{c}{\boldsymbol{\Phi}_{l,t}^F}. In your matrix, ...

7

This is a TikZ approach. Step 1 First I found that fit library is useful in calculating the bounding box. In the next figure, the brown box does not include bbbbbb_3 because I did not pass (A-2-3) to fit=. \documentclass[border=9,tikz]{standalone} \usetikzlibrary{matrix,fit} \begin{document} \makeatletter \begin{tikzpicture} \matrix(A)[matrix of ...

4

I noticed that all the matrix elements were aligned relative to the outer matrix as if the brackets and braces were overlaid on top of original, using pre-existing gaps. So that is precisely what I did. In the revised version I use Tikz to set markers at the corners and compute the size and location of the sub-matrix. This isn't precise, but will do as ...

1


Top 50 recent answers are included