Tag Info

New answers tagged

0

The makecell package is just for multilined cells (whether multirow or not). In addition, just using horizontal lines, as pointed above, loks much better. In addition, using the rule commands from booktabs gives some spacing to the cells. I also use the caption package: just loading it gives a better vertical spacing between the caption and the table. As ...


2

The simplest way is to just not draw full horizontal lines when you want to combine rows: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs} \begin{document} \begin{table} \caption{Funções e conexões do conector X1} \centering \begin{tabular}{|c|l|l|} \hline \textbf{X1} ...


0

This code seems to work, for both vertical and horizontal lines: \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{multirow} \usepackage{hhline} \usepackage{colortbl} \begin{document} \begin{table}[h] \begin{tabular}{|l|c|c|c|c|} \hline \multicolumn{5}{|c|}{Type} \\ \hline & A & B & C & D \\ \hline X & ...


3

\documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{multirow} \usepackage{hhline} \usepackage{colortbl} \usepackage{multicol} \begin{document} \begin{table} \begin{tabular}{|l|c|c|c|c|} \hline \multicolumn{5}{|c|}{Type} \\ \hline & A & B & C & D \\ \hline X & 53,2\% & 51,6\% & \cellcolor[gray]{0.9} ...


1

Here is a solution that uses the caption and the floatrow packages. Your commenttable command has to be put in the first argument of the ttabbox command, just after caption{…}. To have a correct vertical spacing, I had to modify it slighly. \documentclass[captions=tableheading]{scrbook} \usepackage{siunitx} \usepackage{booktabs} ...


1

This is tailor made for the boxhandler package, which sets captions in the style you asked, almost by default. The captioning is configurable. However, one must enter the table as a macro \bxtable{caption}{content}, not an environment, which some people will find bothersome. The only challenge was to align the comment with the table automagically. To do ...


2

Another layout with different types of "X" columns, and a better vertical spacing with the help of the cellspace package: \documentclass[a4paper, 11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{graphicx}%[draft] \usepackage{array, booktabs, multirow} \usepackage{tabularx} \newcolumntype{Y}{ ...


3

You can simply use the standard command multicolumn to achieve this. Then you choose which of the columns of the top tables should span more than one column of the lower table. Then do this in each row of the top table. \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{2}{|l|}{ parameter } & value & \multicolumn{2}{l|}{ parameter } & value ...


5

Here's one option using tabularx: \documentclass{book} \usepackage{tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} \begin{document} \begin{table} \small \centering \begin{tabularx}{.7\linewidth}{|X|C|X|C|} \hline parameter & value & parameter & value \\ \hline blah blah & a & blah blah & 2 \\ blah blah ...


2

A first trial without equal widths, but I am not sure whether I understand the request correctly... ;-) \documentclass{scrbook} \begin{document} \begin{table}[ht] \small \centering \begin{tabular}{l|l|c|l|c|l} \cline{2-5} & parameter & value & parameter & value \\ \cline{2-5} & blah blah & a & blah blah & 2 \\ ...


2

I'm not sure it's one of these you expect, but you can have your tabular centred with respect to the (innermost) enumerate margin, or left aligned with the left margin of the innermost enumerate environment: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{float} \usepackage{caption} \usepackage{insbox} \begin{document} \noindent I can align ...


2

I am not sure if this is what you want to achieve: \documentclass{article} \usepackage[utf8]{inputenc} \begin{document} \noindent I can align a table to the left. \begin{enumerate} \item However, it stays as far left as the margin allows. \begin{enumerate} \item This looks pretty ugly. \begin{enumerate} \item The effect is compounded with indentations ...


3

You could use something like this but note that it does make the text of your table quite small. Note that I did this before David Carlisle edited your question and so my example is somewhat less minimal. I kept the font packages and page layout in case that affected the spacing but I could certainly have pared it down further. I've used rules and a couple ...


1

One possible layout (which still generates warnings but fits on a page with article class) is \documentclass[12pt]{article} \usepackage{array,longtable,pdflscape,dcolumn} \begin{document} \newcommand\hd[1]{\rotatebox{90}{\small\textbf{#1}}} \begin{landscape} \vspace*{-2cm} \begin{tabular}{>{\small\bfseries}l*{11}{D..{3.1}}} Affiliation at Age 16 ...


0

The problem occurs due to the \rowcolor{blue!10}\bottomrule at the bottom of the first table. As a workaround you can manually remove the last \rowcolor{} command but I'm afraid I don't know how to get that done automatically. I would have posted this as comment but don't have the rep. \documentclass[xcolor=table,professionalfonts,a4paper,11pt]{article} ...


1

The problem is that you have an extra \rowcolor{blue!10} \bottomrule at the bottom of your tables; this is somehow affecting what follows. You're actually making one too many of the \\rowcolor{blue!10} in your rep command; it adds it on to the end of the line but affects the next line. To fix, just make rws have one less like this. rws <- seq(1, ...


3

\documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usepackage{multirow} \usepackage{booktabs} \begin{document} \small \begin{tabular}{lp{4cm}p{1.2cm}p{3.5cm}} \toprule \multirow{2}{*} & \multicolumn{3}{c}{Disability} \\ \cmidrule(r){2-4} & Regulatory Framework & ...


2

If you do not have vertical lines, then this can be solved by \noalign{\vspace{6pt}} Full example: \documentclass{article} \begin{document} \begin{tabular}{p{4cm}p{4cm}} Lorem ipsum dolor sit amet consectetur & adipisicing elit\\ \noalign{\vspace{6pt}}% sed do eiusmod tempor incididunt ut labore & et dolore magna aliqua.\\ ...


2

tabularx affects the setting of multiline cells, and the only column for which you had more than one line you were not using X. Also I removed some packages to make your example more minimal (they generate missing font errors as posted for me) This just used X and removes pbox: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% (UTF-8/XeLaTex) ...


3

Don't use \pbox. \documentclass[12pt,a4paper,oneside,openany]{book} \usepackage{fontspec,tabularx,amsmath} % For multiletter symbols \DeclareMathOperator\Real{Re} % cf plain TeX's \Re and Reynolds number \DeclareMathOperator\imag{Im} % cf plain TeX's \Im \newcommand{\constant}[1]{\mathit{#1}} \newcommand\Rey{\constant{Re}} % Reynolds number ...


1

REVISED SOLUTION to eliminate use of \pbox. Here, I replaced your use of the \pbox with a \stackanchor, with extra vertical separation provided by way of \addstackgap. I wrapped it all up in a newly defined macro \mystack{}{}. In that definition, the [3pt] and [6pt] vertical gap specifiers may be changed to suit. \documentclass[12pt,a4paper]{book} ...


2

The \\ mechanism can be used, but one has to account for the height of the \parbox, either manually or automatically. The other option, if all rows are to be adjusted, is to use the \extrarowheight parameter of the array package, or else \arraystretch as was mentioned in the comments. \documentclass{article} \usepackage{array} \begin{document} ORIGINAL ...


5

You could put a strut in the first column. \documentclass{article} \begin{document} \begin{tabular}{p{4cm}p{4cm}} Lorem ipsum dolor sit amet consectetur\rule[-6pt]{0pt}{6pt} & adipisicing elit \\ sed do eiusmod tempor incididunt ut labore & et dolore magna aliqua.\\ \end{tabular} \end{document}


2

Far from perfection, but for a document with a single table you can use detex and then replace & by , and delete empty lines. In Linux you can use some tools as grep and sed for this. The first line of the table is then the columns types, so you can delete manually or with some tool like tail. Example command line: detex file.tex | grep -v '^$' | tail ...


2

you forgot a ''&'' \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{multirow} \begin{document} \begin{table} \begin{tabular}{|l|c|c|c|c|} \hline \multicolumn{5}{|c|}{Type} \\ \hline & A & B & C & D \\ \hline X & 53,2\% & 51,6\% & \multirow{2}{*}{49\%} & \multirow{2}{*}{49\%} \\ Y ...


2

The last row misses the last &. The rightmost line is only set, if the last cell is used. An empty last cell will do: \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{multirow} \begin{document} \begin{table} \begin{tabular}{|l|c|c|c|c|} \hline \multicolumn{5}{|c|}{Type} \\ \hline & A & B & C & D \\ \hline X ...


4

I'm not really sure you want to align the numbers to the decimal point. But here's how you can improve the table: \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{array,booktabs} \usepackage{siunitx} \begin{document} Areas:\par \renewcommand{\arraystretch}{1.5} \sisetup{table-figures-decimal=4,table-auto-round} \begin{tabular}{ @{} l ...


5

You can use table-alignment=<choice> with some small kerning in between like @{\!}S[table-figures-decimal=1,table-space-text-pre=,table-alignment=left] Code: \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{array} \usepackage{siunitx} \begin{document} Areas:\par ...


2

I don't know if this is what you want: \documentclass{article} \usepackage{gb4e} \usepackage{tipa} \usepackage{array} \let\ipa=\textipa \newcounter{example}[xnumi] \renewcommand{\theexample}{(\alph{example})} \makeatletter \renewcommand{\p@example}{\thexnumi-} \begin{document} \begin{exe} \ex ...


2

You can use the cellspace package, that ensures a minimal vertical spacing between the top of a cell and the bottom of the above cell, and symmetrically between its bottom and the top of the below cell. It works with most column types but not with \multirow. To activate this feature it suffices to write an S before the type of one column ; I chose the text ...


5

Give some vertical space substituting \tabularnewline with \\[1.25ex]. MWE: \documentclass{article} \usepackage{array,multirow,booktabs} \usepackage[demo]{graphicx} \begin{document} \begin{table}[!htb] \centering \begin{tabular}{m{1.5cm}c ccccc} \toprule & & $1024 \times 1024$ & $512 \times 512$ &$256 \times 256$ & $128 \times 128$ ...


1

I tried to typeset it without ArabTeX, I've used the fontspec package and the Code2000 font. It is hard to say if this is what you need, if case you must use pdflatex, there are some fonts for Armenian and Vietnamese. I processed it with xelatex. Next option would be to prepare this table in a separate PDF file with xelatex, crop it and include it ...


4

Using the adjustbox package: \documentclass{book} \usepackage{adjustbox} \begin{document} \begin{table} \centering \caption{combined caption for both rotated tables} \begin{adjustbox}{angle=90} \begin{tabular}{l} \hline text \\ text \\ text \\ \hline \end{tabular} \end{adjustbox}\quad \begin{adjustbox}{angle=90} \begin{tabular}{l} \hline text \\ text \\ ...


3

Will this do? \documentclass{article} \usepackage{graphicx} \begin{document} \begin{table}[htbp] \centering \caption{combined caption 1 and 2} \rotatebox[origin=c]{90}{% \begin{tabular}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{tabular}% }% \hfil %% just to demarkate \rotatebox[origin=c]{90}{% \begin{tabular}{ccc} 7 ...


2

Here is another solution using the siunitx and booktabs packages: \documentclass{article} \usepackage{siunitx} \usepackage{booktabs} \newcommand*\mc[1]{\multicolumn{1}{c}{#1}} \begin{document} \begin{table} \centering \caption{Material resistivity.} \label{tab:matres} \begin{tabular}{ l S[table-format = 1.2e-1] S[table-format = 1.2e1] ...


2

Use the booktabs package to produce a high quality table and the siunitx package to format units and produce alignment in cells; a little example that gives you the necessary information to build your table: \documentclass{article} \usepackage{siunitx} \usepackage{array} \usepackage{booktabs} \begin{document} \begin{table} \caption{material resistivity} ...


2

I see several possibilities Restructure your table. You could change column to rows (transpose), or you could combine some columns. Define columns with fixed width by using p{<width>}; this will force linebreaking. You can also use manual line breaks in the table header. Or reduce the font size in your tabular, by using {\small \begin{tabular}... ...


1

The problem is that \includegraphics inside a tabular leaves no space above the image, so it abuts the dividing line. Here, I use the \addvbuffer macro of the verbatimbox package to add a 3pt buffer above (and 0pt below) the image, and call that new form \Includegraphics, with a cap I. \documentclass{report} \usepackage{longtable} ...


2

Hi,I had the same question and googled to this page. At last, I solved this problem by add one more c, the correct case should like below: \documentclass{article} \begin{document} \begin{tabular}{c|c|c} one & two & three \\ \hline one & two \end{tabular} \end{document}


6

The space is controlled by the parameter \doublerulesep which you can set at any point in the document \setlength\doublerulesep{2cm} Either in the preamble for the whole document or if just this table, inside the table environment alongside \centering and any other local declarations.


1

To get one row in even at landscape orientation you need \documentclass{article} \usepackage[a4paper, margin=1cm]{geometry} \usepackage{pdflscape,longtable} \newcommand*\rot{\rotatebox{90}} \begin{document} \begin{landscape} \setlength\tabcolsep{.9pt} \tiny ...


5

\documentclass{article} \usepackage{tabularx,booktabs} \begin{document} \begin{itemize} \item item 1\par \begin{tabularx}{\linewidth}{X X} \toprule 150 & 150 \\ \bottomrule \end{tabularx} \item item 2 \end{itemize} \end{document}


4

Please add complete examples with the necessary packages. You're using the wrong syntax for the table. Column specifiers should be within braces ({}) not brackets ([]). To get the alignment you want, just add an empty line after item. \documentclass{article} \usepackage{tabu,booktabs} \begin{document} \begin{itemize} \item item 1 \begin{tabu}{X X} ...


5

Package xcolor remembers the state of the colored row via count register \rownum. This can be reset to the initial value via: \global\rownum=0\relax It is too late to change the count register in the current row. Thus it needs to be done in a cell of the previous row. The following example adds a LaTeX interface for \rownum to get macros \setcounter, ...


6

You cam simply say rowcolor{lightgray} just before the row that you want to be colored regardless of your row color definition earlier. If previous row doesn't exist: \documentclass[11pt]{article} \usepackage{threeparttable} % tables with footnotes, capions all the same width \usepackage{dcolumn} % decimal-aligned tabular ...


2

I have polished your code and you placed two columns, p-type and l-type, next to each other. The effect was that left column was lower than you expected when dealing with text. I set them both to p-type, then it was easy to manipulate with them. I enclose an example for your further experiments. %! latex mal-listings.tex \documentclass{article} ...


1

Edit 1: A second approach via tabularx and use of X columns Code: \documentclass{article} \usepackage{array} \usepackage[landscape]{geometry} \usepackage{tabularx} \usepackage{xcolor,colortbl} \definecolor{Gray}{gray}{0.7} \renewcommand{\arraystretch}{1.8} \begin{document} \renewcommand\tabularxcolumn[1]{m{#1}} ...


2

Below I present you two options; the first one uses the hvfloat package; the second one, places the caption inside a minipage and uses \rotatebox from graphicx: \documentclass[caption=tableheading]{scrreprt} \usepackage{hvfloat} \usepackage{graphicx} \begin{document} \hvFloat[capPos=r,capWidth=0.4,capVPos=b,objectPos=c,rotAngle=90] {table} ...


0

You might want to look at my cals tables package, which supports padding in cells and widths of border lines. See the demo PDF: http://mirrors.ctan.org/macros/latex/contrib/cals/examples/demo.pdf


1

It is the same behavior as for a default footnote: \documentclass{memoir} \usepackage{threeparttable} % nice tables \usepackage[style=authoryear]{biblatex} \addbibresource{IEEEexample.bib}% available for TeXLive/MikTeX \begin{document} \begin{threeparttable} \begin{tabular}{@{}m{8cm}lm{6cm}@{}} \toprule a\footnotemark & b & c \\ \bottomrule ...



Top 50 recent answers are included