Hot answers tagged

12 votes

A curve line with label connecting two tabular cells with TikZ

You can do that with tikzmark library. I changed your macro \tc. Now it creates a node and takes three parameters (format, node name, content). Then I add a tikzpicture[remember picture,overlay] and ...
Juan Castaño's user avatar
11 votes
Accepted

How to calculate the total width of a (tabularray) table and pass this length to other packages such tikz or tcolorbox?

You could use the \settowidth macro to measure the width of your table. To avoid having to code the table twice, you could use a savebox and use it once to typeset your table and another time to ...
samcarter_is_at_topanswers.xyz's user avatar
11 votes
Accepted

How to make this table nicer

You ask how to make the table nicer. So remove all vertical rules that have no usefulness; use top alignment, there's no need for vertically center the entries; replace rules in the middle with ...
egreg's user avatar
  • 1.1m
10 votes
Accepted

A curve line with label connecting two tabular cells with TikZ

You can also use the nicematrix package that uses TikZ to draw the table and makes it thus quite easy to reference certain cells: \documentclass[border=12pt,varwidth]{standalone} \usepackage{...
Jasper Habicht's user avatar
10 votes
Accepted

How to make a table less cramped

My main advice for giving your table a less-cramped look is to get rid of all vertical rules and employ fewer, but well-spaced, horizontal rules. And, in order to make the table more readable, I'd ...
Mico's user avatar
  • 479k
9 votes
Accepted

LuaLaTeX - tabularx - Why does this table not fit on the previous page?

LaTeX limits the size of floats on a page. In particular the parameter \textfraction specifies the minimal amount of the page that is reserved for text (and hence, cannot be used by floats). Default ...
Pieter van Oostrum's user avatar
9 votes

How do I create a table with blank fields without lines

Here is a solution with {NiceTabular} of nicematrix. \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}[first-col,last-row,hvlines,corners]{cccccc} $z_1$ & \...
F. Pantigny's user avatar
  • 33.1k
9 votes

How to make a table less cramped

I would do something like this, with tabularray: \documentclass{article} \usepackage{geometry} \usepackage{tabularray} \UseTblrLibrary{amsmath} \UseTblrLibrary{siunitx} \NewColumnType{A}[1][1.4]{Q[ ...
CarLaTeX's user avatar
  • 60.5k
9 votes

How to make better looking tables for e.g. a publication?

My suggestions would be: Only use \multicolumn where it relly belongs. It hardly makes sence in your example to use it to span over just one single column (and I really wonder why so many people ...
Jasper Habicht's user avatar
9 votes
Accepted

LaTeX Table to Standalone?

I don't think that using a tabularx environment with two equally wide columns and some ensuing line-breaks in the first column generates a good layout. I'd go with a basic tabular environment, use l ...
Mico's user avatar
  • 479k
9 votes
Accepted

Automated Dijkstra Visualization

Here's the Dijkstra algorithm in TeX. It uses the PGFFor (the .list handler) and PGFMath (the \pgfmathloop) for looping: The .list handler gets used to store the weights of each edge and to do all ...
Qrrbrbirlbel's user avatar
9 votes

Call alternating row colors from within the table?

Like this (change colors and alignment as You like)? Code: \documentclass{article} \usepackage[table]{xcolor} \begin{document} \begin{center} \rowcolors{2}{gray!50}{white} ...
Raffaele Santoro's user avatar
8 votes
Accepted

How to label lines and columns of a matrix?

This is a job for nicematrix: \documentclass{article} \usepackage{amsmath} \usepackage{nicematrix} \begin{document} \[ \begin{pNiceMatrix}[first-col,first-row] & C & D \\ C & b-c & -...
egreg's user avatar
  • 1.1m
8 votes

Column line missing after "E"?

With "clasic" tabular table you can solve your problem as suggested in @koleygr comment, i.e. for multicolumn cell write \multicolumn{4}{c|}{E} since it overwrite right vertical line defined ...
Zarko's user avatar
  • 284k
8 votes
Accepted

Nicematrix package conflicts with babel

You need to turn the babel shorthand - off: \documentclass{article} \usepackage[czech]{babel} \usepackage{nicematrix} \begin{document} \begin{table}[h] \begin{center} \shorthandoff{-} ...
Joseph Wright's user avatar
  • 252k
8 votes
Accepted

How do I create a table with blank fields without lines

Here's a solution that gets by without using TikZ. Some remarks about how this code differs from yours: I use array instead of tabular, saving myself dozens of instances of having to enter the $ ...
Mico's user avatar
  • 479k
8 votes
Accepted

Formatting Chemfig inside of table

Don't fix the chemistry pictures. Instead, fix the horizontal lines, i.e., replace the basic \hline macro with the line-drawing macros of the booktabs package to get well-spaced horizontal rules. ...
Mico's user avatar
  • 479k
8 votes

Too much space between words in tables

You could use ragged right text alignment for your columns: \documentclass{article} \usepackage{array} \begin{document} \begin{center} \begin{tabular}{ | c | >{\raggedright}m{3.0cm}| >{\...
samcarter_is_at_topanswers.xyz's user avatar
8 votes

Problem with multicolumn table

With tabularray: \documentclass{article} \usepackage{tabularray} \UseTblrLibrary{amsmath} \newlength{\mylen} \settowidth{\mylen}{2} \newsavebox{\mysep} \sbox{\mysep}{\scriptsize\bfseries\textit{S}} \...
CarLaTeX's user avatar
  • 60.5k
8 votes
Accepted

Problem with multicolumn table

With {NiceArray} of nicematrix. \documentclass{article} \usepackage{nicematrix} \begin{document} $\begin{NiceArray}{c|c|c|c} \Block{1-2}{\scriptstyle S}& \Block{1-2}{\scriptstyle S} & \Block{...
F. Pantigny's user avatar
  • 33.1k
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
  • 479k
8 votes

LaTeX Table to Standalone?

As compliment to nice @Mico answer (+1), with use of the tabularray package, i.e. with its talltblr environment which is equivalent to classic threeparttable: \documentclass[border=3.141592]{...
Zarko's user avatar
  • 284k
8 votes

Why is a part of my table open?

To fill in the gaps in two of the four vertical lines, you need to change the line & \\ located immediately below the header line to & & & \\. Or, just delete this line. I would also ...
Mico's user avatar
  • 479k
8 votes
Accepted

Why is a part of my table open?

Beside use siunitx (omitted here in order to not mess the MWE) to fit the width of the whole table without headaches, consider use tabulary or tabularx (in this case, better the first) and on the ...
Fran's user avatar
  • 77.4k
8 votes
Accepted

Table with weird borders with the booktabs package

A solution with the tabularray package: \documentclass{beamer} \usepackage{tabularray} \begin{document} \frame{ \begin{tblr}{ colspec = { *{3}{c }}, hline{1} = {1}{2-3}{}, ...
Jasper Habicht's user avatar
8 votes
Accepted

Horizontal tabular borders and `\arrayrulecolor` in beamer

See this nice answer for a solution. The problem is that beamer redefines the macro \reset@color which is used to change the color for rules when using hhline together with colortbl. It is redefined, ...
Jasper Habicht's user avatar
7 votes
Accepted

Why are size of words in two tables not same?

For reasons best known to the designers of the IEEEtran document class, the contents of table environments are automatically rendered at \footnotesize -- for a 20% linear reduction in font size -- ...
Mico's user avatar
  • 479k
7 votes
Accepted

inserting Tikz diagrams into a table

This code will enter the tikzpicture(s) into a tabular. \documentclass{article} \usepackage{blindtext} \usepackage{tikz}% added <<<<<<<<<<<<<<<<< ...
Simon Dispa's user avatar
  • 37.1k
7 votes
Accepted

How can I make the vertical line of certain rows thicker in LaTeX tables?

don't use tabu. It is buggy and not maintained instead it I suggest to use (relative new) package tabularray using it you can define all horizontal as well vertical lines in table preamble. \...
Zarko's user avatar
  • 284k
7 votes
Accepted

Display colors and their names

You can use collcell. I made other adjustments to the table. \documentclass{article} \usepackage[table,dvipsnames,x11names]{xcolor} % colors with names \usepackage{booktabs} \usepackage{collcell} % ...
egreg's user avatar
  • 1.1m

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