Tag Info

Hot answers tagged

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 ...


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.} ...


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

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 ...


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} ...


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} ...


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} ...


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 \\ ...


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 ...


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 ...


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

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); ...


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 ...


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

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: ...


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} ...


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

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 & ...


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 ...


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} ...


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>


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 ...


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 ...


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 ...


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

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 ...


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

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



Only top voted, non community-wiki answers of a minimum length are eligible