New answers tagged

3

The usual expansion problems with xstring, I'd say. But you're complicating things. The \clist_set:Nn function of expl3 purges empty items, so it's a straightforward application. \documentclass{article} \usepackage{xparse} \usepackage{xcolor} \ExplSyntaxOn \NewDocumentCommand{\SetArrayLength}{sm} { \IfBooleanTF{#1} {% star form: expect a control ...


2

Using the dcases environment inside a pmatrix: \documentclass{article} \usepackage{mathtools} \usepackage{eqparbox} \begin{document} \[ P = \begin{pmatrix*}[l] \begin{dcases} \eqmakebox[V][l]{$ p^{(1)}(x_1,x_2,\dots,x_{r_1}) $} \\ \eqmakebox[V]{$ \vdots $} \\ \eqmakebox[V][l]{$ p^{(m_1)}(x_1,x_2,\dots,x_{r_1}) $} \end{dcases} \\ ...


2

You need to nest array or matrix. \documentclass{article} \usepackage{mathtools} \begin{document} \begin{figure}[h] \centering \[ P = \left(\begin{array}{l} \left\{\begin{array}{l} p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\ \vdots \\ p^{(m_1)}(x_1,x_2,\cdots,x_{r_1}) \end{array}\right. \\ ...


4

An alternative to array could be using two variables in foreach. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[font=\sffamily] \foreach \color/\t [count=\k] in {red!90!black/foo, green!50!black/bar, blue!90!black/baz} { \node[color=\color] at ($(0,\k)$){\t}; } \end{tikzpicture} ...


4

See “array operator” in the TikZ/PGF manual, page 927 \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \newcommand{\myarray}{{"foo","bar","baz"}} \begin{tikzpicture}[font=\sffamily] \foreach\Color [count=\k] in {red!90!black, green!50!black, blue!90!black} { \node[color=\Color] at ...


2

With makecell and multirow, you have the first column horizontally centred by default (but it may be changed). The makecell package allows for a common formatting and linebreaks in table cells, with the thead,\makecell, \multirowthead,``multirowcell commands: \documentclass[10pt,oneside]{article} \usepackage[landscape, margin=0.2in, showframe]{geometry} ...


0

Using the multirow package : \multirow{8}[4]*{\textbf{Peter}}& the code : \documentclass[10pt,oneside]{article} \usepackage[landscape, margin=0.2in]{geometry} \usepackage{booktabs,array} \newlength{\cwidth} \setlength{\cwidth}{1.4in} \usepackage{multirow} \begin{document} \section{School Timetable} ...


1

As you requested here is a solution usind tikz-cd. It uses a custom labeling macro \cdlabel that throws out the current line of the diagram and generates a label named by the first argument. You can \ref it as usual. \documentclass{article} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{cd} \newcounter{cdrow} \newcommand\cdlabel[1]{% ...


5

You can use alignat (in which the rows get numbered by default) instead of array. \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{graphicx} \begin{document} \begin{alignat}{10} 1 & \longrightarrow & A & \longrightarrow & B \times C & \overset{\pi}\longrightarrow & D & \longrightarrow & 1 \phantom{\, ,} ...


1

Are you meaning something like this? \documentclass{amsart} %\usepackage{amsmath} % amsart loads amsmath \begin{document} \begin{equation*} \begin{cases} \begin{aligned} y - \frac{2}{k}x &\le 0 \\[1ex] \dfrac{1}{k}x - \dfrac{1}{2}y &\le -1 \end{aligned} \end{cases} \end{equation*} \end{document} Don't use align for single line ...


4

Some suggestions: Replace the \cline{3-4} directives with \cline{3-5} Replace & \multicolumn{2}{c}{Player $2$} & \multicolumn{1}{c}{} with & \multicolumn{3}{c}{Player $2$}, i.e., let Player $2$ span all three columns Replace \multirow{2}*{Player $1$} with Player $1$ and move the instruction down one row, to the row labelled "B". ...


3

array takes a mandatory argument. It would probably be much easier for you to write \sum_{\substack{a\geq1, ad=n \\ 0\leq b<d}} Full MWE: \documentclass[12pt]{amsart} \usepackage{fullpage} \usepackage{amsthm} \usepackage{array} \usepackage{tikz} \usetikzlibrary{matrix, arrows, decorations.pathmorphing} \usepackage{amsmath} \begin{document} ...


1

This answer is just to record a modification of the code in Bernard's helpful answer that produces behavior that I desired but which the original code does not entail. Replace the \begin{document} ... \end{document} code there with \begin{document} \[ \tractorQ{A}{BCDEFG}{H}{I} , \tractorQ{J}{K}{L}{M} \] \end{document} so that more than one instance ...



Top 50 recent answers are included