Tag Info

New answers tagged tables

0

The table is considered as a tikzpicture. \documentclass{article} \usepackage{tikz} \begin{document} \begin{table}[t] \centering %\caption{Some table} \label{tab:example} \begin{tikzpicture}[xscale=3.5,yscale=1.2] \draw (0,1) node{Results} +(180:1) node[right]{Criterion} ++(0:1)--+(0:.25)--+(180:.25) +(90:.2) node{Country} +(-90:.2) node{AU}; \fill[yellow,...

1

This type of tabulars are very easy to build in cals. As you will see, no white lines in the gray, all rules equally visible: \documentclass{article} \usepackage{cals, caption, xcolor} \let\nc=\nullcell % CALS Shortcuts for spanning cells \let\sc=\spancontent \begin{document} \begin{table}[!htbp] \begin{calstable}[c] % Centred CALS tabular % ...

0

It's quite complicated. For whole table, we may use \foreach to shorten TikZ code. \documentclass{article} \usepackage{tikz} \begin{document} \begin{table} \centering \begin{tikzpicture}[xscale=1,yscale=.5] \path[every node/.style={left=-11pt}] (0,0) node{196} (0,-1) node{8} (0,-2) node{73} (1,0) node{6} (1,-1) node{74} (1,-2) node{111} (2,0) node[...

3

You can use the [t] option for aligned, the p column type, and a small adjustment with \raisebox so that the top side of the figure be aligned a little higher than the base line: \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath,array,calc,tikz} \begin{document} \noindent \textbf{Determine the average rate of change ...

2

I don't think that, typographically speaking, it's appropriate to use an aligned environment here. Instead, I believe one should use nested enumerate environments. \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath,calc,tikz} \usepackage[shortlabels]{enumitem} \setlist[enumerate,1]{nosep} \setlist[enumerate,2]{label=\alph*....

2

Maybe the following can serve as a starting point: \documentclass{article} \usepackage{caption,booktabs,array} \usepackage[flushleft]{threeparttable} \newcommand{\rowgroup}[1]{\hspace{-1em}#1} \usepackage{dcolumn} \usepackage{geometry} \geometry{ a4paper, total={170mm,257mm}, left=20mm, top=20mm, } \newcolumntype{L}{D{.}{.}{1,6}} \...

0

The answer is, use pos=h instead of h or ht directly.

1

I use pure TikZ for this. \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture}[xscale=2,yscale=.8] \path (0,1) node[right]{Left} (0,0) node[right]{1} (0,-1) node[right]{123} (0,-2) node[right]{12345} (1,1) node{Center} (1,0) node{234} (1,-1) node{45678} (1,-2) node{1} (2,1) node[left=0]{Right} (2,0) node[left=0]{6789} (...

0

You are getting a ! Misplaced \noalign because, after full expansion, there may be no remaining tokens between the TeX primitives \cr, which is used in \\, and \noalign, which is used in the \*rule macros. Tokens that disappear during the expansion, like \if, are fine. But \only cannot be fully expandable because it needs to keep track of how many overlays ...

0

Here is an approach using the sagetex package, found here. I've put all the output on one page for illustrative purposes. Adding \newpage in the appropriate places will give the effect you've asked for: \documentclass{article} \usepackage{sagetex} \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry} \usepackage{fancyhdr} \usepackage{multicol} \...

1

for fun ... with amsmath, amssymb and makecell: \documentclass[a4paper, french, 12pt]{article} \usepackage{amsmath, amssymb} \usepackage{xcolor} \usepackage{array, booktabs, makecell} \usepackage[margin=0.5in]{geometry} \renewcommand{\thesection}{\Roman{section})} \title{\textsc{\fbox{Rappel de trigonométrie}}} \date{} \begin{document} \thispagestyle{...

0

The following MWE that was achieved with a combination of siunitx, rotating and makecell might serve as a starting point: \documentclass{memoir} \usepackage{makecell} \usepackage{rotating} \usepackage{siunitx} \sisetup{table-align-text-post = false} \begin{document} \settowidth\rotheadsize{\theadfont Some Text} \begin{tabular}{|S[table-format=2]|| ...

1

I would do something like this: \documentclass[a4paper, french, 12pt]{article} \usepackage{amsfonts} \usepackage{indentfirst} \usepackage{xcolor} \usepackage{array} \usepackage{booktabs} \usepackage[margin=0.5in]{geometry} \newcommand{\mystrut}{\rule[-16pt]{0pt}{38pt}} \title{\textsc{\fbox{Rappel de trigonométrie}}} \date{} \begin{document} \...

6

You're not using the threeparttable environment correctly: You should place the \caption statement inside rather than outside the threeparttable environment. That way, the caption's width will be restricted automatically to that of the tabular environment. More generally, the three formal parts of a threeparttable environment are the \caption directive, the ...

0

You can add backslash \\ in the caption: \documentclass{article} \usepackage{caption,booktabs,array} \usepackage[flushleft]{threeparttable} \newcommand{\rowgroup}[1]{\hspace{-1em}#1} \usepackage{geometry} \geometry{ a4paper, total={170mm,257mm}, left=20mm, top=20mm, } \usepackage[width=.75\textwidth]{caption} ...

3

A simple solution is just add minipage into your tags, e.g., \documentclass{article} \usepackage{caption,booktabs,array} \usepackage[flushleft]{threeparttable} \newcommand{\rowgroup}[1]{\hspace{-1em}#1} \usepackage{geometry} \geometry{ a4paper, total={170mm,257mm}, left=20mm, top=20mm, } \begin{document} \pagenumbering{gobble} \begin{table} ...

1

Since you have full control per cell in a calstable, the package cals is well suited for such type of tabulars. To centre text vertically in a cell, you just issue the commands \vfil inside the cell. Here is an MWE for the tabular in question: \documentclass{article} \usepackage{cals, caption, xcolor} \let\nc=\nullcell % CALS Shortcuts \...

1


2

Like this? It is quite close to what you show in your image ... \documentclass{article} \usepackage{makecell} \usepackage{tikz} \usetikzlibrary{tikzmark} \begin{document} \begin{table}[th] \setcellgapes{5pt} \makegapedcells \centering% \scriptsize \caption{Group A.}\label{group} \begin{tikzpicture}[font=\sffamily\bfseries] \draw[->] (0,0) -...

2

A tabular perfectly suited for cals: \documentclass{article} \usepackage{cals, caption} \let\nc=\nullcell % CALS Shortcuts \let\sc=\spancontent \begin{document} \begin{table}[th] \caption{Group A.}\label{group} \begin{calstable}[c] % Left aligned CALS tabular % Calculate the column width \colwidths{{\...

0

\documentclass{article} \usepackage{makecell, multirow} \begin{document} \begin{table}[th] \setcellgapes{3pt} \makegapedcells \centering% \scriptsize \caption{Group A.}\label{group} \begin{tabular}{|*{8}{c|}} \cline{3-8} \multicolumn{2}{c|}{} & \multicolumn{3}{c|}{AA} & \multicolumn{3}{c|}{BB} ...

3

I guess that you looking for the following table: \documentclass{article} \usepackage{makecell, multirow} \begin{document} \begin{table}[th] \setcellgapes{3pt} \makegapedcells \centering% \scriptsize \caption{Group A.}\label{group} \begin{tabular}{|*{8}{c|}} \cline{3-8} \multicolumn{2}{c|}{} & \multicolumn{3}{c|}{AA} ...

0

As suggested by @Fran in her comment, you can publish your table directly to pdf using knitr. The following MWE provides a demonstration of formatting the table using the R packages, xtable and kableExtra. You can do this by integrating chunks of R code in your .tex file, in which case your code can be saved in a .Rnw file. You can compile this .Rnw file ...

3

When I augment your code to make it compilable, I get the following error message -- which isn't quite the same as the one you reported in your query: ! Package caption Error: right undefined. See the caption package documentation for explanation. Type H <return> for immediate help. ... l.117 \begin{...

1

Your table cells are not vertically centered because \extrarowheight seems to be added at the top of the rows. To compensate that, you can either use \\[...pt] instead ot \\ or go for the cellspace package: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{array} \usepackage{multirow} \usepackage{cellspace} \setlength\cellspacetoplimit{10pt} \...

1

In order to make your code compile into a pdf document, you can add the documentclass stadalone as well as the booktabs package (as you used \toprule, \midrule and \bottomrule from this package): \documentclass{standalone} \usepackage{booktabs} \begin{document} \begin{tabular}{rlrrrrrl} \toprule & model & CFPs & model\_size & number\_of\...

1

In your MWE (Minimal Working Example) you load package subfigure, which is obsolete and also not define environment subfloat. For it you nit to load subfig (observe difference in package's name). You should not load both packages!. Try the following MWE: \documentclass[preprint]{elsarticle} \usepackage{subfig} % <--- missed package, it is not ...

3

You tabular is wider than the linewidth and therefore overflows the right margin. You have to take into consideration the tabcolsep added between the columns when you calculate the column width. Your tabular is \linewidth wide, but since you have five columns, only \linewidth-10 tabcolsep available to text. Since I have used @{} to remove left and right side ...

1

It seems that you want to number the tables out of order. That is a strange requirement but simply avoid using latex's automatic numbering, either by not using \caption or by using the unnumbered \caption* and then add numbers by hand as part of the caption text. \documentclass{article} \usepackage{caption,booktabs} \setcounter{totalnumber}{5} \begin{...

1

you can redefine mem@listoftables, e.g. using pdffilesize to test for emptiness of \jobname.lot, see answer to "Checking whether a file is empty?". Commment out the table to see also the list of tables disappear. \documentclass[12pt]{memoir} \def\firstoftwo#1#2{#1} \def\secondoftwo#1#2{#2} \def\iffileexist#1{% \expandafter\ifx\expandafter&\...

1

Since you said any packages, here is a solution using cals: \documentclass{article} \usepackage{cals, caption} \let\nc=\nullcell % Shortcuts \let\sc=\spancontent \begin{document} \begin{table*} \caption{MWE} \footnotesize \begin{calstable}[c] % Defining columns relative to each other and relative to the margins \colwidths{...

1

With siunitx and p{...} column type for \multicolumn{2}{..}{...}: \documentclass{article} \usepackage{siunitx} \usepackage{booktabs} \begin{document} \begin{table}[t] \sisetup{input-symbols = (), table-column-width=13mm, table-format=-1.3} \caption{MWE} \centering \begin{tabular}{l SS} \...

2

I tried to compile your code by adding a document preamble, but it is to many error in the code. You are using the booktabs-package and toprule midrule etc. Neither rowcolor nor cellcolor will colourise the extra space booktabs provides above and below of the rules. Also, it is documented in the manual that toprule and friends are not compatible with ...

4

The default location for floats is not called location but default. \setupfloat[table][default={here,split}]

1

You should change the preamble l*{4}{d{3.3}} and put ccd{3.3}d{3.3} and you will have the following result. In ccd{3.3}d{3.3}, the two first c are for the two first columns centered and the two d{3.3} are for the other columns (alignment on the decimal point).

1

Here is a solution, with some improvements (in particular, loading the caption package yields a more sensible spacing between caption table). Note the d column type is really useful only in the third column. \documentclass{article} \usepackage{dcolumn,booktabs, caption} \newcolumntype{d}[1]{D{.}{.}{#1}} \newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy ...

2

The problem is that there are hooks missing at the begin of cells, so it is difficult with the standard columns types. With new columntypes it can be done e.g. like this: \documentclass{memoir} \usepackage[table]{xcolor} \usepackage{xparse} \usepackage{array} \ExplSyntaxOn \tl_new:N\g__bob_tabcellhook \newcolumntype{\bobl}{>{\g__bob_tabcellhook}l} \...

1

The following code saves the column styles with column widths: \Preamble{xhtml} \catcode`\:=11 \Configure{tabular} {\ifvmode \IgnorePar\fi \EndP \halignTB{tabular}% \putVBorder % } {\HCode{</table:table>}} {\ifTag{vis-\TableNo-\HRow}% {\special{t4ht@[}\gdef\end:box{\special{t4ht@]}}}% {\global\let\end:box\empty}% % \...

1

In your code are several issues, for example You can simply use \usepackage graphicx instead yours \ifCLASSINFOpdf \usepackage[pdftex]{graphicx} % \graphicspath{{../pdf/}{../jpeg/}} % \DeclareGraphicsExtensions{.pdf,.jpeg,.png} \else \usepackage[dvips]{graphicx} % \graphicspath{{../eps/}} % \DeclareGraphicsExtensions{.eps} \fi because that ...

2

I would write column headers in two lines. In such a case, your table can be fit in one column: In above table I use tabularx for table environment, booktabs for rules in table and siunitx for columns with numbers (which are now aligned at decimal points). \documentclass[12pt,journal,compsoc]{IEEEtran} \usepackage{booktabs, tabularx} \...

3

It is also possible to build these tabulars using cals and one calstable. By defining shortcuts for removing cell border, it is convinient to remove the necessary borders around the cells. Of cause, sub-labels are ordinary text, so it is not possible to refer to subtable 1(c). If you prefer more narrow table, just increase the the divisor when calculating ...

4

I suggest you load the subcaption package, which provides an environment called subtable. To (more or less) replicate the structure shown in the screenshot you posted, you could set up three subtable environments, each with its own \caption, inside the overall table environment. In the code below, each subtable contains two tabular environments. \...

0

With siunitx (it works for me) and makecell: \documentclass{article} \usepackage{booktabs, makecell} \usepackage{siunitx} \begin{document} \begin{table} \sisetup{input-symbols = ()} \centering \begin{tabular}{l S[table-format=2.7] S[table-format=4.2]} \toprule & {\makecell{First column}} & {\...

2

I'd investigate why siunitx doesn't work. Anyway, you can use dcolumn. \documentclass{article} \usepackage{dcolumn,booktabs} \begin{document} \begin{table} \centering \begin{tabular}{l D{.}{.}{2.7} D{.}{.}{4.2} } \toprule & \multicolumn{1}{c}{First column} & \multicolumn{1}{c}{Second column} \\ \midrule Variable Name & 98.1234567 & ...

0

This is an old question, but I found it while searching for an answer to an identical one. Anyway, an easy method would be to use the positioning argument of the parbox, pos. For example, you could align two parboxes like this: \parbox[t]{.2\textwidth}{ ... } \parbox[t]{.2\textwidth}{ ... }

0

Only using one column and splitting the first row manually will avoid this problem: \documentclass{article} \usepackage{lipsum} \begin{document} \begin{tabular}{|p{4.5cm}|} \begin{tabular}{@{}ll@{}} Some text & some more text\\ \end{tabular}\\ \hline \lipsum[4]\\ \end{tabular} \end{document}

0

Take a look at siunitxpackage but this could be out of topic... So, a manual fix could be to ad an \hspace{} command with a distance selected after tests to every element of the first raw you wish to center: \documentclass{article} \begin{document} \begin{table} \begin{tabular}{lr@{}lr@{}l} \hline & \multicolumn{2}{c}{...

1

You shouldn't use \adjustbox with tables to avoid inconsistent font sizes. I propose to use a smaller font size, reduce the intercolumn spacing and load geometry to have more decent margins (if you do not use marginal notes). I added some improvements and code simplification, with the makecell, siunitx and chemformula packages. Multirow is not needed. \...

Top 50 recent answers are included