New answers tagged

1

If you're just interested in spitting out some contents of a list, perhaps the following might be of interest: \documentclass{article} \usepackage{etoolbox} \newcommand{\listsep}{, } \makeatletter \newcommand{\@insertlistsep}{} \newcounter{@listname} \newcommand{\addtolist}[1]{% \stepcounter{@listname}% Add one person to counter ...


3

There are differents methods, here is one \documentclass{article} \usepackage{pgfmath,pgffor} \begin{document} \def\names{{"Katie","Frank","Laura","Joe"}}% \newcounter{lines}% \setcounter{lines}{1}% \newcommand*\arr{}% \newcommand{\mtadd}{% \ifx\arr\empty \edef\arr{\arabic{lines}} \else\edef\arr{\arr,\arabic{lines}} \fi} \mtadd \setcounter{lines}{3}% ...


2

You must move the "free variable" node ; arrow will automatically follow. \documentclass[11pt]{book} \usepackage{amsmath,amsfonts,amssymb,amsthm} \usepackage{xcolor} \definecolor{ocre}{RGB}{0,173,239} \usepackage{blkarray} \makeatletter \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{% \hskip -\arraycolsep \let\@ifnextchar\new@ifnextchar ...


3

\documentclass{article} \usepackage{delarray} \begin{document} \[ \begin{array}[t]\lbrack{c}\rbrack 1\\2\\3\end{array} + \begin{array}[t]\lbrack{c}\rbrack 1\\2\\3\\4\\5\end{array} \] \end{document}


0

You can maintain as many arrays (actually property lists) as you want, with a consistent interface with expl3. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn % 1. The user interface % 1a. \additem[<name>]{<text>} \NewDocumentCommand{\additem}{ O{default} m } { \ramiza_array_add:nnn { #1 } { } { #2 } } % 1b. ...


2

Use newtext#1 etc. rather than text#1 etc. in the second list. These are defining macro names. You want them to be unique or you'll overwrite the old definitions. Oh, and don't use \\ to break lines in ordinary contexts (outside tabular, array etc.). \documentclass{article} \usepackage{etoolbox} \newcounter{cnt} \newcommand\textlist{} ...


2

There's a bunch of errors in here. In my opinion, the frame environment is more failsafe. The matrix shouldn't be typeset in the frametitle and pmatrix should be used as well. The alignment of the figures is difficult, of course. \documentclass{beamer} \usepackage{mathtools} \begin{document} \begin{frame}{A title} \small %frametitle{... and the ...


3

You can specify the distance between the rows by adding the optional argument to the newline command as in: \\[2.5ex] \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{array} \pagestyle{empty} \begin{document} \begin{equation}\label{test} \newcolumntype{Y}{>\displaystyle c} \left|\frac{D(u,v)}{D(x,y)}\right|= \left| ...


1

As far as I can make out the intended result is \documentclass{article} \usepackage[T1]{fontenc} \usepackage{amsmath} \begin{document} \begin{equation} \begin{pmatrix} \mathrm{d}'\\ \mathrm{s}'\\ \mathrm{b}' \end{pmatrix} \end{equation} \end{document}


2

You are missing a set of braces and commas in your array. It should work if you write \def\myNotes{{{12,6,13,15},{16,11,15,13},{14,8,10,9},{16,13,10,5},{7,11,15,12}}} Also, you can directly set r with \pgfmathtruncatemacro{\r}{int(\myNotes[\y-1][\x-1])}


2

The row only appeared misaligned due to the non-symmetric rule added which had height but not depth. \documentclass[12pt]{report} \usepackage{array} \usepackage{amsmath} \begin{document} \begin{tabular}{| >{$}c<{$} | c | c | c | c | c | c |c |} \cline{2-8} \multicolumn{1}{c}{}&\multicolumn{7}{|c|}{\rule{0mm}{0.4cm}{figure1 put here}}\\ \hline ...


7

Here is the formal references that mentions this notation in the preamble construction of tabular or array: source2e (section 56.2 array and tabular environments, p 300) The PREAMBLE argument of an array or tabular environment can contain the following: l,r,c : indicate where entry is to be placed. | : for vertical rule @{EXP} : inserts the text EXP in ...


8

David Carlisle has already given a thorough answer as to what @{} and @{\quad} do. I'd like to add an observation regarding how the code for the array could have been set up more elegantly in the first place, in a way that would have avoided the need for the five [5!] instances of the @{} directive. Specifically, by inserting the instruction ...


16

On either side of each column of an array (or tabular) latex adds \arraycolsep) (or \tabcolsep for tabular) of whitespace, so normally there is 2\arraycolsep space between the columns. If you go @{hello} then instead of adding space between the columns latex inserts hello in each row. Sometimes you see forms such as r@{\mbox{--}}l which would make 2 & ...


1

I can offer you an expl3 interface: \documentclass{article} \usepackage[table]{xcolor} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\NewArray}{mm} { \seq_new:c { g_aloui_array_#1_seq } \seq_set_from_clist:cn { g_aloui_array_#1_seq } { #2 } } \NewDocumentCommand{\PrintArray}{mmmm} {% #1 = array name, #2 = treshold, #3 = lower color, #4 = ...


4

To get both separators to span the full height of the array, you need to replace the code in the first and third row of the array, viz. \\ with & & \\ Actually, adding a single & symbol to row, viz. & \\ works too. \documentclass{article} \begin{document} \[ A = \left ( \begin{array}{c|c|c} & & \\ C_1 & \cdots & ...


3

It would be better to use an environment designed for aligning displayed equations such as align from amsmath (which would set the display in display math mode and put the right space around the =. array is designed for matrices and sets its content in inline math mode and is not optimised for aligning a single equation. \begin{array}{rcl} means a three ...



Top 50 recent answers are included