New answers tagged

0 votes

make siunitx the decimal points alignment starts from the 3rd row of the table

Like this? As you see, numbers in third row are aligned at decimal pints, in the fourth row is centered. Last (second) column is of S type, defined in the siunitx package: \documentclass[margin=3mm, ...
user avatar
  • 255k
1 vote

Problem in designing a Triangular Array

Assuming you want the binomial coefficients, here is one way to do it. I changed: the tables formatting (it certainly can be written more compact, but this is safe) recalculated the numbers (unless I ...
user avatar
  • 1,796
0 votes

Align numbers in each column in a Summary Statistics table

I understand the numbers are too large and are pushed towards the left edge, which causes the undesired awkward alignment. S column type from the siunitx package apply number formatting similarly to D ...
user avatar
  • 829
4 votes

How to color the table in latex?

frabjous has provided a solution with nicematrix. For information, here is a way a bit shorter to create that tabular with nicematrix. \documentclass{article} % for color models \usepackage{xcolor} \...
user avatar
  • 25.5k
0 votes

Changing the format of the label to refer tables in the same section

This is what I get, if I comment your \input{...} running pdflatex and up-to-date TL2022
user avatar
  • 12.9k
6 votes
Accepted

How to color the table in latex?

There's the colortbl package, but with \clines, I recommend either the NiceTabular environment from the nicematrix package, or using the similar facilities of the tabularray package. With nicematrix: \...
user avatar
  • 36.8k
1 vote

Bold row in table aligned with dcolumn

I use this: \newsavebox\CBox \def\mathBF#1{\sbox\CBox{#1}\resizebox{\wd\CBox}{\ht\CBox}{\ensuremath{\mathbf{#1}}}} \newcommand{\best}[1]{\mathBF{#1}} % for table And then in the table, just \best{1....
user avatar
  • 2,467
0 votes

How do you center parbox vertically in a table

This uses the [valign=...] feature of adjustbos/graphicx. \documentclass[twocolumn,a4paper]{article} \usepackage[export]{adjustbox} \usepackage{graphicx} \usepackage{booktabs} \begin{document} \...
user avatar
  • 70.2k
2 votes
Accepted

Table contents not centered in SI table format with uncertainty

It looks like you want table-parse-only, e.g. \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \begin{document} \begin{table}[htbp] \caption{Some caption.} \label{tab:MyTab} ...
user avatar
  • 243k
1 vote

How to center the column label in a table?

For your table you can use tabularray package with libraries amsmath, booktabs and siunitx. for numbers in table written as exponent I guess that they are intendent for table notes, therefore in the ...
user avatar
  • 255k
1 vote

How do you center parbox vertically in a table

Like this? we haven't any information used documentclass and about your document layout, so please always provide MWE (Minimal Working Example), a small complete document, which contain now mised ...
user avatar
  • 255k
1 vote
Accepted

Where to include stargazer table resizing?

i'm afraid I'm not familiar with stargazer. LaTeX and some external packages -- specifically, dcolumn and booktabs -- let you create plenty-good-looking tables on their own. To achieve an overall ...
user avatar
  • 439k
1 vote

Vertical positioning of cell content inside a tabular environment (top-alignment)

I would use tabularray package and not nested tabular in cell: \documentclass{article} \usepackage{microtype} \usepackage{tabularray} \UseTblrLibrary{booktabs} \usepackage{pdflscape} \begin{document} ...
user avatar
  • 255k
3 votes
Accepted

Vertical positioning of cell content inside a tabular environment (top-alignment)

When you have multiple cells in the same row, where one of the cells has multiple lines and the others a single line, what determines the vertical placement of the single line cells relative to the ...
user avatar
  • 36.8k
2 votes
Accepted

Longtable caption shifted by increased \arraystretch (line spacing)?

This is not surprising, as with longtable, the caption is typeset as a row in the table, so the \arraystretch is also applied to it. A possible solution could be to shift the caption upward with a \...
user avatar
0 votes

write bengali and english text in a single line

For this, you can use pdflatex_bengali based on the bangtex package. Quickstart Guide Put the mf folder along with all its contents in the same directory as your LaTeX source code. Put the ...
user avatar
  • 111
0 votes

Creating table that I can modify column size and use multiple pages

I'd like to suggest that you employ an xltabular environment. An xltabular is very much like a longtable, except that one can use the X column type defined by tabularx environment. I would also like ...
user avatar
  • 439k
1 vote
Accepted

Creating table that I can modify column size and use multiple pages

There a couple options, but in 2022 I recommend trying out the tabularray package's longtblr environment, which is quite powerful and customizable. See the package's extensive documentation for more. \...
user avatar
  • 36.8k
0 votes

How to divide page into 6 parts?

Use a tabular and a single table or figure environment. \documentclass{article} \usepackage{graphicx} \usepackage[export]{adjustbox} \usepackage{booktabs} \begin{document} \begin{table}[htp] \...
user avatar
  • 993k
0 votes

How can I reduce the spacing between columns in a table?

Here is how you can do that tabular with {NiceTabular} of nicematrix. \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{table}[ht] \setlength{\tabcolsep}{4pt} \renewcommand{\...
user avatar
  • 25.5k
1 vote

Add specific lines connecting the cells to a table

Here is a solution with {NiceTabular} of nicematrix. The lines are drawn with Tikz by using the PGF/Tikz nodes created by nicematrix under the cells, rows and columns of the array. \documentclass[12pt,...
user avatar
  • 25.5k
0 votes

How to divide page into 6 parts?

An option to flexibility and accurately align objects is using the package tikz (in three steps). As a first step you define six nodes as \node (<name>) {<object>};, where <object> ...
user avatar
0 votes

How can I reduce the spacing between columns in a table?

After five years ... Now is available table package tabularray which for defining of column separation define colsep option. In comparison with "classic" table's code is shorter and text in ...
user avatar
  • 255k
0 votes

How can I reduce the spacing between columns in a table?

I can't remember where I found this (edits with a reference are welcome), but adding the following directly before your \begin{tabular} statement can allow you to adjust the column spacing by a given ...
user avatar
0 votes

How to divide page into 6 parts?

There might be a package that solves this problem more easily than using minipages or any other tab-related constructs. I am not aware of such a package. In following answer I assumed you would have ...
user avatar
  • 829
4 votes
Accepted

LaTex: Table numbering begins at 2

longtable implements its own captioning command, which allows the table number and caption be printed on every page. To make this work longtable increments the table counter. (Try putting a table ...
user avatar
1 vote
Accepted

Problems about creating tables

This solution uses the package nicematrix. The \Block{nrows-ncols}{<content>} command acts as a multi-row/multi-column combination, centering the content. Added optional cell-space-limits ...
user avatar
2 votes

Problems about creating tables

Your problems can be solved width use of the tabularray package Two cases of your table design: Without vertical line: \documentclass{article} \usepackage{tabularray} \UseTblrLibrary{booktabs} \...
user avatar
  • 255k
3 votes

Generate tabular data dynamically including `\hline`

Here is a LaTeX3 version without tikz: \documentclass{article} \ExplSyntaxOn \cs_new:Npn \my_print_row:n #1 { \tl_set:Nn \l_tmpa_tl {#1} \regex_replace_all:nnN {(.+)/(.+)} {\c{textbf}{\1} &...
user avatar
  • 2,928
3 votes
Accepted

Change font size according to text length inside tabularray cell

You may try to use \tcboxfit command from tcolorbox package. I am not so familiar with this package and some code in the following answer is copied from this answer. \documentclass[11pt]{article} \...
user avatar
  • 8,650
3 votes
Accepted

Generate tabular data dynamically including `\hline`

Add \noexpand before \hline. \documentclass{article} \usepackage{etoolbox} \usepackage{tikz} \makeatletter \newcommand{\myTable}[1]{% \def\tabledata{}% reset \tabledata \foreach \lhs/\rhs in {#...
user avatar
  • 4,443
5 votes
Accepted

Splitting a wide table by columns into two tables but with same table number and name

You may achieve your formatting objective by loading the caption package and issuing a \ContinuedFloat directive after starting the second table environment (and before issuing the associated \caption ...
user avatar
  • 439k
2 votes

How to use new line command while using multicolumn in tabular?

Like this? With talltblr defined by the tabularray package: \documentclass{article} \usepackage{tabularray} \begin{document} \begin{talltblr}[ caption = {Overview of statistic. Diff.: Differened}, ...
user avatar
  • 255k
0 votes
Accepted

Missing column border due to multirow

This has nothing to do with \multirow. Try \begin{tabular}{|c|c|} \hline 1 & 2 \\ 3 \\ \hline \end{tabular} to get The number of & separators should be always consistent, if you want the ...
user avatar
  • 993k
0 votes

Missing column border due to multirow

You should be consistent in writing ampersands in table. In the second row is mised one on the end. This two rows should be: \hline \multirow{2}{*}{\textbf{Modello}} & \multicolumn{5}{c|}{...
user avatar
  • 255k
0 votes

Why is my date not aligned and floating in the table column?

For your table are missed some important info0rmation as used documentclass page layout and if you really need long table (from code fragment this is not evident. Also it is not clear, why you nested ...
user avatar
  • 255k
1 vote
Accepted

Why is my date not aligned and floating in the table column?

First, you could load pdflscape package and use its landscape environment, which essentially rotates the content and let the table fit the page. You could also add some extra space. As the first ...
user avatar
  • 829
1 vote
Accepted

Fix the table size

The right column is too wide, obviously; the most obvious solution would be to use a column specifier that allows for line wrapping. Without packages you could use p{3.2in} or similar instead of l, ...
user avatar
  • 36.8k
2 votes
Accepted

How to fit a table to textheight by automatically adjusting arraystretch

Here is a solution with tabularray package and three remarks: the \textheight is so small that the page can not include 28 rows, so you need to decrease document font size first. there are some ...
user avatar
  • 8,650
2 votes
Accepted

Problem in showing partial derivatives in a table

Here is a solution, without equation numbers, with the esdiff package: \documentclass{article} \usepackage{amsmath} \usepackage{esdiff} \usepackage{array, booktabs} \begin{...
user avatar
  • 261k
1 vote

Table creation with multirow

Is this what you would like? \documentclass{article} \usepackage{array,multirow} \usepackage{caption} \begin{document} \begin{center} \begin{tabular}{ |p{2cm}|p{3cm}|p{1cm}|p{2cm}| } \...
user avatar
  • 131
3 votes
Accepted

Table creation with multirow

You can't use \centering inside a table like that (or if you do it will only work locally). If you want the columns centered, you need to add that to the colspec. The character # is special in LaTeX ...
user avatar
  • 36.8k
1 vote

How to draw tables with correct column widths and correct centering of multicolumn items?

The main issue with both tabular environments is that you've set the column widths to 2em, which is simply much too narrow. In the following, I've switched your sample code from using tabular to array ...
user avatar
  • 439k
0 votes

How to draw tables with correct column widths and correct centering of multicolumn items?

You're overcomplicating things, and I'm not quite sure why. You can center the ω's just by using a multicolumn spanning the 2nd and 3rd column. Since this is all in math mode, using an array makes ...
user avatar
  • 36.8k
1 vote

Table in landscape is not coming in center

Your document example is not comple, it is just fragment in which are missed documentclass, then packages which define sidewaystable and \checkmark. Adding missed packages table is centered on page ...
user avatar
  • 255k
1 vote

Stop and start multicols in the same page with unbalanced columns

If only the divider between two columns is the problem you are having with longtable, then we can surely control it. Have a look at this: \documentclass[9pt]{scrartcl} \usepackage[cmyk]{xcolor} \...
user avatar
  • 2,248
1 vote
Accepted

How to center merged cells vertically in a table and stretch the merged border to cover all of the cell?

It can be done with multirow, and completing the number of empty cells ; \documentclass{article} \usepackage[table]{xcolor} \usepackage{multirow} \usepackage{float} \definecolor{...
user avatar
  • 261k
6 votes
Accepted

Change the font inside `tabular` globally, in LaTeX Beamer (metropolis)

Like this: Edit: After reading your comments below, your question is not entirely clear, what all are your problems. Anyway, please one problem per question. Now I add one possible solution for option ...
user avatar
  • 255k
0 votes

Add caption for table designed by tabularray

Can anyone tell me if you can format the title of the tables in a longtblr environment? It turns out that I want the separation between the table number and the description to be a line break, that is ...
user avatar
  • 1
1 vote
Accepted

Text in the table are not justifying in a specific cell

Like this? \documentclass[journal]{IEEEtran} \usepackage{xcolor} \usepackage{multirow, tabularx} \newcolumntype{Y}[1]{>{\hsize=#1\hsize\linewidth=\hsize% \hspace{0pt}}X} \...
user avatar
  • 255k

Top 50 recent answers are included