New answers tagged

0

It seems to me that Maple does support LaTeX. There seems to be two options: either whole file export (From the File menu, select Export As. The Export As dialog opens.) or single expression export function conveniently named latex


3

With a light (local) squeezing of the space between columns and some additional negative spacing where appropriate. I removed the wrong \quad spaces you are using. \documentclass[10pt,a4paper,titlepage]{book} \usepackage[paperwidth=165mm, paperheight=238mm, left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[graphicx]{realboxes} ...


1

Here is a solution with arydshln: \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage{array} \usepackage{amssymb, mathtools} \usepackage{arydshln} \setlength\dashlinedash{2pt} \setlength\dashlinegap{1.2pt} \newenvironment{BMatrix}[1]{% \Bmatrix\hspace{-0.5\arraycolsep}\array{#1}}% {\endarray\hspace*{-0.5\arraycolsep}\endBmatrix} ...


21

Using the mathtools package you can make use of enhanced versions of the matrix environments. In this example I use the starred version of pmatrix which accepts an optional argument which is the alignment of the cells. To reserve the space for the minus sign, I simply put \phantom{-} before the entries to be spaced out. \documentclass{article} ...


3

Using \llap As noted in comments, when using \llap{$-$}2i alone, the column spacing is too tight. However, building on the other answers idea of using a \phantom, instead of using it in every row other than the "minus" row, here it is used once to correct the column spacing by use in the first column, with a single \llap on the row with the minus used to ...


6

Well, you've set up an array with four columns left-aligned \begin{array}{llll} - that's what your four ls do. In order to align the 2s, I suggest a hack \documentclass[12pt]{article} \pagestyle{plain} \usepackage[margin=1.8cm]{geometry} \geometry{a4paper} \usepackage[parfill]{parskip} \usepackage{amsmath} \usepackage{amssymb} \newlength{\minuslength} ...


3

See, if this is what you looking for: The code of above equations is: \documentclass[12pt]{book} \usepackage{mathtools} \usepackage{amsfonts} \renewcommand{\baselinestretch}{2.2} \usepackage{lipsum} \newcommand{\sign}{\operatorname{sign}} \newcommand{\ub}[2]{\underbrace{#1}_{#2}} \newcommand{\x}{\textsc {x}} \newcommand{\z}{\textsc {z}} ...


2

You're using the wrong tool: matrix centers each cell. \begin{equation*} \text{when } \begin{cases} a(E)'=\infty, &\text{if $E=\bar{L}$} \\ a(E)'=0, &\text{if $E=0$} \end{cases} \end{equation*}


3

It's easy to do with pstricks, as it allows using a usual ams matrix environment. The relevant entries of the matrix are defined as \rnodes, and these nodes are connected with \ncboxes: \documentclass{article} \usepackage{amsmath} \usepackage[table, x11names]{xcolor} \usepackage{fourier} \usepackage{pst-node, multido} \usepackage{auto-pst-pdf} ...


5

This is slightly adopted on my old example of matrix with highlighted elements (it quit differ from your image): To change path to your wish you only need to select nodes in matrix, through which path should go. \documentclass[border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \centering ...


7

I suggest increasing \arraystretch, and using the \mfrac command (medium sized fraction, about 80 % of \displaystyle), from nccmath. If you want all columns to have the qame width, it can be done with the eqparbox package. Also, note \max is a math operator, so you don't need to code _{\mathrm{max}}: \documentclass{article} \usepackage{mathtools, array, ...


5

First of all, you can use \frac instead of \dfrac to shrink fractions in a matrix environment. One option, inspired by this answer, uses the tabstackengine package: \documentclass{article} \usepackage{tabstackengine} \stackMath \begin{document} \[ \setstackgap{L}{1.1\baselineskip} \fixTABwidth{T} Q= \parenMatrixstack{ \frac{1}{\Delta ...


8

Another solution with a matrix of nodes. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture}[ X/.style={draw=gray, minimum size=4mm, outer sep=0pt}, G/.style={X, path picture={\fill[gray] (path picture bounding box.center) circle[radius=1.5mm]; }}, BG/.style={G, fill}, B/.style={X, ...


3

I suggest you omit the \begin{bmatrix} and \end{bmatrix} statements that surround "B ". In addition, you should consider replacing all \textit{\textbf{.}} statements with \bm{.} ("bold math"). Do verify for yourself that, say, \bm{t}_{1} features much better spacing between the letter t and the subscript 1 than \textit{\textbf{t}}_{1} does. ...


2

Unless I'm missing something, the following is what you want: \begin{equation} Y=\begin{bmatrix} \textit{\textbf{t}}_{1} \\ \textit{\textbf{t}}_{2} \\ \textit{\textbf{t}}_{3} \\ \textit{\textbf{t}}_{4} \\ \end{bmatrix} \textit{\textbf{B}} \end{equation}


5

Here is an approach using tikz: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\cellsize}{0.5} \newcommand{\circlesize}{0.35} \newcommand{\printwhitecell}[2][]{\node[draw=gray, semithick, fill=white, minimum width=\cellsize cm, minimum height=\cellsize cm] at #2 {#1};} \newcommand{\printblackcell}[1]{\node[draw=gray, ...


8

Ol' stackengine to the rescue. Here I define \grd and \blkgrid as the basic grid cells in white and black, with gray border (I use a leading negative \kern on the grids so that adjacent cells don't produce a double-rule thickness). I give them the shorthand \w and \b, respectively. Then I create 2 stackinsets - one of a gray circle on white cell (and call ...


0

The solution from the manual uses pstricks. This package should be used with the latex->dvips->ps2pdf compiler sequence (see http://tex.stackexchange.com/a/68871/89417) instead of the modern pdflatex compiler. If you want to use pdflatex then you can use tikz instead. You can define empty tikz nodes at the position of the sgame cells and draw a line ...


4

l columns are left-aligned, while c columns are center aligned, so just change l to c in the array specification. That said, I'd rather use pmatrix from amsmath here. \documentclass{article} \usepackage{amsmath} \begin{document} \[ \phi_1(\mathbf{x}) = \left( \begin{array}{c} x_1^2 \\ \sqrt{2}x_1x_2 \\ x_2^2 ...


1

A solution with \tikzmark: \documentclass[a4paper]{article} \usepackage[czech]{babel} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{tikzmark} \begin{document} \[ \begin{tikzpicture}[remember picture,overlay] \draw ([yshift=1.2\ht\strutbox,xshift=-3pt]{pic cs:start}) rectangle ([xshift=3pt,yshift=-\dp\strutbox]{pic cs:end}); \end{tikzpicture} ...


3

Here's a code. Don't use $$ … $$ for displaymah, but \[ … \]. I loaded the array package to have some more functionalities (less tight vertical spacing, and a simpler code for repetition of cells with the same specifier): \documentclass{article} \usepackage{mathtools, array} \begin{document} \[ \setlength\extrarowheight{2pt}\begin{array}{c|*{8}{c}|} ...


4

You can of course do this with LaTeX. To generate a horizontal line that spans a subset of the columns, use \cline{x-y}, where makes a rule from column x to column y. To remove the vertical bars from the top row you need to override the column specification for two of the cells with \multicolumn. The syntax is \multicolumn{<number of ...


4

Two variants. I have to use a \raisebox command, adjusted by trial and errors, because it seems blockarray environment, for some reason, is not centred on the mathaxis. The blockarray is not raised at all (0pt), but the optional arguments are here to fool LaTeX and make it believe the contents of the environment is slightly higher and less deep than it is ...


5

\documentclass{article} \usepackage{blkarray} \begin{document} \[ \left[\begin{blockarray}{cccc} \begin{block}{[cc]cc} 1 & 2 & \cdot & \cdot\\ 3 & 4 & \cdot & \cdot\\ \end{block} \cdot & \cdot & [3] &\cdot\\ \cdot & \cdot & \cdot & [4]\\ \end{blockarray}\right] \] \end{document} One can use \circ ...


4

Here is a solution with pstricks-add. The idea is to set empty nodes at relevant places in the matrix and connect them with the \psbraces command. You can compile either with xelatex, or with pdflatex, if you use the --enable-write18switch (MiKTeX) or -shell-escape (TeX Live, MacTeX). \documentclass[border =10pt]{standalone} \usepackage[utf8]{inputenc} ...


2

You can add some more aligns: \documentclass[preview]{standalone} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsthm} \usepackage{mathdots} \begin{document} $$\Delta(\left|v_{i}\right>)= \begin{bmatrix} 0 & \ldots & 0 & 0 & \ldots & 0 & d_{i,L} & * & \ldots & *\\ 0 & \ldots & 0 & 0 & \ldots ...


2

I think you don't need a \mathclap in the definition of \sunderb. Also, I reduced slighlty the value of the width (1st argument) as it looks better for my taste. A final comment: needless to load amstext: mathtools does it for you. Same comment for graphics, loaded by graphicx, and finally, epsfig is deprecated in favour of graphicx. ...


1

After guessing at a definition for \R and removing a stray brace, I modified the \sunderb macro by adding an outer \makebox[#1]. Without it, you ar relying on the natural width of other items in the column to compensate for the \mathclap. When a column, like the last one of the matrix, has nothing else that wide, it provokes the overlap. ...


2

Here is a solution using siunitx and ncccmath for its \medmath command, which reduces the size of \displaystyle by about 20 %: \documentclass[12pt,a4paper]{article} \pagestyle{myheadings} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} %code \usepackage{uarial} % for \renewcommand{\familydefault}{\sfdefault} %arial font \usepackage[brazilian]{babel} ...


3

Here is a manual way \documentclass[a4paper]{memoir} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb} \usepackage{fix-cm} \begin{document} \[ BP=\left( \begin{array}{@{} c|c @{}} \begin{matrix} \quad\text{\fontsize{10mmm}{10mm}\selectfont$0$}\quad \end{matrix} & \begin{matrix} b_1\\\vdots\\b_{n-1} \end{matrix} ...


5

My main suggestion is to take the factor 10^4 outside the matrix. That way, the width of first five columns can be made reduced dramatically, while the width of the final two columns doesn't increase much on net. Using a bmatrix* environment and reducing the value of the \arraycolsep helps too. \documentclass[12pt,a4paper]{article} \pagestyle{myheadings} ...


0

Taking into account your picture of desired table in question and your own answer I combine in the following code: \documentclass{article} \usepackage{multirow} \begin{document} \begin{tabular}{|*{4}{c|}} \cline{3-4} \multicolumn{2}{c}{} & \multicolumn{2}{|c|}{Predictions} ...


0

Thanks to salim bou I was able to achieve what I wanted. The code below strips ''Predictions'' and ''Guesses'' of all lines. \begin{tabular}{l|l|l|l|} \multicolumn{2}{l}{} & \multicolumn{2}{c}{Predictions} \\ \cline{3-4} \multicolumn{2}{c|}{} & High & Low \\ ...


1

Like this \documentclass{article} \usepackage{multirow} \begin{document} \begin{tabular}{|l|c|l|l|} \multicolumn{2}{c}{} & \multicolumn{2}{c}{Predictions} \\ \cline{3-4} \multicolumn{2}{c|}{} & High & Low \\ \hline \multirow{2}{*}{Guesses} & High & 14 & 0 \\ \cline{2-4} & ...


3

Not really recursive. But, hey, it works! \documentclass{article} \usepackage{amsmath} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\recursematrix}{O{B}m} {% #1 is the (optional) symbol for the coefficient, #2 is the step \begin{pmatrix} \passerby_recursematrix:nn { #1 } { #2 } \end{pmatrix} } \tl_new:N \l_passerby_recursebody_tl ...



Top 50 recent answers are included