{array} is an environment used in {math-mode}. It can be useful when aligning terms.

learn more… | top users | synonyms

17
votes
5answers
9k views

bordermatrix with blocks

I need to write a complicated matrix, that has a structure as in the attached picture.
28
votes
4answers
4k views

Using display style fraction in a matrix environment

I'd like use the \dfrac command in a bmatrix environment as follows: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{bmatrix} \dfrac{\partial f}{\partial x} \\ ...
12
votes
2answers
2k views

Array with labeling columns

Is there an intelligent way to label (or name) columns in a matrix? I would like to have something like \[M=\left[\begin{array}{c|cc} 1 & 2 & 3\\ 4 & 5 & 6 ...
8
votes
2answers
403 views

Pretty lists for sorting algorithms

I would like to obtain easily something like in this picture so as to illustrate several sorting algorithms. To produce one line, I would like to use one command of the following kind where the ...
6
votes
1answer
124 views

Parsing a \$ as part of an improved \getargs command

As the author of stringstrings, I am acutely aware of its slowness. For small tasks, that slowness can be annoying. For larger tasks, it can be prohibitive. Recently, in using data column as ...
5
votes
2answers
2k views

Underbraces in Matrix Divided in Blocks

How to put underbraces, inside the parenthesis of a matrix, to name both sides of the blocks? \documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{array} \begin{document} . . . \[ ...
10
votes
3answers
705 views

How to create vertical and horizontal dotted lines in a matrix?

Similar to this question, I am trying to output a similar matrix with dotted line instead of dashed line. Is there anyway to do this? I also try to use these three packages: ...
10
votes
3answers
5k views

Convert numpy array into tabular

I am doing some data analysis in python, putting the results in form of a matrix stored into a numpy array. I would like to put this results into a report and the best way would be to put a table with ...
13
votes
5answers
4k views

Create an array of variables

I'm creating a package for my question papers. (I'm aware of the exam class but I don't want to use that.) I have everything ready but I want to create a grading table at the top of the first page. ...
13
votes
1answer
4k views

A Matrix with labels, dashed lines

I'm trying to TeX the following matrix, from Guillemin and Pollack (1.4 #13) The best I've been able to do is get the dashed lines with \[ \left( \begin{array}{c:c} B & C \\ \hdashline D ...
12
votes
2answers
788 views

Array cell highlighting tikz

I'm beginning to write up a PhD thesis and am pretty new to LaTeX. I'm trying to explain a numerical method I'm using and in doing this I wish to highlight sections of arrays to aid explanation. The ...
7
votes
4answers
178 views

Draw a vertical line over the entries of a column in an array

I'd like to draw vertical/horizontal lines over the entries of a column/row in an array. I find the method to draw horizontal lines at Draw a horizonal line over the entries of a row in an array. But ...
4
votes
2answers
542 views

generating LaTeX tabular code during compilation

I use LaTeX for scientific reporting in brain imaging (fMRI). I have a tabular array in LaTeX, that contains quite a lot of rows and columns, which both are brain regions and in the each intersecting ...
19
votes
4answers
1k views

How can I display an array (as in the data structure from Computer Science, not the mathematical version) in LaTeX?

I'm finding this extraordinarily difficult to search for, as the mathematical meaning of "array" is much more common in LaTeX documentation. I essentially want a single row of boxes, into which I can ...
12
votes
4answers
3k views

PGF/TikZ: How to store strings in array?

I'm trying to generate a lot of name badges. I'm wondering, is it possible to store the names as strings in one array, according to the PGF manual: ...
5
votes
1answer
249 views

Drawing a grid on each image inside the array of images

Please see what I have written,when I need individual grid on each of picture inside my figure-array. In contrast to previews question Drawing a grid on array of images. Question now is why I can't ...
14
votes
1answer
2k views

Multivariate polynomial long division using LaTeX

How do I typeset polynomial long division using multiple variables in LaTeX? I am hoping to be able to do polynomial long division using 2 or more divisors. Currently, the packages I am using are: ...
9
votes
1answer
139 views

Using an array environment inside an xparse command

I would like to define a macro for optimization problems. My attempt is given below. I am wondering why \optimizationproblema works, but \optimizationproblemb does not (I get a "misplaced alignment ...
6
votes
2answers
3k views

Extra vertical space after \hline causes a gap in the right border of an array

I wanted to put a bit of space after an \hline in an array; the main suggestion floating round the Internet seems to be to use \hline \\ [-1.5ex] Unfortunately, this causes a gap in the line on the ...
4
votes
2answers
4k views

Sub-numbering equations within array

I'm using the array environment to give multiple definitions of some value, let's call it x. I can easily get a reference to all 3 definitions together, but I want each one to have its own reference. ...
8
votes
1answer
2k views

Make every element of an array displaystyle?

Is there a way to make every element of an array be \displaystyle? I don't want to do something like \everymath={\displaystyle} (or whatever it should be) because I want this for a particular array ...
5
votes
2answers
748 views

Numbering Vertical Addition Problems

Right now I have the following for a vertical addition problem but I would also like it to be numbered without messing everything else up. \begin{array}{c@{\,}c} & 1 \\ + & 1 \\ \hline ...
2
votes
1answer
75 views

Problem with abbreviation of `\multirow` and `\multicolumn` (LaTeX)

I have had to typeset several block matrixes lately. So I thought of defining abbreviations of \multirow and \multicolumn so as to avoid having to remember the former needs {*} and the latter {r} and ...
2
votes
2answers
183 views

Draw a horizonal line over the entries of a row in an array

How to draw a horizonal line across a row (over the entries) in an array?
2
votes
1answer
305 views

label in subcaption and customize cell size of an array

Using the following code \documentclass[11pt]{article} \usepackage{caption} \usepackage{subcaption} \DeclareCaptionSubType*[arabic]{table} \captionsetup[subtable]{labelformat=simple,labelsep=space} ...
10
votes
2answers
2k views

Gaussian reduction of matrices

I have to show a Gaussian reduction in an assignment, and I was wondering what the more space-efficient and neatest way of expressing this is. I thought about using \begin{smallmatrix} (it's only a ...
11
votes
3answers
2k views

Using \underbrace with table columns

I have the following code: \begin{displaymath} \begin{array}{|c|c|c|c} p & q & p\lor{}q & p\land{}q \\ \hline 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 1 & 0 ...
10
votes
1answer
3k views

Negative Sign and Matrix Alignment

I am having trouble centering the elements of a matrix such that the negative sign is not taken into account during alignment. Additionally, I would also like the space between the left parenthesis ...
14
votes
3answers
680 views

How to find the length of a PGF array?

A few of my macros currently require the user to pass the length of an array along with the array itself. It would be nice if the length could be calculated for them, as the user in question (myself) ...
5
votes
1answer
214 views

Block matrix equation with dimensioning

I need to write following matrix equation in LaTex. The dotted lines shown need to be present in the structure but need not have colors (could as well be black). I have used it here only to show the ...
5
votes
2answers
371 views

Gaussian elimination

I want to demonstrate examples of Gaussian elimination/the Gauss-Jordan method as shown below. There are some things that I like about what I have right now. Each column is the same width from ...
5
votes
1answer
326 views

array and line how to draw?

I want to know how can I draw the line that appears in the right of the image below, and also how can I write this array that appears in the left of the picture.
10
votes
3answers
2k views

Border matrix with multiple indices on top and bottom

How can I write a matrix where there is an index at the top and also at the bottom? \bordermatrix doesn't seem to have an option for multiple indices.
9
votes
3answers
2k views

Problems using `\left\{` in array environment

I am trying to define a matrix in segments by enclosing the entries of the matrix in boxes, and also using the open and closed braces to label those segments. So far I have developed the following ...
8
votes
2answers
743 views

Enforcing That \array Stays Square When Drawing Matrix

I'm trying to draw a block matrix in LaTeX, and this is what I have so far: \begin{array}{|c|c|} \hline I_{r \times r} & 0 \\ \hline 0 & 0 \\ \hline \end{array} Here's a ...
7
votes
2answers
439 views

Modify locally the “array” environment for Equation Systems

When I started to use LyX 2.0.6 I noticed that when an Equation System is needed, there are two options available to typeset it: using the appropriate command on the Math Line cases, or ...
7
votes
3answers
5k views

aligned environment of amsmath vs array environment

Today I found out the existence of the aligned environment of the amsmath package. However, I can't see the advantage of using it instead of the array environment from the example provided in ...
7
votes
1answer
299 views

Tables header row's: how to ignore the column type?

I have several column types defined using the array and collcell package. An example \newcolumntype{N}{>{\collectcell\num}c<{\endcollectcell}} This alleviates making tables a lot, and makes ...
4
votes
3answers
979 views

\underbrace at a strange place, spanning array columns

Take a look at the following code: $$\begin{array}{rr|r|c|l} vd_2:&\raisebox{0pt}[0pt]{\makebox[0pt][l]{$\overbrace{\phantom{b_1\dots b_{n-l_{k-1}-2k}\hspace{2\arraycolsep}b_{n-l_{k-1}-2k+1}\dots ...
4
votes
1answer
1k views

Error with blkarray: Misplaced \noalign

I am trying to write a matrix with indices given to the rows and columns. I get the error "Misplaced \noalign." Does anybody understand why? The minimal example is below. \documentclass{minimal} ...
3
votes
1answer
801 views

Defining repeated tabular/array columns using a computed value to specify the number

Background: I just recently saw that one could define multiple columns in a tabular or array using the syntax: *{num}{<align>} So, for example \begin{tabular}{r*{3}{l}r} is the identical to ...
11
votes
2answers
813 views

Problems with alignment of sequences

I want to align two sequences: a_1, b_1, c_1, d_1, e_1 etc. a_2, b_2, c_2, d_2, e_2 etc. here's what I wrote \begin{align} \notag &a_1,\ &b_1,\ &c_1,\ &d_1,\ &e_1\ ...
7
votes
3answers
299 views

How can I determine the size of an array?

After a long search period, I was not able to figure out how to determine and use the len of an array like this: \def\mar{ 1,2 } \path let \p1=($(rec.west)-(rec.east)$), ...
7
votes
3answers
2k views

Drawing Multiple Diagonal Arrows in a Table

My question is basically the same as this one, but with many arrows instead. (I'd like to see the TikZ solution--I feel like once I get it here, I'll be able to extrapolate and do it in other cases ...
7
votes
2answers
271 views

How to stop fractions in display equations from running into each other?

Is there some standard way to create multiple display equations like the following without having to use: \renewcommand*{\arraystretch}{2} (so that the two rows in the second equation don't get ...
6
votes
1answer
185 views

How to model {smallmatrix} with {array}?

It is pretty normal, I guess, to use \begin{array} ... \end{array} to model matrices, when more control is required than you get with pmatrix, bmatrix, etc., with the proper \left and \right, and the ...
5
votes
4answers
765 views

Big curly brackets and rotated text around table

I have a rather cramped looking table here showing the chance of a nurse touching a surface type given (s)he is doing a certain type of care. I would like to make a large curly bracket to the left of ...
5
votes
1answer
5k views

Columns width of array environment

I'm using the array environment and have something like this: \begin{array}{|c|c|} \hline \textbf{x} & \textbf{y} \\ \hline \hline t_1 & lon_1 \\ \hline \end{array} I ...
3
votes
1answer
261 views

Pgfplotstable adding a growth column without column names and then offsetting it

I'm trying to create a new column in a pgfsplotstable which shows the compound growth over the preceding columns. The columns don't have names, and I want to shift the column a little to the right to ...
3
votes
1answer
704 views

using multiple brace in array environment

I want to create something like that Clearly every element should be coherent with eachother and line need to be connected. This is a MWE, how should I modify it to make it coherent: ...