10 votes
Accepted

Get rid of extra white space inserted when using \verb with tabularx

You can use \Verb from fancyvrb, but with the better definition provided by fvextra. \documentclass{article} \usepackage{tabularx} \usepackage{fvextra} \begin{document} \Verb|tabular| \noindent \...
egreg's user avatar
  • 1.1m
8 votes
Accepted

Problem with table - \tabular vs \tabularx

Unlike the tabular* and tabularx environments, the tabular environment does not take a target width as one of its arguments. And, while employing the line-drawing macros of the booktabs package, one ...
Mico's user avatar
  • 496k
7 votes
Accepted

Generate simple table (with foreach?)

\foreach cannot straddle table cells. Here's a version that works. \documentclass[letterpaper,oneside]{article} \usepackage{array} \ExplSyntaxOn \NewDocumentCommand{\makerows}{mm} {% #1 = number of ...
egreg's user avatar
  • 1.1m
7 votes

How do I make this table better looking?

I'd like to suggest that you start by getting rid of all vertical rules and most horizontal rules. Next, use the macros \toprule, \midrule, \addlinespace, and \bottomrule instead of \hline, as is done ...
Mico's user avatar
  • 496k
7 votes

font color does not work in front of S column of `siunitx`

Switching from tabularx to the more adaptable tabularray solved the problem neatly. The transformed code is: \documentclass[varwidth, margin=10pt]{standalone} \usepackage[utf8]{inputenc} \usepackage[...
alchemist's user avatar
  • 1,761
6 votes

Custom table with tabularx and multicolumns and multirows

I have a working (not perfect) code that done this output: The code: \documentclass{article} \usepackage{graphicx} \usepackage[export]{adjustbox} \usepackage{tabularx} % in the preamble \usepackage{...
Raffaele Santoro's user avatar
6 votes

LNCS: Large table in sidewaystable

You'll need to insert line breaks in almost all header cells. Since most of the headers appear to be acronyms, it's best to force the line breaks by hand; see the code below for how this may be done. ...
Mico's user avatar
  • 496k
6 votes

LNCS: Large table in sidewaystable

No sidewaystable if you avoid lengthy repetition. \documentclass[runningheads]{llncs} \usepackage{booktabs,siunitx} \begin{document} \title{Paper Title Here ... } \begin{table}[htp] \caption{...
egreg's user avatar
  • 1.1m
6 votes

How to draw \hline which does not cross a cell gotten by merged ones?

As mentioned @Teepeemm in his comment, instead of \hlines you should use \cline{2-3}. Or instead of tabular table use tblr of tabularray package: \documentclass[margin=3mm,varwidth]{standalone} \...
Zarko's user avatar
  • 294k
6 votes

font color does not work in front of S column of `siunitx`

First of all, I think a problem of your code is that you place the $\times$ inside a \savebox which essentially prevents the contents from being affected by \color settings outside of this box. I ...
Jasper Habicht's user avatar
6 votes
Accepted

column widths when using multicolumn

You defined 4 columns but your table has only 3. \documentclass{article} \usepackage[margin=2cm,a4paper]{geometry} % set page parameters suitably \usepackage[T1]{fontenc} \usepackage[english]{babel} \...
CarLaTeX's user avatar
  • 61.5k
6 votes
Accepted

What should the table do when using multicolumn multiple times?

There are two syntax errors in your code. To get rid of them, you need to remove the & particle from \multicolumn{3}{c}{D} &\\ not alternate between \cline directives and column contents. ...
Mico's user avatar
  • 496k
6 votes
Accepted

tabularx - column width multicolumn

The issue is that while you define the table to have four columns with automatic, i.e., residually determined, widths, you currently don't provide enough information for LaTeX to be able to determine ...
Mico's user avatar
  • 496k
5 votes

Custom table with tabularx and multicolumns and multirows

This works: \documentclass{article} \usepackage{graphicx} \usepackage[export]{adjustbox} \usepackage{tabularx} % in the preamble \usepackage{multirow} \usepackage{geometry} \geometry{ a4paper, %...
Rmano's user avatar
  • 39.4k
5 votes
Accepted

Table row to fill entire page

A solution using nicematrix, probably a bit complicated. It uses TikZ to measure the height of a row which is relatively easy, because the package adds TikZ coordinate to the cells. This way, you can ...
Jasper Habicht's user avatar
5 votes
Accepted

Custom table with tabularx and multicolumns and multirows

tabularx table should has at least one column of X or from it derived type if some columns should have different width, you can define ratios between them or write some columns as p{<width>} or ...
Zarko's user avatar
  • 294k
5 votes
Accepted

Table Cell colors have white gaps between them

A solution using the tabularray package (Q[co=1] is synonym for the X column type): \documentclass{article} \usepackage{geometry} \usepackage{xcolor, tabularray} \UseTblrLibrary{siunitx} \begin{...
Jasper Habicht's user avatar
5 votes

Table Cell colors have white gaps between them

Here's slightly altered version of your code based on colortblr. Notice, I have loaded hhline package to avoid a problem with \cline. \documentclass{article} \usepackage{geometry} \usepackage{array,...
Celdor's user avatar
  • 8,818
5 votes

Table Cell colors have white gaps between them

Here is a solution with {NiceTabular} of nicematrix. You need several compilations. You won't see thin white lines, whatever PDF you use, whatever level of zoom. \documentclass{article} \usepackage{...
F. Pantigny's user avatar
  • 38.6k
5 votes
Accepted

Table with height an exact multiple of constant

Here's another example based on saved boxes--the way to obtained the current height of multiple multi lined paragraphs. I have used a little different approach to build a long table based on longtblr ...
Celdor's user avatar
  • 8,818
5 votes

Two large figures side by side

This uses a combination of saveboxes and \parboxes. The captions are placed in \parboxes to control the width (minipages will do just as well). The \nulls prevent \abovecaptionskip from geing ...
John Kormylo's user avatar
  • 78.1k
5 votes

tabularx and multicolumn: column width is not correct

You asked, Am I doing something wrong? Short answer: Yes. Slightly longer answer: Your tabularx environment contains too many mutually conflicting pieces of information; the result is a mess that ...
Mico's user avatar
  • 496k
5 votes

Need to expand table to fit hsize

You really need to stop engaging in so much visual formatting. Do yourself a favor and take the time to learn how to use the \ce macro, which is provided by the mhchem package, to typeset chemical ...
Mico's user avatar
  • 496k
4 votes

Table row to fill entire page

This uses a savebox to measure the tabular without the notes, then uses a strut (\ruie{0pt}{...}) instead of \vspace. \documentclass[]{article} \usepackage{tabularx} \usepackage{showframe} \newlength{...
John Kormylo's user avatar
  • 78.1k
4 votes

Table row to fill entire page

you could combine with tcolorbox and draw some of the lines with overlay (here the dotted line): \documentclass[addpoints,12pt,a4paper,dvipsnames]{exam} \usepackage{setspace} \usepackage{lipsum} \...
Ulrike Fischer's user avatar
4 votes

Custom table with tabularx and multicolumns and multirows

tabularx provides X-type column, which adapts its width to the table. I would additionally suggest to define a custom column e.g. Y to avoid unnecessary repetition \newcolumntype{Y}{>{\centering\...
Celdor's user avatar
  • 8,818
4 votes
Accepted

How to make the width of the columns in the table equal?

Like this? Edit: In your MWE are not present contents of lower part of table, so in the following example considers only data in the upper part of table. The screenshot shows that the numbers in the ...
Zarko's user avatar
  • 294k
4 votes
Accepted

Text not vertically aligned in tabularx cell

I'm afraid that ghsystem should be updated, because with TeX Live 2022 (but also 2021) it tries to do \chemmacros_load_module:n {nomenclature} but chemmacros in its most recent versions uses \...
egreg's user avatar
  • 1.1m
4 votes

Auto alignment parentheses in LaTeX tabular

The output is not messy if you enlarge the \baselineskip register. For example: \def\crl{\crcr\noalign{\medskip\hrule\medskip}} \vbox{\baselineskip=17pt \halign{&\ \hfil$#$\hfil\ \cr\crl \rm ...
wipet's user avatar
  • 72.3k
4 votes

How to draw \hline which does not cross a cell gotten by merged ones?

With {NiceTabular} of nicematrix. \documentclass[margin=3mm,varwidth]{standalone} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}{ccc}[hvlines] col1 & col2 & col3 \\ \...
F. Pantigny's user avatar
  • 38.6k

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