Skip to main content

Questions tagged [arrays]

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

Filter by
Sorted by
Tagged with
3 votes
4 answers
147 views

How to make sub "array" to aligned with the outer "array" in equation in LaTeX?

How can I align the equal sign in the subarray environment with the equal sign in the outer array environment? \documentclass[letterpaper]{article} \begin{document} \begin{equation} \left. \...
Y. zeng's user avatar
  • 2,105
4 votes
4 answers
135 views

Array aligned with top of item label

I don't understand why the [t] parameter of the array environment does not do anything. I want the top of the brace to be aligned with the top of my item label but it does not work. \documentclass{...
Vincent Krebs's user avatar
2 votes
2 answers
39 views

array with rotated text in one column (not in header) [closed]

I need to make an array/table where I put vertical text in one of the columns (not in the header), like this: What is the most natural/painless way to make such an array, short of using tikz hack? ...
underflow's user avatar
  • 621
3 votes
2 answers
53 views

Array or tabular in Beamer breaks \if

I want to have an array or tabular environment in an \if statement in Beamer. If I have an article, this compiles just fine: \documentclass{article} \def\x{1} \begin{document} \if\x1 \begin{tabular}{...
Sam Jaques's user avatar
6 votes
2 answers
122 views

Simply Adjusting the Position of Dashed Lines in Nicematrix Package

I encountered a problem with the horizontal dashed line created by the nicematrix package in LaTeX. The line is a little close to the bottom of the matrix, overlapping with the elements of the second ...
Prince Chen's user avatar
3 votes
2 answers
244 views

\usepackage{array} causes my build to break

I'm trying to add the following lines to my document: \usepackage{array} \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{C}[1]{>{\centering\let\...
lukygee's user avatar
  • 47
1 vote
0 answers
27 views

Longtable row height limitation with rotated text

With the following code, I want to create a table that is rotated on the page, but the page itself is not rotated (it is for print in a book, so also the pdf cannot have rotated pages): \documentclass[...
edgar's user avatar
  • 11
0 votes
3 answers
35 views

Latex error: Package array Error: Illegal pream-token (3.5cm): c' used

I have a table that has this command. \begin{table}[ht] \centering \centering\caption{Table features} \begin{tabular}{ r{3.5cm} p{5.50cm} p{5.50cm} } \toprule & \multicolumn{1}{r}{} &...
ddocc's user avatar
  • 39
0 votes
1 answer
29 views

\hspace messes up overbrace

I would like to fix the incorrect overbrace and also place "ADD" over the array but without vertical divider, maybe having it a little bit over with a small line pointing the first element ...
Light Wolf's user avatar
3 votes
2 answers
94 views

Does "array" use smaller font in equation compared with "alignedat" or "aligned" in LaTeX?

Sometimes, it is more convenient to use array to align something in equations in LaTeX. However, the array displays more smaller font compared to the alignedat or aligned. \documentclass{article} \...
Y. zeng's user avatar
  • 2,105
2 votes
3 answers
56 views

I want to increase the line spacing in the following array table, what should I do?

I want to increase the line spacing in the following array table, what should I do? \documentclass{article} \usepackage{amsmath, amssymb} \begin{document} \[ \begin{array} {|c|c|c|c|} \hline X &...
ducanh2021's user avatar
4 votes
2 answers
263 views

How to use \foreach and \newtheorem together?

I want to use \foreach and newtheorem together, so I've assigned an array with the package listofitems \setsepchar{;/,}\ignoreemptyitems \readlist\baz { theorem, lemma, definition, corollary, ...
Axia's user avatar
  • 514
1 vote
1 answer
45 views

How to resize an array in math environment

This is my code: $$ \mathcal{P}_{\left\{ \resizebox{0.02\textwidth}{!}{$\displaystyle \begin{array}{l} \mathcal{B} \\ \mathcal{F} \end{array}$} \right\}} \Psi\left(\vec{r}_{1}, \vec{r}_{2}, \ldots, \...
manimanifolds's user avatar
3 votes
3 answers
217 views

How can I create a table like this

\documentclass[12pt,a4paper]{article} \usepackage{amsmath,amssymb} \begin{document} \[ \begin{array}{|c|c|c|c|c|c|c|c|c|} \hline & & & \begin{array}{l} \text{Basis Inverse} \\ B_1^{-1} \...
Memristor's user avatar
  • 119
1 vote
3 answers
77 views

How I can write long equation in LaTeX?

I am trying to write this mathematical expression correctly and systematically. I need some help, please: \begin{equation} \label{58} \begin{array}{l} \alpha_{\mathcal{A}}\|w_n-w_n^{hk}\|^2_V \\ &\...
roufaida ketfi's user avatar
3 votes
2 answers
248 views

Custom Symbol - Simplified way

I have a custom symbol called \trident, which I programmed somehow awkwardly. I'd like to use a more elegant method such as the one suggested to me by @egreg for my \commonroot symbol in this post: ...
Vincent Krebs's user avatar
1 vote
2 answers
64 views

How to decrease the length of the vertical line in the array environment globally?

First a minimal working sample is as follows. \documentclass{amsart} %\delimitershortfall=10pt \delimiterfactor=000 \begin{document} \[ S=\left\{x~ \begin{array}{|l} \frac{m}{n} \end{array} \right\} \]...
M. Logic's user avatar
  • 4,333
1 vote
2 answers
67 views

How to assign only one number to an equation with multiple lines?

As is shown in my code, I used eqnarray but got two numbers. So I tried the method here by using equation and array instead. But I got error messages: "Package array Error: Illegal pream-token (\...
Ypbor's user avatar
  • 399
0 votes
2 answers
143 views

Can a command be used to build a row in bNiceMatrix?

I want to build a bNiceMatrix by storing rows in commands. Here's a mwe. \documentclass[a5paper]{article} \usepackage{nicematrix} \begin{document} This is the matrix I want. \[ \begin{bNiceMatrix}...
Brian Fitzpatrick's user avatar
0 votes
1 answer
72 views

Loop Through Array of Strings (Actually an Array of Array of Strings, e.g. `{{black, ab}, {white, cd}}`)

I'm drawing stones on a Go (game) board with SGF coordinates (which I only managed to do from the the help people gave me on this question) like this \drawStoneFromSgfCoords{ab}. However, there might ...
psygo's user avatar
  • 438
6 votes
2 answers
468 views

Find the highest year in a string

I would like to hide sections of my document according to their publication date. This is how I define my section: \primarySection {Data 1} {Data 2} {Data 3} {Jan. 1930 - June 2023} % Dates ...
Skaÿ's user avatar
  • 163
1 vote
1 answer
33 views

How to define matrix with non-default spacing between columns?

I want to create a matrix that looks like the following, except to use brackets instead of parentheses: I have the following code to display it, but unlike in the above picture, the columns are too ...
pixel's user avatar
  • 1,370
3 votes
4 answers
89 views

Align multiple arrays vertically, which look like a pmatrix with a vertical line separator

\begin{align} \left(\begin{array}{rrr|rrr} 3&1&-2&1&0&0\\ -1&4&3&0&1&0\\ 1&2&-1&0&0&1 \end{array}\right) \begin{array}{rrr|r} \\ \text{II+...
Confused Learner's user avatar
0 votes
0 answers
58 views

Reduce the size of an array

a suggestion to reduce the size of the following matrix since it does not fit in the document \begin{equation*} S=\dfrac{1}{6} \begin{bmatrix} 1 & 1 & 1 & 1 & 1 & 1 & 0 & ...
Tomais's user avatar
  • 163
1 vote
1 answer
37 views

Streamlining align/array combinations (BNF grammars)

I often need to write out syntax of types, programs and so on using Backus-Naur Form (BNF) grammars. I have taken to doing this with \begin{alignat*}{2} \text{\itshape Types} &\quad& A &...
Henry DeYoung's user avatar
4 votes
2 answers
170 views

Add arrow and text above equation

\documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \mathbf{v}_{\textnormal{h}}=\mathbf{v}_{\textnormal{h},0}\left(X_{\textnormal{m}}, X_{\textnormal{s}}, z\right)+\...
Sylvia's user avatar
  • 485
2 votes
2 answers
87 views

Creating a complex aligned equation with blockarray

I am trying to create the following equation. The main challenge is vertically aligning the = sign with curly brace and aligning the bottom rows below the horizontal line. Desired Figure Current ...
jII's user avatar
  • 507
0 votes
1 answer
26 views

"Extra alignment tab has been changed to \cr" Error while creating truth tables in LaTeX

I've been trying to create my own truth table for a homework but I couldn't do it. The code is given below. \begin{array} {|r|r|} \hline p & q & r & p \wedge \neg r & q \downarrow (\...
Schwarzemann's user avatar
1 vote
2 answers
102 views

Horizontal Line in LaTeX Matrix

I would like to reproduce the following table from the Wikipedia page on Runga-Kutta methods: As a result, I need the dividing lines. While this answer here: https://tex.stackexchange.com/a/33522/...
Jacob Ivanov's user avatar
2 votes
1 answer
72 views

Create, Read and Write to dynamic array in separate tikz pictures

I want to create a grid of squares(m width x n height) with their coordinates printed in them. And a second picture of all the rows concatenated in tikz picture. Can I do this in two separate tikz ...
Rohit Kumar J's user avatar
1 vote
0 answers
64 views

having each line numbered in an align environment with brackets

I'm trying to get what looks like the following, but with number at every lines. \begin{align} \text{Minimize} \quad & f(x) \\ \text{subject to}\quad & \text{for $i = 1,\cdots,N$:} \\ ...
Parin Chaipunya's user avatar
1 vote
1 answer
64 views

Underbrace in Matrix without array package [duplicate]

I've been struggling with matrix underbrace, and I can't find any way through all LaTeX questions about how to use an underbrace in a matrix without the array package. So far I got here, with these ...
Agente 156's user avatar
1 vote
2 answers
58 views

How to achieve centered alignment in alignat as in an array with labeled equations?

I'm trying to achieve the same alignment in the alignat environment as I have in the array environment. I want this because I'd like to label each equation individually. Here's what I have so far: \...
Miguel Fernando Rangel Martnez's user avatar
1 vote
1 answer
94 views

Specific format for a linear program

I am trying to format a linear programming problem in LaTeX. I want the objective function "max" and the constraints "s.c." to be left-aligned. However, I want a vertical line to ...
Valentin G's user avatar
0 votes
0 answers
34 views

How to improve this table formatted using tabular and array in terms of centering in the page and wrapping long words in first column?

I am very much new to LaTeX and am unfamiliar with a lot of terms and usage. Nonetheless, I am attempting to put this table into a document. I am having two problems: The table is not centred in the ...
Cale M's user avatar
  • 1
5 votes
2 answers
89 views

Fix spacing in custom matrix environment

I have made a custom matrix environment for using Gauss Jordan elimination, I need a vertical bar between the two halves of my matrix. Here is what I have slopped together \newenvironment{gjmatrix}[1] ...
Abdullah Mustafa's user avatar
3 votes
1 answer
54 views

How to align 4 equations and enumerate them

I have 4 equations that I want to take up the entire width of the text, and I want each of the equations to be enumerated as a composite number like equation (34.1) equation (34.2) equation (34.3) ...
conrado10000's user avatar
2 votes
2 answers
210 views

Matrices inside a matrix, with only text in the inner matrices

I want to draw a big matrix as an 8 by 8 to represent the combination of two HMMs. How do I go about it?
Cutie's user avatar
  • 45
0 votes
1 answer
34 views

Title over multicolumn array and side-by-side arrays

I want to add in a presentation (beamer) 4 multicolumn (4 columns each) arrays side-by-side and give a title over each array. What I tried for my article was this \documentclass[12pt]{extbook} \...
Νικολέτα Σεβαστού's user avatar
2 votes
2 answers
147 views

Table: combine fixed column width, \multicolumn, and text wrapping

I'm trying to create a sort of table which: a) is the same width as my text, b) has columns with predefined widths; c) has cells which span over multiple columns; and d) wraps text in these ...
Thomas Leibundgut's user avatar
1 vote
0 answers
26 views

Question concerning an error occurring only one time in two similar examples (tables/array and I cannot find the mistake) [duplicate]

I'd like to create a table, but I get the strange error "Missing $ inserted \end{frame}". Here is the code. See below for a similar example, where it worked. Unfortunately, I cannot find my ...
Bernhard Boehmler's user avatar
1 vote
1 answer
52 views

Why doesn't centered paragraph work inside table with tex4ht?

I am using the solution given in How to vertically-center the text of the cells? by Jimi Oke, which works well for me: If you also want to align all the cell contents toward the center in a ...
Nasser's user avatar
  • 20.3k
0 votes
0 answers
49 views

Nested systems of equations with left brace and referenceable sub-equations

I am trying to make a system of equations that contains a sub-system of equations. The equations should be numbered with arabic numbers (e.g. 1, 2, ...) and the sub-equations with a combination of ...
Neil Lamas's user avatar
0 votes
2 answers
64 views

Making array with increment in LaTeX

\documentclass{book} \begin{document} \edef\s{0,45,...,360} \s \end{document} In LaTeX, I don't know how to make an array start from 0 with increment 45 and end by 360. I try to make code ...
Ongky Denny Wijaya's user avatar
1 vote
1 answer
80 views

How to draw matrices with lines and side braces? [duplicate]

I want to generate something like in the figure below. I have currently the following but is not complete as you can observe. Any idea how to do this? \documentclass{article} \usepackage[utf8]{...
pixel's user avatar
  • 1,370
9 votes
2 answers
968 views

Is there an easier way to generate a multiplication table?

I am trying to find an easier way to generate randomised multiplication tables. I want to keep the formatting exactly as it is- with the table and the lines I have added- etc... Is there a more ...
user292225's user avatar
1 vote
1 answer
186 views

colortbl & dcolumn: Package array Error: Illegal pream-token (\tabpre): `c' used

While using the packages colortbl, dcolumn for the scenario described in MWE, I am getting the below error message: MWE: \documentclass{article} \usepackage{colortbl} \usepackage{dcolumn} \...
Kumaresh PS's user avatar
  • 1,267
3 votes
2 answers
210 views

Lines inside Array

I want to create a line inside an array (for a matrix), among which what I have created is as shown below. (I used \usepackage{hhline} and \usepackage{arydshln}) \[\small{\left [\begin{array}{cc|c} ...
Wildan B. W.'s user avatar
0 votes
2 answers
46 views

How to split complex alignments into multiple columns?

My document includes multiple recursive definitions. To increase readability, I split these definition into multiple (usually two) columns. To get more accurate alignments, I use array. Thus, ...
grbll's user avatar
  • 1
10 votes
2 answers
441 views

How to properly align two numbered equations?

I try to type two following equations: These equations are not subequations. First number 1 in (1.1) and (1.2) means chapter. My problem is that each part of these equations is centering. I can't ...
Sindzicat's user avatar
  • 143

1
2 3 4 5
22