# Tag Info

## New answers tagged tables

7

How about something like this: \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{array} \usepackage{xcolor} \def\mybar#1{%% #1s & {\color{red}\rule{#1cm}{8pt}}} \pagestyle{empty} \begin{document} \begin{tabular}{>{$\rhd$ }lrl} Loop at line 151 in divergence & \mybar{3.420}\\ Loop at line 1071 in radiation & ...

0

Some bad example for tables, but nice to show the floating around of table at the 'wrong' position. \documentclass{article} \usepackage{caption} \begin{document} \appendix \begin{center} \begin{tabular}{ll} \hline A & B \tabularnewline \hline C & D \tabularnewline \hline A & B \tabularnewline \hline C & D \tabularnewline \hline A & B ...

3


0

I would argue that adding a little bit of vertical whitespace after every second numeric row -- so that information about coefficient estimates and standard errors is grouped visually -- is only one of several layout challenges you face. Three additional objectives, in my opinion, should be (i) aligning the numbers on their decimal points, (ii) typesetting ...

1

You have several options: Insert a blank line The simplest is to insert a blank line into your table in the place where you want to increase the spacing: \begin{table} \begin{tabular}{l c c c c} & Mod1 & Mod2 & Mod3 & Mod4 \\ & b/se & b/se & ...

0

Thank you all for your suggestions. I think I should be good adjusting it now. Thank you very much once again for your time and patience. I learned a few new commands and tools, so I am very greatful!

0

(This is sort of a summary and extension of comments.) Installing First, I'll note that the code you posted compiles without error on my system (recently updated TeX Live 2013 on Kubuntu) with either LuaTeX or XeTeX. If your system cannot find the fonts, then either they are not part of the TeX Live version that is in the Ubuntu repositories, or you ...

4

Use a minipage for the tabular. However, your tabuloar is too wide and, of course, you shouldn't use too many lines. Without it it makes it more readable: \documentclass[12pt,a4paper]{article} \usepackage{amsmath,amsthm,amsfonts,latexsym,amscd,amssymb,mathrsfs,hyperref,textcomp,booktabs} \hypersetup{colorlinks} \begin{document} \begin{table}[ht] \centering ...

0

Adjusting some of the column widths, reducing the value of \tabcolsep (which governs the amount of intercolumn whitespace) by 25%, removing the whitespace to the left of the first column and to the right of the final column, and getting rid of some of the unneeded double curly braces lets the table fit into the text block without resorting to \adjustbox or ...

1

You can either explicitly embed the example in a minipage placed inside the table or you can use p{<par-width>} as a column directive: MWE \documentclass{article} \usepackage{gb4e} \begin{document} \begin{table}[h] \begin{tabular}{p{3in}l} \vspace{-\baselineskip} \begin{exe} \ex \label {basicnolaga} \gll a b-te c d ...

1

You might try something like this. I've simplified the example a little to reduce distractions: \documentclass[12pt]{article} \usepackage{booktabs} \usepackage{tabularx} \begin{document} \begin{table}[htbp]\centering \caption{GMM Estimates of First-Differenced Investment Equations% \label{GMM Estimates of First-Differenced Investment Equations}} ...

1

Here another way of doing things, without vertical lines, but keeping a frame, so that decimal numbers are aligned to the decimal marker while centred in their columns. As to the column heads, I split them into the letter part, and the rest, which is rotated. This way you can put te whole table on the page with a \small font without scaling. The vertical ...

2

Ideally, font sizes should be smaller for this table, but I will allow someone else to propose how to accomplish that. What I do here is merely introduce hyphenation points (\-) in your offending column to allow it to hyphenate within the column boundary. \documentclass[12pt]{article} \usepackage{booktabs} \usepackage{rotating} \usepackage{adjustbox} ...

11


4


1

Here again (and offering an alternative to @cfr 's solution —and also copying part of it :P—). With tap. Far from okay, but tap offers some flexibility. \documentclass{scrartcl} \input{tap} \usepackage{pdflscape} \begin{document} \deftable\tmptable \begintable \begintableformat & \center \endtableformat \B"- @2 ...

1

If the table is placed on a page with some other text, it should be possible to place it at the top of the page block by starting it off as follows: \begin{table}[t!] If, on the other hand, the table is on a floats-only page -- which is, by definition, the case if it's the only item on the page -- your options depend on which document class is in use. ...

1

I should say that I do not recommend this. It would be far preferable to rethink the presentation and produce a properly readable table. However, sometimes your hands are tied and needs must. If that is the case, here is a solution which fits the table on the page. I had to delete some parts of your code because they used definitions which were absent from ...

4

This takes inspiration from an answer given by Bernard using makecell. I used this because it seems that the use of vertical rules is essential to the look desired for this question and that excludes use of booktabs. Like booktabs, makecell adds some extra spacing to LaTeX's rather squashed default tabular layout, and supports the use of variable width ...

2

The column specification holds for all rows in a specific column, unless modified otherwise. So, pick your column specification to match what the majority of your column content would require, and manually adjust the others: \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table}[ht] \centering\small \caption{my ...

3

You want retain-explicit-plus. \documentclass[ngerman]{scrbook} \usepackage{siunitx} \begin{document} \begin{tabular}{l *{3}{S[table-format=2.2,retain-explicit-plus]}} \hline {\textbf{Data}} & {\textbf{Baseline}} & {\textbf{Magic}} & {\textbf{$\Delta$}} \\ \hline Data A & 34.56 & 45.67 & +11.11 \\ % + ...

3

Depending on what you are really trying to achieve, here are several possibilities: \documentclass[a4paper,12pt,oneside]{article} \usepackage[english]{babel} \usepackage{tikz} \usepackage{pgf} %\usetikzlibrary{shapes,arrows,positioning,calc,threeparttable} \usepackage{tabu} \usepackage{hyperref} \usepackage{longtable} \usepackage{array} ...

2

I guess the semi-tricky thing about the table is that whereas the columns' contents are all left-aligned, the numbers are -- depending on point of view -- either right-aligned or aligned on their decimal points/commas. To achieve the desired look, you could use the tabularx package and a modified form of its X column type to generate left-aligned entries ...

1

Here is a way of doing. It uses the makecell package, to define common formatting of row and column heads and better vertical spacing than in basic LaTeX: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{array, multirow, makecell} \renewcommand\theadfont{\rmfamily\bfseries} ...

1

Here is another option using tap. It may break some things, since it's not pure “LaTeX” but with care you have a beautifully typeset table. \documentclass{scrartcl} \input{tap} \begin{document} \begintable \begintableformat & \center \endtableformat \= \B!: | @3 | @6 ...

1

There are some ways to get this layout, one already proposed by Ian Thompson using \phantom, also shown here or using extra columns with automatic filling of the - characters in the 3rd logical column from the screen shot. \documentclass[12pt]{scrartcl} \usepackage{array} \begin{document} \begin{center} \begin{tabular}{lrr} \hline \textbf{Wellenl\"ange} ...

4

Here are two approaches. The first uses the standard tabular aesthetic with vertical rules. The second follows the guidelines provided by booktabs which dispenses with vertical rules. See the documentation for further information. \documentclass{article} \usepackage{multirow,array,booktabs} \begin{document} \begin{table} ...

1

A combination of the following elements will make the table fit inside the text block Reduce the amount of intercolumn whitespace by setting \setlength\tabcolsep{1.5pt} (default value: 6pt) Use 2.7 instead of -1 as the specifier for the D column type Use \footnotesize for a 20% (linear) reduction in font size Use a "normal-width" text block (e.g., with 1" ...

1

Pending more details, this is what you could do \documentclass{article} \usepackage{booktabs} \usepackage{dcolumn} \usepackage{tabularx} \begin{document} \begin{table}[htbp] \hspace{-3.5cm} \def\sym#1{\ifmmode^{#1}\else$$^{#1}$$\fi} \begin{tabularx}{1.5\textwidth}{lccXXXXXXXX} \toprule &\multicolumn{1}{c}{(1)} ...

5

The problem you're encountering is caused by the fact that \midrule can take an optional argument which indicates the thickness of the line to be drawn. Thus, LaTeX scans the string [89$^\circ$$_2/12.7^\circ$$_1$/89$^\circ$$_2$] for a unit of measurement, and an error message is generated because no legal unit of measurement (such as pt, cm, etc) is found. ...

3

I am not sure if this the correct formatting of that lines enclosed by [...], but I give it a try ;-) \documentclass{scrbook} \usepackage{booktabs} \begin{document} \begin{table}[h] \centering\small \caption{Thickness measurements on the two tubes.} \label{tab:Thickness_measurement} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lll} ...

2

Orgtbl-minor-mode (for emacs) This is along the lines of this answer about org-mode. org-mode also provides a minor mode designed specifically to typeset tables with the org syntax, but in a non-org buffer. Latex is supported out of the box, and there is a tutorial in the org manual. Pros all those in the answer about org-mode no need to use a separate ...

3

I don't understand what you mean with 1 decimal for the sixth column, as the values are integers. For the rest, one can fulfill your requirements using the numprint and makecell packages. The last mentioned is used in place of multirow since it allows multilined cells in tabulars with predefined formatting. I also defined a cbottomrule command which ...

2

You need braces in \begin{document}. You have three columns, but {l p{2cm} | c p{3cm} | c p{2cm} |} tells tabular to expect six. You need \\ at the end of the first and last rows. EDIT To adjust the alignment of the text inside a p column, you can use \centering, \raggedleft and \raggedright inside the table entries. Note that you need braces if you do ...

0

A table environment is floating around, which does not make sense within beamer, since it should appear on a particular, designed slide and is therefore suppressed (see comment by G. Medina) I removed the table stuff as well as the \caption and the wrong \minitab command. \documentclass{beamer} \usepackage{multirow} \begin{document} ...

1

I think the easiest way is just to wrap the {tabular} block inside a {table} block. The following example has a {tabular} truth table and {tabular} accuracy metrics wrapped inside a table which gives it both a caption and a label: \begin{table}[h] \begin{tabular} {|c|c||>{\centering}p{.9cm}|>{\centering}p{.9cm}|>{\centering}p{.9cm}|c|} ...

4

May be I am missing something but why don't you use another multi row for 4 like \multirow{2}{*}{A} & 4 & \multirow{2}{*}{4}\\ Code: \documentclass{article} \usepackage{tabu} \usepackage{multirow} \begin{document} \begin{tabular}{ccc} \multirow{2}{*}{A} & 4 & \multirow{2}{*}{4}\\ & 5 \end{tabular} Another one ...

1

You can use stacks, perhaps, instead of multirow. Here I give two examples. Note: the \edef\tmp{\the\baselineskip}\setstackgap{L}{\tmp} in the preamble is necessary, because \baselineskip (the default long-stack skip) is zeroed in the tabular environment. \documentclass{article} \usepackage[usestackEOL]{stackengine} \edef\tmp{\the\baselineskip} ...

2

In addition to fixing the problem with underscores pointed out by Ulrike Fischer, you might want to tidy up the layout and alignment a little. The following uses booktabs to improve the spacing and rules and dcolumn to align the columns on the decimal point. I also use \centering rather than the center environment to avoid creating additional spacing since ...

1

A second approach using tabular, array and booktabs Code: \documentclass[border=10pt]{standalone} \usepackage{booktabs,array} \begin{document} \newcolumntype{C}{>{\centering\arraybackslash}m{0.3cm}} \newcolumntype{c}{>{\centering\arraybackslash}m{1cm}} \begin{tabular}{*{7}{CC}c} \toprule $u_j$ & $\vert\vert$ & a &$\vert$ &b & ...

2

Treat everything as a column: \documentclass{article} \usepackage{array} \newcommand{\dvline}{\vline\hspace{\doublerulesep}\vline} \begin{document} \begin{table}[htp] \centering \caption{A table} \medskip \setlength{\tabcolsep}{2pt} \begin{tabular}{>{$}l<{$}*{14}{>{$}c<{$}}} u_j & \dvline & a & \vline & b & \vline ...

2

Example with the help of additional columns and \multicolumn: \documentclass{article} \usepackage{array} \begin{document} \begingroup \renewcommand*{\arraystretch}{1.2}% \setlength{\extrarowheight}{.2ex}% \setlength{\tabcolsep}{.5\tabcolsep}% \def\X#1{&\multicolumn{2}{c}{#1}}% \noindent \begin{tabular}{>{$}l<{$} c||c ...

5

\documentclass{article} \usepackage{pst-node,pst-blur} \begin{document} \newpsstyle{Dashed}{linestyle=dashed,shadow=false,blur=false,fillstyle=solid} \begin{pspicture}[showgrid=false,arrowscale=2,shadow,blur,framearc=0.05](-1,-1)(14,11) \psframe[blur=0,framearc=0,fillcolor=black!10,fillstyle=solid](-0.5,-0.5)(13.5,10.5) ...

14

One option using TikZ; the fit library was used just to draw the outer frame; depending on the actual requirements, this can be done without the library (see second example code below): \documentclass{article} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[ mytext/.style={ draw, text width=#1, align=center, minimum ...

1

I cannot tell if this is quite right without printing and I don't have any letter size paper. However, something like this: \documentclass{article} \usepackage[paper=letterpaper,layoutwidth=8.5in,layoutheight=7in,landscape]{geometry}% this says the paper is letterpaper but the layout should be 8.5x7 \usepackage[newdimens]{labels}% let the package do the ...

0

In case it may still be useful, and because it seems to me that it is not cited elsewhere on this network, Calc2LaTeX is a specific tool to import and convert tables from spreadsheet to LaTeX. Easily, you'll prepare the shape of your table (number of lines and columns, some formatting of cells) within the spreadsheet, convert, and then adjust LaTeX markup ...

2

Since it is not clear how the table really looks like, I assumed some shape and dimensions. Change at will... \documentclass{scrbook} \begin{document} \begin{tabular}{|p{5cm}|p{5cm}|} \hline \textbf{Title 1} & \tabularnewline \hline Data 1 & \tabularnewline Data 2 & \tabularnewline Data 3 & \tabularnewline Data 4 & \tabularnewline ...

2

The additional space around columns in a table is usually \tabcolsep: \documentclass[article, 12pt, oneside]{memoir} \usepackage{tabu} \begin{document} \tabulinesep=2mm \begin{center} \begin{tabu} to \linewidth {p{5.5cm}X[l,p]} a & aa \\ b & bb \\ c & cc \\ \addlinespace[1cm] ...

3

Neither table, tabular or minipage add something to the list of tables. This is done by \caption inside table or \captionof{table} (package caption or capt-of). Example: \documentclass{article} \usepackage{caption} \begin{document} \listoftables \newpage \begin{table} \caption{First table} \begin{tabular}{l} foo\\bar \end{tabular} ...

4

You can try gray!<percentage> syntax like gray!20 \documentclass{article} \usepackage{xcolor} \begin{document} \colorbox{gray!20}{gray!20}\color{gray!80} some text \end{document}

Top 50 recent answers are included