Tag Info

New answers tagged

1

If you are looking for space reduction, you are choosing the wrong tabular environment (booktabs is generous in terms of space). So, I suggest the following (which you should only do when there is no other choice; these are not good practices): get rid of booktabs more importantly, reshape your table by transposing. The reason behind transposing is that ...


1

Is that what you want? \documentclass[letterpaper,oneside,12pt]{book} \usepackage[letterpaper, inner=2.5 cm, outer=2.5cm, bottom=2.5cm, dvips]{geometry} \usepackage{tabularx,booktabs,makecell,multirow, caption} \usepackage{enumitem} % to control Itemization spacing \renewcommand{\tabularxcolumn}[1]{>{\raggedright\arraybackslash}m{#1}} ...


0

If you want stretching, you can't use a tabular. \documentclass{article} \newlength{\columnA} \newlength{\columnB} \newsavebox{\tempbox} \begin{document} \settowidth{\columnA}{The ABCD table should stretch to fit} \settowidth{\columnB}{Thickest} \savebox{\tempbox}{% \parbox[t]{\columnA}{\centering A relatively wide line\\ ...


1

If the table data are generated, you should be able to set up things so that the starting part of the file to input is \begin{longtable}{lrrrrrr} \caption{\thelongtablecaption}\\[\bigskipamount] \toprule {} & coef & std err & $t$ & $P>|t|$ & \multicolumn{2}{c}{[95\% Conf. Int.]} \\ \midrule \endfirsthead \toprule {} & coef & ...


2

You mention that the tabular data are dynamic, are regenerated occasionally, and are stored in an external file. However, the structure of the table -- the number of columns, and its header and footer material -- is constant, correct? If that's the case, be sure to write only the tabular data to the external file. As you've discovered, it's not a good idea ...


1

You have made some odd choices in your original document, which may or may not be intentional: making an unnumbered section for each conclusion, but adding the conclusions to the ToC as chapters use of the \paragraph command. Normally (and very rarely) those are used for numbered document divisions below \subsubsection. This is the reason why you have such ...


2

The error means you're not loading the multirow package, but you don't need it, for it's easier to specially treat one cell than all 13 in the header row; with makecell it's easy. The only problem is to reduce the table so it fits; I used \small and 2.2pt as \tabcolsep. \documentclass{article} \usepackage{booktabs,makecell} \begin{document} \begin{table} ...


1

I figured it out, but now all tables have border 0pt. This is no good for mixed content with multiple columns and tables. <custom-preamble> \setlength\arrayrulewidth{0pt} </custom-preamble>


0

The dotted lines are made with \dotfill. A table with tabularx could be: \documentclass{article} \usepackage{tabularx} \begin{document} \begin{tabularx}{\textwidth}{ccX@{}l} test1 & test & test \dotfill & [A] \\ test2 & test & test \dotfill & [V] \\ \end{tabularx} \end{document} To change the spacing of the dots you can ...


1

\documentclass{article} \usepackage{tabularx} \makeatletter \newcommand*{\tocdotfill}{% \leaders\hbox{% $\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$% }\hfill\kern\z@ } \makeatother \begin{document} \noindent \begin{tabularx}{\linewidth}{lXr} A & Hello world \dotfill & 1\\ B & Foobar \tocdotfill & 2\\ \end{tabularx} ...


3

Simpy use \hline instead of \toprule, \midrule, or \bootomrule. Or set the arrayrulewidth \PassOptionsToPackage{table,x11names}{xcolor}% only needed if you get an option clash \documentclass[a4paper]{article} \usepackage{xcolor} \usepackage{booktabs} \begin{document} \def\arraystretch{1.5}% vertical stretch \setlength\arrayrulewidth{1pt}% thicker ...


5

You can't use booktabs with coloured rows as it introduces some vertical spaces around horizontal rules, which will not be coloured. Instead I suggest using \boldline, a small package from the shipunov bundle, which allows for hlines with variable thickness. The syntax is\hlineB{number}(or\clineB), which will draw a horizontal line with thickness equal ...


3

For its internal purposes, bytefield changes the category code of & upon starting the environment. This change cannot affect the argument already absorbed by \bansen, so you have to do the category change beforehand: \documentclass{article} \usepackage{bytefield} \newcommand{\bansen}{% \begingroup\catcode`&=10 \banseninternal} ...


0

Currently Pandoc doesn't support the tabular table environment. Someone announced in the Pandoc discussion forum about a year ago a separate Pandoc filter to achieve this: https://groups.google.com/d/msg/pandoc-discuss/RUC-tuu_qf0/h-H3RRVt1coJ


3

Just use multicolumn with the tabular environment like this: \documentclass{article} \usepackage[table]{xcolor} \begin{document} \begin{tabular}{c|c|c|c|c} \multicolumn{5}{c}{ input}\\ \multicolumn{1}{c}{state}&\multicolumn{1}{c}{a}&\multicolumn{1}{c}{b}& \multicolumn{1}{c}{c}&\multicolumn{1}{c}{\textit{P}}\\ \cline{2-4} ...


1

In case, that you not need array andcolortbl in other tables, than you can obtain beautiful table by means of (almost forgotten) package mdwtab: \documentclass{article} \usepackage{setspace} \usepackage[left=2.5cm,right=2.5cm,top=3cm,bottom=3cm]{geometry} \usepackage{caption} \usepackage{mdwtab,tabularx} \doublespacing ...


1

Font size, with the New Font Selection System, can be selected in the following way: \fontsize{size}{leading}\selectfont where size is the point size you want (say, 10pt) and leading is the leading (space between lines) you want (say, 12pt). This does, as mentioned, require scalable fonts, or at least font definition files which permit dynamic generation ...


3

You can do that with cellspace package: define a minimal vertical padding of rows, and prefix the relevant ccolumn specifier with the letter S (or C if you use siunitx): \documentclass{scrreprt} \usepackage{setspace} \usepackage[left=2.5cm,right=2.5cm,top=3cm,bottom=3cm]{geometry} \usepackage{array,tabularx} \doublespacing \usepackage{cellspace} ...


5

I suggest you drop the vertical line completely. How about something like this? \documentclass{scrreprt} \usepackage{setspace} \usepackage[left=2.5cm,right=2.5cm,top=3cm,bottom=3cm]{geometry} \usepackage{array,tabularx,booktabs} \doublespacing \begin{document} \begin{table}[htb] \centering \onehalfspacing \caption{Table of info.} ...


1

\cellcolor should be inside the final argument to \multicolumn; you can do \newcommand\diag[5]{% \multicolumn{1}{p{#2}|}{% #5% \hskip-\tabcolsep $\vcenter{\begin{tikzpicture}[baseline=0,anchor=south west,inner sep=#1] \path[use as bounding box] (0,0) rectangle (#2+2\tabcolsep,\baselineskip); \node[minimum ...


9

The following command may surprise you, because it achieves in a single pipeline what you want (or at least, it achieves what I think that you want). The command fits into a single Tweet even :)     : pandoc test_dummy.tex -f markdown -t html | grep -E '(^<|^$|^ *$)' \ | grep -v "^<p" | pandoc -f html -o tables.pdf Or, to format it a bit ...


1

Just set up a large number of columns; TeX doesn't complain if you don't fill them all. \begin{filecontents*}{\jobname.csv} Degrees,10,20,30,40,50,60,70,80,90 Time,1.33,0.90,0.72,0.63,0.50,0.43,0.41,0.40,0.38 \end{filecontents*} \documentclass{article} \usepackage{booktabs,array} \usepackage{csvsimple} \begin{document} \section{Good typesetting with ...


2

I suggest to loop twice over the file. The first loop is for counting the columns and the second loop is for setting the table. The following code implements a new macro \docolumncount which takes the file name as first argument and saves the column count minus 1 into the second argument, here \mycolumncount. This is used to set up the table: ...


1

You can try to use wraptable from wrapfigure-package but you would have to place the table manualy. \documentclass{article} \usepackage[pdftex]{graphicx} \usepackage[table]{xcolor} % For coloured rows within tables. \usepackage{multicol} \usepackage{wrapfig} \begin{document} Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. ...


1

I suggest you place the graphic inside a minipage of width 0.5\textwidth. \documentclass{article} \usepackage[demo]{graphicx} % omit 'demo' option in real document \begin{document} \begin{figure} \centering \begin{minipage}{0.5\textwidth} \includegraphics[width=\linewidth]{figure/ch3/result_s2/book.jpg} \end{minipage}% \hspace{4em}% easier to read ...


0

If you allow multi lie cells than you can easily fit in text width with: \documentclass[letterpaper,oneside,12pt]{book} \usepackage{tabularx} \begin{document} \begin{table}[htb] \centering \vspace{0.5cm} \caption{\small{Comparison between GPS and INS characteristics}} \vspace{0.5cm} \renewcommand{\arraystretch}{1.5} ...


3

I define a style which I call my pic adjust to be applied to each of the \tikz commands in the tabular environment: \tikzset{my pic adjust/.style={%% baseline=(current bounding box.center), execute at end picture={\path (current bounding box.north) -- ++ (0,4pt); \path (current bounding box.south) -- ++ (0,-4pt); ...


0

If you need to adjust the spacing for just one table you could also add/remove some space before the table and restore previous value after it: \addtolength{\tabcolsep}{-1pt} \begin{tabular}{cc} text & text \end{tabular} \addtolength{\tabcolsep}{1pt}


1

Just use {\color{red}\begin{tabular}{cc} a&b\\ 1&2 \end{tabular}} and the table will be red.


3

Here's a possibility with expl3. \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[slovak]{babel} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\declarechunks}{m} { \seq_set_from_clist:Nn \g_truth_chunks_seq { #1 } } \NewDocumentCommand{\partialtable}{} { \int_gincr:N \g_truth_arrayindex_int ...


3

Do you thing on something like this: \documentclass{standalone} \usepackage[table]{xcolor} \begin{document} \begin{tabular}{>{\color{red}}c >{\color{red}}c} \hline A & B \\ C & D \\ \hline \end{tabular} \end{document} If you wish in red (or other selected color) entire table (with lines), than before table ...


2

You can think of the notation *{<num>}{<col-spec>} as a very simple 'repeater' or loop, if you will. Its only effect is that any valid set of column specifications <col-spec> will be placed literally <num> times into the tabulars preamble at the spot it's used. So something like \begin{tabular}{*{2}{c}} will become effectively ...


2

You can do any one of the following: Place the algorithms each in its own minipage environment: \begin{minipage}{.5\textwidth} \begin{algorithm}[H]% Left algorithm ... \end{algorithm} \end{minipage}% \begin{minipage}{.5\textwidth} \begin{algorithm}[H]% Right algorithm ... \end{algorithm} \end{minipage}% Place the algorithms inside the ...


0

I think that "\ [6pt]" works only inside of \begin{align}-\end{align} and \begin{eqnarray}-\end{eqnarray}. There shouldn't use "$ $".


3

Your table is very long, consequently it is very difficult to put in text width of document. With some tweaks I obtain the following: For it I reduce size of fonts to \scriptsize, than instead of tabular I use \tabularx and define it width with temporary width of text. Also I define new column type L, which left aligned multi line content of cell. With ...


0

Ok, here is complete example which should clarify may comment: \documentclass{article} \usepackage{tabularx} % definition of new column type should be in preamble of your document \newcolumntype{C}{>{\centering\arraybackslash}X} \begin{document} \begin{table}%[H] if possible, avoid to use ``[H] % option for placing of table, better is ...


3

Nice version \documentclass{article} \usepackage{array} \usepackage{booktabs} \usepackage{caption} \usepackage{siunitx} \begin{document} \begin{table} \centering \caption{Table example} \begin{tabular}{ S[table-format=4.2] S[table-format=3.2] } \toprule \textbf{Number} & \textbf{Probability} (\si{\percent}) \\ \midrule 0 & 100 \\ ...


0

Since you say the first table works to your liking, my answer addresses only the second table. I suggest making the following changes: delete the instruction \sisetup{scientific-notation = true}, as 2 of the 4 data columns are in ordinary (i.e., decimal notation) format use S[table-format =-1.2] as the column type for the first two numeric columns use ...


1

siunitx is a l3kernel dependent package. If you are like me, working with an old installation, or simply do not wish to use a hefty LaTeX3 package for a few numbers in your document, or perhaps some other reason, there is an alternative solution. @Jonathan's question inspired me to do some out-of-the-box thinking and I came up with the following solution. I ...


0

Here is a solution to the general problem of empty pages in Lyx. This problem arises seemingly at random in my case, but it also arises routinely when inserting /clearpage to avoid the "too many unprocessed floats" error. Solution: compile your PDF and check where the empty pages are. Suppose the empty page occurs on page 49. Then insert this after the ...


2

It is because they are non-numerical data in Scolumns. I took the opportunity to fine tune the format of these cells specifying the numbers format, instead of using the default. I added some vertical padding to each row with the cellspace package and the rule commands from booktabs: \documentclass{article} \usepackage[margin=1in]{geometry} ...


1

There are two problems: The siunitx package considers qValue and qValueRes to be units. Place them in { } to fix the problem. I.e. the line in the heading of the table should become: & Gene & Description & Cytoband & Chr & Start & End & {qValue} & {qValueRes} \\ The second problem is with the S class of the columns with your ...


1

As said Heiko Oberdiek (he was a bit faster than me ...), you didn't determine columns for showing scientific format. Try the following: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{pdflscape} \usepackage{longtable} \usepackage[table]{xcolor} \usepackage{siunitx} \sisetup{% added for better formatting of S columns exponent-product = ...


2

First of all, please read Why not use vertical lines ('|') in a tabular? Now, a possible solution with X columns form tabularx package. The problem is that a certain tabular width must be fixed as a first parameter. \documentclass[a4paper,10pt]{scrartcl} \usepackage{siunitx} \usepackage{lipsum} \usepackage{tabularx} \begin{document} \lipsum[1] ...


2

It's easier to use siunitx, because it also allows for different output formats with the same input: \documentclass{article} \usepackage{booktabs,siunitx} \begin{document} \begin{tabular}{ l S[table-format=-2.2e1] S[table-format=-2.1e1] S[table-format=2.1] S[table-format=3.0] S[table-format=1.0e1] } \toprule &{$-\Delta G_{5.0}$}& ...


1

I found a way to achieve what I need by just adding an additional, "dummy" column. Just changing this: \begin{longtable}[h]{p{2cm}l@{\extracolsep{\fill}}} to this: \begin{longtable}[h]{p{2cm}l@{\extracolsep{\fill}}l} seems to do the trick. Example:


3

Please always post complete documents showing packages used. Don't use p columns for numeric data, you can use \multicolumn for headings which need a different format, don't use math italic for multi-letter identifiers such as mol. \documentclass{article} \usepackage{dcolumn,booktabs} \newcolumntype{d}{D..} \begin{document} \begin{tabular}{ l ...


1

Here is a solution. I took the opportunity to improve the vertical padding of cells, and defined a \nocell command to have a number of empty cells; its argument is the number of consecutive empty cells. \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{geometry} \usepackage{multirow} \usepackage{array, makecell, rotating} ...


2

A general answer would be tabularx. But for your use-case, I suggest you re-think the way your table is presented. What do you think about a solution like this: \documentclass{report} \usepackage{caption} \usepackage{booktabs,siunitx} \begin{document} In order to get the most complete view of the different methods, their computation times are printed ...


0

Try this: \documentclass{report} \usepackage{caption} \usepackage{float} \usepackage{graphicx} \begin{document} In order to get the most complete view of the different methods, their computation times are printed in the table below: \begin{table}[h] \centering \caption{Computation time for the different bootstrap methods\label{comptimes}} \footnotesize ...



Top 50 recent answers are included