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}
...
6
votes
Add more vertical space in a table row
Updated: use dmath mode.
\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
\begin{tblr}
{
colspec = {Q[c,m]Q[c,m]},
hlines,vlines,
row{1} = {bg=green},
cells = {...
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}
\...
5
votes
Accepted
Cline not working
With tabularray:
\documentclass{article}
\usepackage{xcolor}
\usepackage{etoolbox}
\usepackage{tabularray}
\makeatletter
\ExplSyntaxOn % https://tex.stackexchange.com/questions/629708
\pretocmd{\@...
5
votes
Accepted
Vertical align text in tabular
You may achieve your formatting objective by getting rid of the \multirow wrappers. I'd further like to suggest that you switch to a tabularx environment, so that you can get rid of the \resizebox ...
5
votes
Custom environment to create table-like matrix
Quite simple with tabularray:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tabularray}
\NewDocumentEnvironment{tabularmatrix}{+b}{
\begin{tblr}{
hlines, vlines, columns={c},
...
4
votes
Accepted
Table with text aligned at a specific point and setting specific row width
This should be close to what you're looking for.
The aligned subsidiary environment from amsmath works in horizontal mode. It requires a vertical positioning option to keep it in proper alignment ...
4
votes
Tables containing Young diagrams
I'd not use caged tables, see the second realization.
\documentclass[11pt]{article}
\usepackage[aligntableaux=center]{ytableau}
\usepackage{booktabs}
\usepackage{mathtools}
\usepackage{array}
\...
4
votes
(Challenge) Making a table with checklists and proper alignment
What about this as a start point? With some more work you can fix it as you like: alignment, spaces, lines ...
\documentclass[12pt]{article}
\usepackage{bbding} % for square definition
\usepackage[...
4
votes
Accepted
Using \NewDocumentCommand to redefine a table rule
You should use \NewExpandableDocumentCommand to define. As David said xparse is not needed unless you have an old latex release.
I also suggest you to use tabularray to typeset your table, it's easy ...
4
votes
Add more vertical space in a table row
With {NiceTabular} of nicematrix.
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{cc}[hvlines,colortbl-like,cell-space-limits=3pt]
\rowcolor{green} $x$ & $g(...
4
votes
Custom environment to create table-like matrix
If you don't need to nest arrays or other objects using \\, you can do it as follows. Any number of columns are accepted, as long as they're at most MaxMatrixCols, like for matrix in amsmath; increase ...
4
votes
Custom environment to create table-like matrix
Not exactly a solution since it doesn't use your preferred name for the environment, but you can use nicematrix. You must compile twice.
\documentclass{article}
\usepackage{nicematrix}
\begin{...
3
votes
Cline not working
The line generated with \cline is covered by the color of the cell. This is why it is not visible. A solution could be to use the hhline package, which would require a small adjustment in the row ...
3
votes
tabular multicolumn - weird cell size
With {NiceTabular} of nicematrix.
\documentclass{beamer}
\mode<presentation>{\usetheme{Madrid}}
\usepackage{nicematrix}
\begin{document}
\newcolumntype{C}{>{\columncolor{black}\color{white}}...
3
votes
Accepted
Horizontal and vertical centering in xltabular
To obtain vertical centering of the contents of the first column, you need to run \renewcommand\tabularxcolumn[1]{m{#1}}. This is explained on page 3 of the user guide of the tabularx package.
I would ...
3
votes
Horizontal and vertical centering in xltabular
\documentclass[12pt]{article}
\usepackage[letterpaper, left=3cm, right=2cm, top=3cm, bottom=2cm]{geometry}
\usepackage[spanish, es-tabla]{babel}
\usepackage{multirow, array}
\usepackage[document]{...
3
votes
Resizing the table
For the sake of completeness, here's a tabularx-based solution, with a target width of \textwidth.
\documentclass{article}
\usepackage[english]{babel}
\pagestyle{empty}
\usepackage[letterpaper,...
3
votes
Accepted
Resizing the table
You can set font size as \small and reduce the column sep. tabularray is easy to use.
\documentclass{article}
\pagestyle{empty}
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,...
3
votes
Accepted
Why is my number not showing up in scientific notation inside a 'S'-type column?
the first value in the last column is missing the scientific notation format that was included in the script.
This is happening because you've defined the last column to be formatted as S[table-...
3
votes
Tables containing Young diagrams
I just use the setting proposed by @samcarter_is_at_topanswers.xyz combined with tabularray.
\documentclass[epic,11pt]{article}
\usepackage[aligntableaux=center]{ytableau}
\usepackage{tabularray}
\...
3
votes
Accepted
(Challenge) Making a table with checklists and proper alignment
Regarding your reputation, you should know, that this site is not service we-will-do-your-task-instead-you, so you should show what you try
Question is not some challenge but rather simple table with ...
3
votes
Accepted
Add more vertical space in a table row
A variation of @clara answer, where is increased vertical space around cells contents for 5pt and and reorganized table preamble:
\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}
\...
3
votes
Accepted
Minimizing Extra Spaces in Exam Headers and possible improvements
Here are two different fixes:
The first (the recommended) is a single table using tabulary, multirow and array, and the other is your nested tabulars with the fixes of the comments, plus tabularx ...
3
votes
How to horizontally center p type columns in tabular?
We have Overfull hbox 2.15 too wide with p{0.1cm}.
I propose:
\setlength{\tabcolsep}{4pt} (6pt by default)
the packgage changepage to widen the margins for the table
The code
\documentclass{article}
...
3
votes
Accepted
How to horizontally center p type columns in tabular?
You not provide any information about page layout.
Column width of 0.1cm is far to small for content of cells, consequently it is spill out of this space (and cant be centered).
Table size is to ...
3
votes
Rectangular framing some relations
I suggest you place an aligned environment inside a \boxed directive.
\documentclass{article} % or some other suitable document class
\usepackage{amsmath} % for 'aligned' env. and '\boxed' and '\text'...
3
votes
Accepted
I do not understand the error. Is there a limit to the number variables in \foreach?
There's no problem with using 10 variables. The issue is \pgfmathparse{\groupmark+\markthree} receiving {} instead of a number.
With the following changes your code compiles fine:
\foreach \groupnum/\...
3
votes
How to make a table like this?
I removed the padding in the first tabular and put the caption in the remaining space. I figure you already have the \captionsetup, so there was no point trying to reproduce it.
For the second table ...
2
votes
How best to display an eventually periodic sequence in LaTeX
You can just input the first two rows and have automatically the changed items emphasized.
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
% eventually periodic
\NewDocumentCommand{\ep}{O{...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tables × 17209tabularx × 1284
horizontal-alignment × 1036
longtable × 1001
vertical-alignment × 894
multirow × 810
multicolumn × 771
spacing × 653
captions × 589
floats × 574
color × 532
formatting × 506
tikz-pgf × 474
siunitx × 433
columns × 352
booktabs × 350
graphics × 332
beamer × 327
macros × 282
rotating × 275
align × 249
width × 249
line-breaking × 220
math-mode × 214
positioning × 207