Hot answers tagged

7

(augmented the answer by a second-level "btr" itemize-like environment per the OP's request.) Rather than set up lots of individual tabular environments and create the itemized lists by hand, I suggest you employ the machinery of enumitem package, as is done below, to create two levels of a bespoke itemize-like list environment. \documentclass{...


5

I suggest you place all columns in automatic displaystyle math mode; this will save you from having to write lots and lots of $ characters. Also, use the dcases environment (provided by the mathtools package) instead of the home-brewed array environments. I would also left-align the columns. The following screenshot shows just the first few rows of the ...


4

EDIT: I have edited this answer, because, with the key hvlines-except-corners available in the lastest version of nicematrix (v 4.4 of 2020-06-30), it's easier. With {NiceTabular} of nicematrix you have tools to color cells, rows and columns and you can draw all the expected rules with one key hvlines-except-corners. You won't have artefacts in the PDF ...


3

\documentclass{article} \usepackage{amsmath} \begin{document} alignat \begin{alignat*}{3} -1 &< x && < 4 \\ -2 &< 2x&& < 8 & \qquad \text{multiply by 2} \\ \end{alignat*} \end{document}


3

This line corresponds to the small gap creatd by the \cline{2-6}. A solution uses \hhline, which accepts \arrayrulecolor commands for each of its segments, so we can use a full width \hhline, which has the colour of the background in its first part. We have a very thin negative \vskip to make the white segment completely disappear. I took the opportunity ...


3

The tabular* is clumped together on the left because it had a required total width of \textwidth, but the columns have no ability to stretch out to fill the width. The basic answer is to put \extracolsep{\fill} in the tabular declaration, but that makes its own different ugly result. The vertical lines give trouble in two ways: (1) The booktabs definitions ...


3

You don't really want a vertical rule: a space will serve as well, actually better. I propose three realizations of the table; the first is essentially the same as Mico's. I'd consider instead the second one, where the space is more evident; the third one is probably how I'd typeset it, without artificially enlarging the table. \documentclass[a4paper, 12 pt]{...


3

I used 4 columns but it doesn't work so I use what it work The reason why 4 columns don't work is because you start each row with a spurious & token -- in effect creating an all-blank first column (which is given type l). The solution? Get rid of the spurious & tokens. The following layout may be close to what you're looking to achieve -- well, ...


2

The following might serve as a place to start from: \documentclass[landscape]{article} \usepackage[left=2cm, right=2cm]{geometry} \usepackage{booktabs} \usepackage{amsmath} \usepackage{amssymb} \usepackage{multirow} \usepackage{longtable} \usepackage{array} \title{Distribuciones Discretas y Continuas} \author{Carlos V. Ramírez Ibáñez} \date{} \begin{...


2

With the environment {NiceTabular} of nicematrix (≥ 4.0 of 2020-05-08), you can draw whatever rule you want with Tikz by using the PGF/Tikz nodes created by nicematrix under the array. \documentclass{article} \usepackage{nicematrix,tikz} \begin{document} \tikzset { dashed 1/.style = { red , dash pattern = on 2pt off 3pt , ...


2

You need an expandable test as you can have no non-expandable tokens before \hline \documentclass[11pt,twoside]{article} \usepackage{xtab} \newif\iflineflag \newcommand{\oline}{\iflineflag\hline\fi}% \begin{document} \begin{xtabular} {p{1.0in}|p{2.0in}} first item & second item\\ third item & fourth item \end{xtabular} \vspace{0.3in} Now with ...


2

As starting point: \documentclass{article} \usepackage{geometry} \usepackage{microtype} \usepackage{ragged2e} \usepackage{booktabs, multirow, xltabular} \newcolumntype{L}{>{\RaggedRight}X} \begin{document} \footnotesize \setlength\tabcolsep{4pt} \begin{xltabular}{\linewidth}{@{} *{3}{ L} l @{}} \caption{My table caption here} \label{tab:table1}\\...


2

From the nicematrix manual: The idea of nicematrix is to create pgf nodes under the cells and the positions of the rules of the tabular created by array and to use these nodes to develop new features. As usual with pgf, the coordinates of these nodes are written in the .aux to be used on the next compilation and that’s why nicematrix may need several ...


2

To allow diagonal overlapping of the rotated headers, it's best to encase the \rotatebox directives in \rlap directives. \documentclass{article} \usepackage{graphicx,booktabs,amssymb} \newcommand\rot[1]{\rlap{\rotatebox{45}{#1}}} \newcommand\OK{$\checkmark$} \begin{document} \begin{table}[h] \setlength\tabcolsep{9pt} % default: 6pt \centering \begin{...


2

With the latest version of nicematrix (v 4.4 of 2020-06-30), it's easy: \documentclass{article} \usepackage{nicematrix} \usepackage{makecell} \begin{document} \begin{NiceTabular}{wC{5mm}CCCC}[hvlines-except-corners] & \;\diagbox{A}{B} & \makecell{C \\ D} & \makecell{ E \\ F} & \makecell{ G \\ longer} \\ \Block{4-1}{H1} & I & text 1 ...


1

A command \multicolumn must syntactically be at the beginning of the cell. It can't be preceded by a token such as \scriptsize. The reason is that \multicolumn is expanded in a list of tokens beginning by \omit and such an \omit (which means : omit the format of the column specified for the current cell) must always be syntactically at the beginning of the ...


1

The OP asked me to put my comments into an answer. Initially, I had suggested to add \allowbreak in the definition of \glom, immediately prior to the \ignorespaces. This had the effect of allowing a break between \glom and \gloss, but it did not prevent \glom from overrunning the margin. Also, it is not wholly clear if the OP really would like to permit a ...


1

You're going to have problems, with so wide items and so few line break points, so you should probably use flushleft: \documentclass[12pt]{article} \usepackage[a5paper,margin=25mm]{geometry} \newcommand\glom[2]{% \begin{tabular}[t]{@{}l@{}}\itshape#1-\\#2-\end{tabular}% \ignorespaces } \newcommand\gloss[2]{% \begin{tabular}[t]{@{}l@{}}\itshape#1\\#2\...


1

It is a bug. The code is wrong here, according to the pdf reference the BT operator must be closed before the mode is switched back, and it looks as if one also should save and restore the graphic state. But I don't see at first glance an easy fix. You could open an issue at the github. Manually something like this works. But better don't use this mode in ...


1

I suggest you employ a threeparttable environment, with its \tnote directives and tablenotes environment, to force the caption and the footnote material to occupy the same width as the tabular environment does. \documentclass{article} \usepackage{stackrel,array} \usepackage[flushleft,para]{threeparttable} \renewcommand{\TPTtagStyle}{\textit} % optional \...


1

\documentclass{article} \usepackage{makecell} \begin{document} \begin{table}[!h] \caption{Total times in second and number of sub-problems of Algorithm 1,2 and 3} \label{table2} \centering \begin{tabular}{|c|c|c|c|c|} \hline Name & Al & Cycle & TTs & NSP \\ \hline P1 & 1 & ...


1

No code provided so using a sample from this site -- How to make table with rotated table headers in LaTeX \documentclass{article} \usepackage{array,graphicx} \usepackage{booktabs} \usepackage{pifont} \newcommand*\rot{\rotatebox{60}} \newcommand*\OK{\ding{51}} \begin{document} \begin{table} \centering \begin{tabular}{@{} cl*{5}c @{}} & &...


1

First I'd recommend you to avoid the use of parbox since LaTeX already has a default option to create inner paragraphs in the tabular environment \begin{tabular}{p{6cm}|lll} \hline Column \#1 & Col \#2 & Col \#3 & Col \#4 \\ \hline In reviewing applicants, we consider both objective criteria, such as test scores, and subjective criteria, such as ...


1

With a combination of three top ailgned minipages with two or one tabularx and \raisebox in order to top align the tabularx environments: \documentclass{article} \usepackage[table]{xcolor} \usepackage[letterpaper, inner=16mm, outer=16mm, top=8mm, bottom=8mm]{geometry} \usepackage{tabularx} \usepackage{graphicx} \usepackage[scaled]{helvet} \renewcommand\...


1

The specific issue is that you need to load amsmath before amsthm. If you do that, the compilation will get far enough to tell you that you left out \begin{document} and \end{document}. It will then give you a very confusing error about \@@scl being undefined that turns out to trace back to giving xcolor an invalid HTML color code. The larger issue is that ...


Only top voted, non community-wiki answers of a minimum length are eligible