Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

3

The pmatrix environment must occur in math mode: either inline math mode or (more likely) display math mode. The following code should compile just fine. \documentclass{article} \usepackage{amsmath} % for 'pmatrix' environment \newcommand\tsigma{\tilde{\sigma}} % handy shortcut macro \begin{document} \[ % enter display math mode \begin{pmatrix} \tsigma_{...


3

If you're willing to work with some other packages, you can capture the argument of every cell in a newly-defined column (say) I and then process (separating out the real/imaginary parts): \documentclass{article} \usepackage{amsmath,eqparbox,collcell,etoolbox} \newcolumntype{I}{>{\collectcell\RpmI}c<{\endcollectcell}} \makeatletter \def\rplusi@#1+#2\...


3

Why not simply three aligned environment inside a\bmatrix`? Unrelated: for displayed equations, use the latex construct \[ ... \], note plain TeX $$ ... $$. \documentclass[11pt, titlepage, oneside, a4paper]{article} \usepackage{amsmath} \begin{document} \[ \begin{bmatrix} \, \begin{aligned} 64&+2.828i \\ 9&+1.732i \\ 16&+2i ...


5

If no further packages can be loaded you have to add the correct \medmuskip around the binary operators by hand \documentclass{article} \usepackage{amsmath} \begin{document} \[ % never use $$...$$ in LaTeX: https://tex.stackexchange.com/q/503/82917 \left[ \begin{array}{*{3}{r@{\mskip\medmuskip}c@{\mskip\medmuskip}l}} 64&+&2.828i & 1&+&...


1

You get a few errors from that code. Complex subscripts (more than a single letter or digit) should be braced: \documentclass{article} \usepackage{amsmath} \usepackage{esvect} \newcommand{\proj}{\mathrm{proj}} \begin{document} \begin{equation} \vv{y_2} = \vv{v_2} - \proj_{\vv{\mu_1}} * \vv{v_2} \end{equation} \end{document} I'm not sure about *, which ...


5

With an automatic writing of the first column. I also thought it was better-looking with the first row also in \scriptstyle: \documentclass{article} \usepackage{xcolor} \usepackage{blkarray, bigstrut} \usepackage{caption} \usepackage{amsmath} \begin{document} \begin{figure}[htbp]\bigstrutjot = 1ex \captionsetup{labelsep = none, skip=0pt} \renewcommand{\...


3

What about write this label by hand? \documentclass{article} %\usepackage{xcolor} \usepackage{blkarray, bigstrut} \usepackage{caption} \usepackage{amsmath} \begin{document} \begin{figure}[htbp] \renewcommand{\arraystretch}{1.4} \bigstrutjot=0.25ex \captionsetup{skip=0pt} \[ \mathbf{L} = \begin{blockarray}{r*{5}{ >{\scriptstyle}c}} & A & B ...


2

You could consider using kbordermatrix: \documentclass{article} \usepackage{kbordermatrix} \begin{document} \[ \renewcommand{\bfdefault}{b} % use bold, not bold-extended \widehat{\mathbf{R}} = \kbordermatrix{% & A & B & C & D & E \\ 1 & 5.00 & 3.09 & 4.90 & - & \textbf{4.62} \\ 2 ...


5

There's a workaround for the brackets size: use \bigtrut[t] in a cell of the first row and \bigstrut[b] in the last row. I added a simplication of the code for the first column, using the BAenum row counter defined by the package Last, I removed the unnecessary colon after the figure label, since there's no caption text. \documentclass{article} \usepackage{...


4

In my opinion, increasing the total height of the square brackets should be the least of your (typographic) priorities. I'd focus most (all?) of my energy on telling TeX to use the regular-bold rather than (default) bold-extended font weight for the numbers in the five data columns. I would also expend some energy on increasing the horizontal separation ...


2

Short of increasing the value of \arraystretch by a factor of two or more, here are two solutions to the problem of the denominator term of the upper fraction being too close to the numerator term of the lower fraction: For a modest increase in vertical separation, insert a \mathstrut directive in the numerator of the lower fraction. For a more pronounced ...


2

You can add some additional vertical spacing manually, like this (approximately): \documentclass{article} \usepackage{mathtools} \begin{document} \[ \begin{pmatrix} -1 \\ -\frac{1}{3} \\[.5ex] \frac{1}{2\sqrt{2}} \\ 2 \end{pmatrix} \] \end{document}


0

My friend and me spent some Sunday time to help you ^^ We often use simple way, natural layer to draw, but in this case, \pgfdeclarelayer should be used. The red layer (named main) is drawn in bethween 2 blue layers (named Original layer and Result layer). % Code: Le Huy Tien + Bui Quy \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{...


0

The question of @Dimas is fine. The \begin{pmatrix*}[r], however, does not work well when the numbers have a different number of digits. Let me add this answer, which defines a new column type [C]. It requires the tabularx package. Note: This answer is based on another answer from StackExchange (I could not identify the link). Here is the code and the ...


3

With the help of the valign=c option from the adjustbox package, the images and the comma cen be vertically centered: \documentclass{article} \usepackage[demo]{graphicx} \usepackage{amsmath} \usepackage[export]{adjustbox} \begin{document} \[ \begin{pmatrix} \includegraphics[valign=c]{image} & , & \includegraphics[valign=c]{image} \...


6

Welcome! You can use tikz-3dplot to install a view and the 3d library of TikZ, which automatically gets loaded, to project the matrices on some planes. \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usepackage{tikz-3dplot} \begin{document} \tdplotsetmaincoords{65}{60} \begin{tikzpicture}[tdplot_main_coords] \begin{scope}[canvas is xz plane ...


1

With the help of \color you can achieve the following: \documentclass{article} \usepackage{amsmath} \usepackage{xcolor} \begin{document} \begin{equation}\label{Ex5eq2} M = {\color{red}\begin{bmatrix} 0 &1& 0& 0 \\ 0 &0 &1 &0 \\0& 0&0 &1\\ -2K & K_i & K_p - 5 & K_d \end{bmatrix}} \end{equation} \end{...


2

Your basic problem is solved by @Mico comment, but you maybe looking for the following result: \documentclass[legalpaper,12pt]{amsart} \usepackage{mathtools} \begin{document} \[ A =\begin{pmatrix*}[r] 2 & -1 & 0\\ -1 & 2 & -1\\ 0 & -1 & 2 \end{pmatrix*} \] Describe the column space and the nullspace of the matrices ...


3

Remove any blank lines inside math environments as @Mico said, and use pmatrix for all your matrices and \qquad between A, B, and C. \documentclass[12pt]{amsart} \usepackage{amsmath,array} \begin{document} \[ A =\begin{pmatrix} 2 & -1 & 0 \\ -1 & 2 & -1 \\ 0 & -1 & 2 \end{pmatrix} \] Describe the column space ...


Top 50 recent answers are included