# Tag Info

## New answers tagged tables

1

The standard way is dividing \footnote{} into 2 parts: putting \footnotemark inside a table and \footnotetext{} outside it.

0

I assume you want to have a non-floating float object: \begin{SCtable}[\sidecaptionrelwidth][h] \sidecaptionrelwidth is the default for the first optional parameter, which must be given in order to set the second optional argument. Example with Right side to the right side of the tabular with stars: \documentclass[12pt]{article} ...

1

You can do something like this: \documentclass{article} \newcommand\textalign[2][]{% \ifx#1l\relax \makebox[0pt][l]{#2}% \else \ifx#1r\relax \makebox[0pt][r]{#2}% \else \ifx#1c\relax \makebox[0pt][c]{#2}% \fi\fi\fi } \begin{document} \noindent \hrulefill \begin{tabbing} \=\hspace*{.5\linewidth}\=\hspace{.5\linewidth}\=\kill \\ ...

4

Here is a datatool implementation that reads a CSV table, sorts it and constructs the visual representation via a tabularx: \documentclass{article} \usepackage{datatool,filecontents,tabularx,booktabs} \begin{document} \begin{filecontents*}{term-log.csv} %termID , description , logten GO:0000502, proteasome complex ...

3

I use Ben Jann's estout suite of commands: http://repec.org/bocode/e/estout/ . Very well documented, and very flexible. It has commands that makes LaTeX tables from Stata output (not only regression results, also matrices, summary stats etc ), but it allows you to append/prepend text to lines (eg \addlinespace or cmidrule from the booktabs package), which ...

4

I copied the \mergesort macro from OPmac macro package for sorting. You can try this: \documentclass{article} \long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} \def\sdef#1{\expandafter\def\csname#1\endcsname} \def\removeiilist{\gdef\iilist{}} \def\mergesort #1#2,#3{% by Miroslav Olsak \ifx,#1% % ...

0

Reset the footnote counter at every use of \section, whether it's \section or \section*: \documentclass{article} \usepackage{xparse} \let\oldsection\section \RenewDocumentCommand{\section}{s o m}{% \setcounter{footnote}{0}% Reset footnote counter \IfBooleanTF{#1} {\oldsection*{#3}% \section*[..]{...} \addcontentsline{toc}{section}{#3}} ...

0

You can try \stepcounter{section}\addtocounter{section}{-1} \documentclass[11pt,a5paper,oneside]{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \makeatletter \@addtoreset{footnote}{section} \makeatother \begin{document} \section*{section A} \addcontentsline{toc}{section}{Section A} Lorem ipsum dolor sit amet.\footnote{Ut enim ad minim ...

0

As described in comment, there was a % sign missing. This is not an expected behaviour for sure. The author of labels is writing about some wrong space fix for the address labels which use tabular as well. Maybe this was the very same issue. Should get fixed so please consider reporting this. % arara: pdflatex \documentclass[9pt]{article} ...

7

I propose to use the ltablex package, which combines the possibilities of tabularx and longtable. In short the table can break across pages if necessary. I supposed the \newpage commands were attempts to have the table appear were you wanted, so I took the liberty to rmove them. Also I replaced your programmers' quotes with typographical quotes. Hopefully ...

8

table environments cannot break across pages. Your table (which consists of a caption and a tabular environment, with the right-hand column "only" 7cm wide, forcing quite a few of the lines to "wrap") is too tall to fit on the page that already contains a section header and two paragraphs. The best LaTeX can do, then, is to place the table on a page all by ...

0

After examining Gonzalo Medina's excellent answer, I realized there was a simple mistake I was making that prevented the double \hline from working. I needed to move it into the tabular environment \documentclass{article} \begin{document} \begin{table} \caption{Title} \begin{tabular}{lc} %These two lines are switched \hline \hline %These two lines ...

2

You should consider not changing any of the layout when submitting a paper. If tables should float to the top based on the conference paper class, then so-be-it. However, you can force the floating behaviour of the table environment to stop based on the following two approaches: Use the float package and the accompanying [H] float specifier. ...

2

It doesn't work to use tabularx with no X columns, but I wouldn't use tabularx here. This is still a bit wide but not knowing the language I can't really abbreviate any more. \documentclass[fontsize=12pt,paper=letter,headings=small,bibliography=totoc,DIV=12,headsepline=true,titlepage=on]{scrartcl} \usepackage{soul} ...

3

One option is to use the caption package to define a ruled style (adjust the settings to suit): \documentclass{article} \usepackage{caption} \DeclareCaptionFormat{ruled}{ #1#2#3\par\vspace{-.65\baselineskip}\hrulefill\par\vspace{-.83\baselineskip}\hrulefill} \captionsetup[table]{format=ruled} \begin{document} \begin{table} \centering \caption{Title} ...

1

An implementation with expl3: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentEnvironment{itabular}{O{c}m}% 'implicit' tabular {% 1. change the meaning of \thead, \tbody, \tr and \td % actually \thead and \tbody are the same, while \tr and \td are just markers \cs_set_eq:NN \thead \itabular_tbody:n \cs_set_eq:NN \tbody ...

1

You can hide some columns on one page and other on the other page: \documentclass{book} \usepackage{array} \newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}} \begin{document} \begin{table}\centering \caption{Table part 1} \newcolumntype{\somecolumns}{llllllHHHHH} \begin{tabular}{\somecolumns} & 1 & 2 & 3 & 4 & 5 & 6 ...

0

Here are basic building blocks. Frankly, it's a whole lot easier letting tabularx do all the work. \documentclass[12pt,a4paper,BCOR5mm]{scrbook} \usepackage{xcolor}% loaded by colortbl \usepackage{graphicx}% loaded by rotating \definecolor{Gray}{gray}{0.9} \fboxsep=0pt \begin{document} How to create a box of a given width (1em) with a colored ...

3

Put the caption inside threeparttable \documentclass[a4paper,11pt,oneside,openany,showtrims,strict,extrafontsizes]{memoir} \usepackage{tabulary,lipsum,threeparttable} \usepackage[font=small,labelfont=sc]{caption} \begin{document} \tableofcontents \newpage \listoffigures \chapter{Chapter one starts here} \section{Heading} \lipsum[4] \begin{table}[htb] ...

2

If you don't have headers, then you should dispatch that during the table reading. Then you can use the [index] notation for unnamed columns. Otherwise, the parser thinks that there is a column named 0. \documentclass{article} \usepackage{pgfplotstable} \begin{document} \pgfplotstableread[header=false]{ a 0.70 b 0.58 }\mytable ...

4

Here is a version that keeps the dynamic X columns using ltablex. Don't use tabu as there is no further support for the package. \documentclass[12pt,a4paper,BCOR5mm]{scrbook} %Tabellen & Listen \usepackage{booktabs} \usepackage{multirow} \usepackage{ltablex} \usepackage{rotating} \usepackage{colortbl} \usepackage{ragged2e} %% to allow hyphenation with ...

3

Define the first column to be a m column like \newcolumntype{O}{>{\small}m{1.6cm}} BTW, why you are using longtabu when just longtable would do the job? Also, there is no support to tabu package as claimed by its author. \documentclass[12pt,a4paper,BCOR5mm]{scrbook} \usepackage{booktabs} \usepackage{multirow} \usepackage{longtable} \usepackage{tabu} ...

3

The additional space forced between the lines seems problematic. It works better if you change \arraystretch instead. However, this causes the text in the left-most column to be overwritten by the colour of the next row. This can be avoided by setting the text in the next row with the number of rows passed to \multirow given as a negative, rather than ...

3

No idea why tabu doesn't shrink that column, but this makes your table fit: \begin{longtabu}{>{\small}p{1.6cm}*{22}{WG}W}

0

A solution non generalized with array, xcolor. The problem that i have encountered is centering "Bar1" any one has a best way of centering is invited to correct it. Code \documentclass[margin=2mm]{standalone} \usepackage{array} \usepackage[table]{xcolor} \newlength{\len} \settowidth{\len}{Bar1} \def\mylen{\dimexpr -0.2\len -2\tabcolsep} ...

10

This is straightforward using TikZ: The code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,calc,backgrounds} \definecolor{mybrown}{RGB}{33,34,28} \definecolor{myyellow}{RGB}{242,226,149} \definecolor{mygreen}{RGB}{176,232,145} \definecolor{myblue}{RGB}{61,139,189} \definecolor{myorange}{RGB}{245,156,74} ...

0

Maybe something like this? \documentclass[12pt]{article} \usepackage{array} \usepackage{boldline} \usepackage[x11names, table]{xcolor} \begin{document} {\setlength\fboxsep{-0.6pt}\setlength\fboxrule{1pt} \setlength\arrayrulewidth{0.6pt}\arrayrulecolor{LightSteelBlue3} ...

1

Something like this \documentclass{article} \begin{document} \renewcommand{\arraystretch}{3} \begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|p{3cm}|} \hline A & \multicolumn{2}{|l|}{B} & C \\ \hline D & E & F & G \\ \hline \end{tabular} \end{document}

3

Is this what you're looking to generate? \documentclass{article} \begin{document} \begin{tabular}{|l|l|l|l|} \hline A & \multicolumn{2}{l|}{B} & C\\ \hline D & E & F & G\\ \hline \end{tabular} \end{document}

2

The issue is nothing to do with siunitx or with tabularx: it's your use of \tableheadline. You've defined that to include a \multicolumn as well as a case change, then put additional header material after it (\si{eV}). That text is then 'dangling' and not properly handled by the alignment. If you want to keep \tableheadline with the current definition then ...

5

You don't need tabularx, but the stock tabular*. I just abbreviated “Estados Unidos” into “EUA” so to better fit the table in the available space. Note that non numerical input in S columns should be braced; in this way, siunitx will not try and interpret the text as a number, which is the reason for the error message in the “Exportaciones” cell. ...

4

First of all in order to answer your question (fix your error): You have used some non-numerical cell in an S column. It should read (or begin with) "e". Just put this cell into curly braces. Now in general and for your table: Do not use tabularx with numerical data. As your table is too big for the \linewidth, just reduce the width manually. This would ...

1

\displaystyle solves the problem: \begin{tabular}{ll} Text explanation in the left column. Math on the right. & $\displaystyle\int_0^1 \sum\limits_z$ \\ \end{tabular}

9

The other answers have already pointed out that you weren't using TeX's math mode for symbols such as \le ("less than or equal"). In addition to fixing these issues, and to replacing text-mode symbols such as \textless and \textgreater with their math-mode equivalents (< and >), you should also give consideration to using an array environment ...

4

With helo of package array you can significantly simplify your table code: \documentclass[twocolumn]{article} \usepackage{blindtext} \usepackage{array,amsmath} \begin{document} \begin{table*}[htbp] \centering %\begin{threeparttable} \caption{Summary of a state-based EMS} \begin{tabular}{l|c|>{$}c<{$}|>{$}c<{$}} \hline Battery ...

3

You have consistently placed in the text mode symbols (commands) only to be used in mathmode. Corrected below \documentclass[twocolumn]{article} \usepackage{blindtext} \begin{document} \begin{table*}[htbp] \centering %\begin{threeparttable} \caption{Summary of a state-based EMS} \begin{tabular}{l|c|c|c}\hline Battery SOC & State & Load Power & ...

3

It is my impression that almost all people strongly dislike having to crane their necks to read rotated material -- including header cells of a table. Fortunately, there's no need to make your readers crane their necks: Just transpose the table's rows and columns. \documentclass{article} \usepackage{float} \usepackage{booktabs} \usepackage{caption} ...

2

I suggest another approach: the details for initialisation in brackets can be put a table notes, with the threeparttable package. Then we can adjust the table to \linewidth with tabularx, and using the makecell package, colmumn heads accept line breaks: \documentclass{article} \usepackage{float} \usepackage{booktabs} \usepackage{caption} ...

1

Just replace the first column (c in your case) by some fixed width column like p, m or b. The width of that column is set just behind that specifier. As you did not give an MWE (especially the definition of \rot), I had to guess around a bit. I hope, I got what you want. % arara: pdflatex \documentclass{article} \usepackage{float} \usepackage{booktabs} ...

2

Building on @LaRiFaRi's observation that it's possible (and highly advisable) to remove a lot of repeated material, here's an even farther reaching reorganization of your table. It can be displayed in portrait mode. \documentclass{article} \usepackage{booktabs,caption} \begin{document} \begin{table} \centering \caption{My caption} \label{tab:my-label} ...

2

You have to redesign your table. Right now, you are repeating a lot of stuff. If this is really the final layout of your tabular, you could just do: % arara: pdflatex \documentclass{article} \usepackage{booktabs} \usepackage{multirow} \usepackage{caption} \usepackage{rotating} \usepackage{siunitx} \begin{document} \begin{sidewaystable} ...

0

You can get that by minimizing margins and font size, here we use \tiny. \documentclass{article}% \usepackage[margin=5mm]{geometry} \usepackage{booktabs} \usepackage{multirow} \renewcommand{\arraystretch}{0.8} \begin{document}% \begin{table}[h] \centering\tiny \caption{My caption} \label{my-label} \begin{tabular}{@{}llllll@{}} \toprule ...

2

I'd suggest using a full tabular-like implementation - using tabularx - to set that part of the CV construction. Also, to avoid using a list and set the content as rows inside your table... it's not that difficult to maintain this way, and provides you with the control you want inside such a rigid structure. % ...

2

While the class IEEEtran defines \def\tablename{TABLE} the package babel (rather, the language-specific file english.ldf) re-defines it back to \def\tablename{Table} Adding (thanks to egreg for the suggestion) \addto\captionsenglish{\renewcommand*{\tablename}{TABLE}} in the preamble after \usepackage{babel} should fix it.

6

It is a known problem that row colors doesn't work with longtable: However, \rowcolor in front of individual rows runs nicely. Added: There is a problem using booktabs with rwcolor(s): as it adds some vertical padding around its rules, there appears white strips that may be unwanted. In such a case I propose another solution, based on the boldline and ...

0

By nesting tables I can do essentially what I had in mind. Here is the code I came up with (simplified somewhat from the above) : \documentclass[11pt]{article} \usepackage{array} \newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}} \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}} ...

3

When giving a presentation, do try to anticipate what the audience is supposed to take away from your talk. What do you want the members to remember ten minutes after the talk ends, let alone two days, or two weeks, after the talk has ended? Do you think there's any chance at all that they'll remember the contents of the full table? If the chance of this ...

3

For one-off cells you can always use a \multicolumn command such as \multicolumn{1}{c}{\bfseries \num{11111.11}} This can be packaged in to a macro \tbnum for convenience: \newcommand{\tbnum}[1]{\multicolumn{1}{c}{\bfseries \num{#1}}} \documentclass{article} \usepackage{etoolbox,siunitx} \robustify\bfseries ...

2

The reason why the "Short" headers don't look like they're centered properly is that the instruction \multicolumn{2}{c}{Short} centers the string over two columns that are defined as @{\hskip 0.25in}r@{\hskip 0.05in}r To get the correct centering of the "Short" headers, you need to write \multicolumn{2}{@{}c@{\hskip0.25in}}{Short} The problem with ...

4

You have to describe the structure of the csv file to pgfplotstable. And you have subscripts in your column/row names that you need to take care of. I've just removed them. \documentclass{scrreprt} \usepackage{pgfplotstable,booktabs} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% You don't need this part % I did it to create your file ...

Top 50 recent answers are included