Hot answers tagged

114 votes

Column and row padding in tables

This is an old question, but I've run into the same problem, and all these solutions seemed too complex for my needs, namely in respect to horizontal padding. Looking for a rapid solution similar to ...
s1l3n0's user avatar
  • 1,241
56 votes

Adding space between columns in a table

If you need to adjust the spacing for just one table you could also add/remove some space before the table and restore previous value after it: \addtolength{\tabcolsep}{-1pt} \begin{tabular}{cc} ...
Pietro C's user avatar
  • 1,404
45 votes

How does the \newcolumntype command work?

The array package documentation, on pages 2 and 3 has the explanations: Additional explanation To answer your specific question: \newcolumntype{Y}{>{\small\raggedright\arraybackslash}X} defines ...
Gonzalo Medina's user avatar
35 votes
Accepted

Vertical centering of all columns in \tabularx environment

It seems that addition of \renewcommand\tabularxcolumn[1]{m{#1}}% for vertical centering text in X column in your preamble is what you looking for: \documentclass{article} \usepackage{geometry} \...
Zarko's user avatar
  • 283k
27 votes

Split itemize into multiple columns

Use multicol. If your items do not divide evenly into each column, add \item[\vspace{\fill}] to the end of your list to align the items. The multicol package solution from AboAmmar works well if your ...
ning's user avatar
  • 431
24 votes
Accepted

How to put 6 images in 3 columns-2 rows?

One more suggestion: make figure content centered with use of \centering between sub figures insert \hfil purpose of \quad is not clear, let remove it centering of subfigure content is surplus. ...
Zarko's user avatar
  • 283k
23 votes
Accepted

beamer: \only and lstlisting do not work together

Verbatim material in an argument is problematic. Use the onlyenv environment instead: \documentclass{beamer} \usepackage[utf8x]{inputenc} \usepackage{listings} \begin{document} \begin{frame}[fragile]...
Gonzalo Medina's user avatar
16 votes

Decrease page margins

Indeed, as suggested in the coments, done. \usepackage[left=1.5cm, right=2cm]{geometry}
asdf's user avatar
  • 454
16 votes
Accepted

Specifying minimal (not fixed) width in tabular

See ADDENDUM and BONUS First, the original approach. Here is a \newcolumntype solution, except that, for a reason that I should know but I don't, it won't work in the last column of the tabular. I'...
Steven B. Segletes's user avatar
15 votes
Accepted

How to uncover a table column wise in Latex beamer

The following seems to do what you're asking for, after adding array to the preamble: \documentclass{beamer} \usepackage{array} \begin{document} \begin{frame} \begin{tabular}{ccccc<{\onslide<...
Werner's user avatar
  • 588k
14 votes
Accepted

How can I convince texcount that my use of \newcolumntype is perfectly valid syntax?

Tell texcount to ignore the preamble: %TC:ignore \documentclass{article} \usepackage{array} \newcolumntype{C}{>{$}c<{$}} %TC:endignore \begin{document} \begin{tabular}{C} x\\ \end{tabular} \...
egreg's user avatar
  • 1.1m
13 votes

Creating two columns in beamer

Also note that the graphics need not be scaled down as much in the second column. The column becomes a minipage, so \textwidth is already adjusted to its width. \documentclass[demo]{beamer} \begin{...
Miklós Koren's user avatar
13 votes

Specifying minimal (not fixed) width in tabular

This could be done by placing a row of 0pt \rules with a negative row separator (for proper vertical alignment). In the example, columns 1 and 2 have minimum width 2cm, while columns 3 and 4 have ...
Sandy G's user avatar
  • 35.6k
12 votes

How to add line separators between columns in Latex table?

Using vertical lines to provide visual structure to an otherwise little-organized table is a decidedly unsatisfactory way to go. Instead of using vertical rules, do organize the header material more ...
Mico's user avatar
  • 478k
11 votes

Creating two columns in beamer

The "columns" feature of Beamer (other answers above) lets you customize the layout and the breaking point. However if you want to let the text flow or you don't care about the exact layout, ...
alfC's user avatar
  • 14.1k
11 votes
Accepted

Applying a command to a whole column spawning "\ignorespaces"

Usually, LaTeX adds \ignorespaces at the begin of a cell and \unskip at its end to automatically remove spaces at the begin and end of the cell contents. The example loads package collcell, but does ...
Heiko Oberdiek's user avatar
11 votes
Accepted

What does '>' do when used in the context of columns?

>{stuff} Just inserts stuff at the start of the cell so if the column is >{stuff}p{3cm} then it works as if the column was p{3cm} but every cell in that column started with stuff. it is often ...
David Carlisle's user avatar
10 votes
Accepted

Beamer - diagrams of boxed text

You are right, with tikz is more simple to drawn your relations: \documentclass[aspectratio=169]{beamer} \usepackage{lmodern} \usepackage{tikz} \usetheme{Boadilla} \usepackage[overlay]{textpos} \...
Zarko's user avatar
  • 283k
9 votes

Column and row padding in tables

I needed it for only one specific table and instead of changing how it works through the entirety of document I found that doing the following suited my needs: \begin{table} \centering {\def\...
Zeliax's user avatar
  • 191
9 votes
Accepted

Three columns for only part of the page

I think three minipages are enough: \documentclass{article} \usepackage[margin=1in]{geometry} % set margins to 1 inch \begin{document} \begin{center} {\Huge DaimyoKirby}\par\bigskip \begin{minipage}...
Gonzalo Medina's user avatar
9 votes
Accepted

Space between columns in a tabular

@{} removes the intercolumn space replacing it by whatever is between the braces. So nothing in your example but try ll@{\hspace{1cm}}lll
David Carlisle's user avatar
9 votes

How to split the text into two columns that both have a different width?

A simple minipage solution might be more suitable in your case if you don't require page breaks (you didn't mention this as a requirement in your question), otherwise you can have a look at the ...
Troy's user avatar
  • 13.6k
8 votes

Dealing with very long table - split into columns?

I used minipage and vdots and got the effect I wanted: \documentclass[11pt]{article} \usepackage{booktabs} \begin{document} \begin{table} \caption{Your Caption} \begin{minipage}{0.5\textwidth} \...
Charles Clayton's user avatar
8 votes

How do I draw a vertical dotted line separating two columns?

Here is a solution \documentclass[twocolumn]{memoir} \usepackage{xpatch} \usepackage{graphicx} \makeatletter \xpatchcmd{\@outputdblcol}{\vrule\@width\columnseprule}{\rotatebox{90}{\parbox{\...
touhami's user avatar
  • 19.3k
8 votes

How can I convince texcount that my use of \newcolumntype is perfectly valid syntax?

My preferred solution would be to do away with word counts, which are more or less meaningless, but failing that, since it doesn't like the {} you can remove them. This gives no warnings (but doesn't ...
David Carlisle's user avatar
8 votes
Accepted

How to add line separators between columns in Latex table?

just place the separator char in the tabular column definition: cc|ccc|cccc
Timothy Truckle's user avatar
8 votes
Accepted

Beamer center vertical alignment of two columns

It seems itemize inserts some spacing above the environment, just as center does. A fix for the example you've provided is to put the figure in a center environment. \documentclass{beamer} \begin{...
erik's user avatar
  • 12.5k
8 votes
Accepted

Force table column to be zero width

You have to use a box of 0pt width for this cell with 2. Also, you need to add @{\hspace{-.5\arrayrulewidth}} and @{\hspace{-.5\arrayrulewidth}} around this column specification. The reason for the ...
AboAmmar's user avatar
  • 45.8k
8 votes

How to format an entire column in math mode using \mathrm

Use a specialized package for chemistry, for instance mhchem, that also eases input. Together with collcell you get what you want. \documentclass{article} \usepackage{booktabs} \usepackage[version=4]{...
egreg's user avatar
  • 1.1m

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