Questions tagged [arrays]

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

Filter by
Sorted by
Tagged with
4
votes
2answers
479 views

How to get numeric value from array

I'm struggling to get the numeric value out from arrays using the arrayjobx package. My goal is to store a list of values in several arrays, then when display them in a table be able to show the sum (...
1
vote
1answer
230 views

how to make the last line in this table

please how to make the last row in the table ? I try but it the second column did not be centered this is my try \begin{tabular}{ |c|c| } \hline R(x) & Form of $y_p$ \\ \hline \hline ...
1
vote
1answer
86 views

Multicolumn row line display

I am having a weird problem on a row line, with the following code : \begin{adjustbox}{width=1\textwidth} \small \begin{tabular}{| l |*{3}{c |} l | l |} \hline \multicolumn{1}{| c |}{\textbf{Title}} ...
1
vote
2answers
31 views

How to make a usual latex installation compile the following non-standard array-syntax?

Once I seem to have worked on a system where, for some reason, latex code containing $\array{a & b \\ c & d }$ seems to have worked. (Note that, in particular, the "alignment" options ...
0
votes
2answers
95 views

Table not printing correctly

I am trying to create a table with multiple rows in a cell. \documentclass{article} \usepackage{array} \usepackage{mdframed} \usepackage{multirow} \usepackage{xcolor} % Required for specifying ...
-2
votes
1answer
985 views

write an array in latex

I am unable to write this matrix in latex in a full width page. The matrix is given in the below link. Please help me to write this matrix in latex. Edit: Thanks for your feedback. I did the ...
6
votes
4answers
2k views

Draw a box around selected entries of array

I want to draw a dashed-line box as show in picture. Can someone help? Here is the latex code I used for that array: \begin{array}{ccccccccccccccc} c^{(1)} & \geq & c^{(2)} & \geq & ...
1
vote
0answers
24 views

Fail to typeset an array spanning multiple pages properly using pdfTex

I tried to convert a long list of equations in .tex to .pdf using pdfTex. Those equations were written in the array environment, which spans multiple pages. The pdfTex didn't create a pdf file ...
1
vote
1answer
2k views

Package array Error: Illegal pream-token (D): `c' used

\begin{table}[htbp]\centering \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \caption{Probit Models\label{tab5}} \begin{tabular}{l*{6}{D{.}{.}{-1}}} \toprule &\multicolumn{1}{c}{(1)...
1
vote
2answers
969 views

How to write the general optimization problem?

I want to write the optimization problem. My code is: \begin{alignat}{3} & \underset{\framebox(100,10){}}{\text{minimize}} & \quad & \framebox(100,10){}\\ & \text{subject ...
1
vote
1answer
57 views

Aligning two matrices's values (one on top of the other)

It's kinda hard to explain what I want so here's the code and the result: \begin{gather*} \begin{matrix} {} & \begin{pmatrix} 0 & 1 & \cdots & n-1 \end{pmatrix} \\ \begin{...
1
vote
2answers
110 views

array error Missing number, treated as zero. [b,a] Illegal unit of measure (pt inserted). [b,a] Missing = inserted for \ifdim. [b,a]

When i wrote \begin{displaymath} a\circ b = \left\{ \begin{array}{ll} [a,b] & \textrm{if}~a<b \\ [b,a] & \textrm{if}~ b < a \\ \{a\} & \textrm{if}~a = b \end{array}\right. \...
0
votes
0answers
60 views

setting values in an array according to set conditions

I have an array of value from an image of suns magnetic field. I am meant to set all values above 3*sigma and below -3*sigma to 1. the values in between to 0. and i also have nan values in that array ...
1
vote
2answers
766 views

Underbrace/underset multiple elements in a row of array/matrix

I want to indicate with underbraces that in a matrix after an element H_1 there follow K zeros. \begin{equation*} P_1 = \begin{bmatrix} H1, & \underbrace{0, & 0, & ..., &0, }_{K-...
1
vote
1answer
514 views

Trying to strike out a column in a matrix (array)

So using the last answer from here, as I am using an array not any matrix. I am using MathTex for Libre Office Writer. FYI. Normal Matrix: \left[ \begin{array}{ccc} 3 & 3 & 1 \\ 1 & 0 &...
0
votes
1answer
104 views

Multiple one side brackets for inner

Im trying to explain a code using brackets: outer brackets for the outside loop and inner brackets for the loop inside: I understand how to write one bracket like this from the next form: \[ \...
4
votes
1answer
57 views

My text is cropped when exporting using lyx

When i'm exporting my lyx to pdf (or even when running the latex code) my text is cropped : Tried playing with document setting but could not find any thing there. any idea? Here the code from latex :...
6
votes
3answers
341 views

Nested Array-like environment without Math-region

I'm working on my master thesis and I need to render some structures like this: Edit: Example doesn't use highlighting for the sake of simplification, but I would like to use specifically minted, not ...
0
votes
1answer
225 views

Change (increase) the size of the arrowhead in \xleftarrow and \xrightarrow inside \begin{array}

I need to 'draw' a protocol flow using LaTeX. I decided to go with \begin{array}, since it is sufficient for my needs. However, the arrowhead in \xleftarrow and \xrightarrow is so small, that it is ...
0
votes
1answer
737 views

Specifying the length of \hline

$\left[\begin{matrix} u(\lambda)\\\hline v(\lambda) \\ \end{matrix}\right]$ $\left[\begin{array}{c} u(\lambda)\\\hline v(\lambda) \\ \end{array}\right]$ In the first code ...
1
vote
1answer
395 views

Extra vertical space in the first row of a table

The code is shown below. When the first row does not contain a special cell (with two lines in a cell), this won't actually occur. But I'm not quite sure how to fix it. \documentclass[12pt]{article} \...
3
votes
3answers
391 views

Suppress vertical space above and below array?

The array environment uses \arraystretch (and \extrarowheight if the array package is loaded) to add "leading" between the rows of the array. In addition, this vertical space is added above the first ...
1
vote
2answers
193 views

How to express simplification of an array

How can I type the curly bracket and put the expression alongside of it? Basically, I want to simplify the array and $\mathbf{b} = [b_1,b_2]$ I want help to get the following output as in the ...
2
votes
2answers
296 views

How to align first line in an array

I quite often need to use this kind of format for typing up exercises and it is satisfactory but I am wondering how I can align the letter in brackets with the first line of the exercise adjacent to ...
2
votes
1answer
290 views

Gather equations inside an array

I want to have the solutions to some exercises in a table. I have succeeded in doing it just by using two arrays (and breaking up the equations) with the following code: \documentclass{article} \...
2
votes
1answer
140 views

Is an empty item a problem in LaTeX eqnarray?

The following LaTeX code looks pretty straightforward to me: \begin{eqnarray*} & \lambda_l \mathbf{l}\cdot\mathbf{r} & = & \lambda_r \mathbf{l}\cdot\mathbf{r} \nonumber \\ \therefore &...
2
votes
1answer
178 views

How to do nested highlighting of part of a row in an array?

I'm trying to highlight part of a row in an array, where some parts are "double" highlighted so it appears darker. From a previous question, I tried the following: \usepackage{tikz} \usetikzlibrary{...
8
votes
2answers
222 views

Including symbols in array

How can I include symbols defined as macros in an array and then access them with \pgfmathparse? The following dies with a "missing control sequence: \inaccessible" error \documentclass{...
1
vote
2answers
67 views

Errors upon trying to align function with multiple conditions in `array` environment

I have quite an embarrassing error on my hands. I tried to display a function with multiple conditions. For that purpose, I used array, and was very successful at first. But things went wrong when I ...
2
votes
1answer
345 views

How to put Curly Brace around only part of array

So currently I have curly braces around an array with vertical bars next to only parts of an array using \multicolumn: \[ f_{i_k}(a)= \left\{ \begin{array}{|c|c|c|r} \multicolumn{1}{c}{k=1} & \...
3
votes
2answers
179 views

Making a macro that makes input string the contents of a row array

I am attempting to create a macro that on input string (where n is the length of string) will create an array that would manually have been given by \begin{array}{ccc... % n c's here} string[0] &...
1
vote
1answer
130 views

Star notation in array preamble flawed?

According to section 56.2 of the LaTeX2e sources (which is summarized here), it is possible to use the syntax *{N}{x} to specify xx...x (N times) in the preamble of an array. I would like to be able ...
6
votes
2answers
1k views

Linear Programming in LaTeX

Currently I am doing a project in Linear Programming. In connection with this I want to explain some theory (very short) but I am having a hard time making the expression below. Can anyone help me ...
2
votes
1answer
56 views

Using sequences to build an array row in expl3

The following code compiles, but does not do what I want: \documentclass{article} \usepackage{xparse} \newcommand{\attribute}[1]{\mathbf{#1}} \newcommand{\constant}[1]{\mathsf{#1}} \ExplSyntaxOn \...
4
votes
4answers
1k views

\left and \right with array

The following definition, from How to continue a piece of text so it is aligned with the last line of an inline multiline box?, allows splitting a math set-builder expression across two lines: \...
5
votes
2answers
769 views

“Illegal pream-token (]) used.” for array

I have an identical error message as the one in this question. However upon applying the solution in the answer, the errors still occur. As always, any help is greatly appreciated, and thanks in ...
2
votes
1answer
228 views

Drawing a graph with pgfmathparse+matrix

I want to draw a graph. I use tikz matrix to draw the vertices, and then would like to add edges from an array. I tried the following code: \documentclass{article} \usepackage{tikz,pgfmath} \...
12
votes
4answers
3k views

Function with cases or array

I want to get this function: I wrote two options, but I can't match the picture. Here is the first one: \begin{displaymath} P[\chi_{n+1}=j|\chi_{n}=i]= \begin{dcases} ...
5
votes
2answers
232 views

Bespoke environment for systems of linear equations

My problem I often write systems of linear equations, with the following alignment requirements : all multiple of the unknowns should be right-aligned all +, - and = operation signs should be ...
11
votes
3answers
428 views

Typesetting permutations and alignment

I am typesetting some permutations and am trying to highlight how their cycle structures interact because of how they overlap. Because of this, I want them to fit nicely into a grid. I've approximated ...
5
votes
2answers
207 views

How to make all the connections from a node have the same color?

I'm trying to make too much node connections to have the same color. I tried to create a list of colors and another of nodes, but the list of nodes doesn't work. Here is my non-MWE: \documentclass[...
8
votes
2answers
241 views

Table with underscript

I am writing a table to show how an object fills some space directions. Here is my code \begin{tabular}{lcccccccccc} & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ ...
1
vote
1answer
289 views

subequation labels with array environment

How can I typeset one subequation label per line to obtain complex output like x = y if my weird aligned text (1a) y = x^2 fancy (1b) z^3 = z your dull ...
5
votes
4answers
449 views

Adding underbrace in the array environment to some arbitrary columns

I've created the following output using the array environment, and I feel like it has to be created in that environment. As you can see, it's in three rows. What I want, is to put the \underbrace{} ...
2
votes
2answers
247 views

Loop through “array” to display all events in calendar

I'm modifying a calendar by Robert Krause (TeXample) and trying to make the code more dynamic. I have split it up into two files. One of them contains the main code (the logic) and the other one ...
2
votes
1answer
325 views

Associative Array in LaTeX (Tikz)

I'm modifying a calendar by Robert Krause (TeXample) and I'm searching for a method to get this calendar work dynamically. See also my original post here. As nobody has answered on that oruginal post,...
0
votes
1answer
52 views

In array right braces don't look

In following Tex script right braces aren't looked. \documentclass[a4paper,12pt]{article} \usepackage[turkish]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \...
5
votes
2answers
689 views

Add math commands with custom look to LyX, to change `array` environment alignment

How can I add a math command with custom look and LaTeX code to LyX? I know this is possible for custom citation commands and character styles, so this should be possible for math commands as well! ...
0
votes
1answer
140 views

what's the problem with the following code? [closed]

I want to write an equation like the following: What's the problem with the following code? \begin{array}{lll} U_2(\phi)=\begin{bmatrix} \cos\phi & -\sin\phi \\ \sin\...
4
votes
4answers
1k views

Making nice tables

I am working on a seminar paper, and I would like to code the following type of table into my LaTeX document. I was only able to create this table by first entering in and formatting everything in ...