Hot answers tagged

8

Is not perfect but see, if it is useful: \documentclass{scrartcl} \usepackage{graphicx} \usepackage{caption} \usepackage{booktabs,makecell,tabularx} \renewcommand\theadfont{\bfseries\sffamily} \newcommand{\textblacksquare}{\rule[.2ex]{0.8ex}{0.8ex}} \usepackage{paralist} \usepackage{ragged2e} ...


8

Here is an enumitem version: I have defined a tableitems variant of the itemize environment and used it inside your table. Note the ungainly hack using \vspace for those lists that do not have a header. Without this there is an empty line about the list. Code \documentclass{scrartcl} \usepackage{graphicx} \usepackage{booktabs} ...


7

The answer would be to put the list inside a minipage or parbox, but that is not really fun. Here is another solution with enumitem using the before and after keys and the command \tablistcommand: Use tabitemize when you have a cell with a list only, and clear out the before key with text preceding the list. The lines are correctly aligned. ...


5

Fill the empty cell: \documentclass{article} \usepackage{tikz} \usepackage{booktabs} \usetikzlibrary{calc} \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};} \newcommand{\DrawBox}[3][]{% \tikz[overlay,remember picture]{ \draw[black,#1] ($(#2)+(-0.5em,2.0ex)$) rectangle ($(#3)+(0.75em,-0.75ex)$);} } ...


5

Add \usepackage{array}, it will connect the lines.


4

See the screenshot please -- is this what you want to achieve? \cline{...} \cdashline{...} \cline{...} will print a solid line | dashed line | solid line. If the line should be dashed from column 2 to 6 then use \cdashline{2-6} and drop the \cline{...} statements. The empty line can be achieved easier with \multicolumn{6}{c}{} \tabularnewline ...


4

Try this. \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage{tabularx,colortbl} \usepackage{xcolor} \usepackage{ifthen} \def\kw{2} \begin{document} \begin{frame}{Title} \begin{tabularx}{\textwidth}{|c|X|} \hline Bla & Blabla\\ \hline \hline 1 & something\ifthenelse{\equal{\kw}{2}}{\\\rowcolor{red}}{\\}% ...


4

You can do that with threeparttable, which defines an eponymous environment, and a tablenotes environment. If you put the caption betweentable and threeparttable environments, the caption will have a width of textwidth; if you put it inside threeparttable, its width will be the actual width of the table: \documentclass[12pt]{article} ...


3

The OP commented that he like my answer at Using \footnote in a figure's \caption, though he/she was interested in automating the calculation of the minipage width. Here I show how that might be done. I place the tabular content into a \def for easy recall, and then place it in a temporary \hbox. I then can use \wd0 as the minipage width, and just ...


3

Like this You can do that with \multicolumn{1}{c:}{} to create row with vertical dashed line as separator. To control gap between dash segments you can modify the length \dashlinegap the default is 4pt Code \documentclass[a4paper, fontsize=11pt]{scrartcl} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} ...


3

You can have this: \documentclass{article} \usepackage[showframe]{geometry} \usepackage{rotating, graphicx} \usepackage{makecell, tabularx, multirow} \renewcommand\theadfont{\normalsize} \newcounter{rownum} \begin{document} \begin{table*} \renewcommand{\arraystretch}{2} \settowidth\rotheadsize{\theadfont aligned with data} ...


2

As a small variation of answer provided by @Herbert, I can compile this document without a single warning: \documentclass[draft]{article} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{tabularx,booktabs,ragged2e} \newcolumntype{Y}{>{\hspace{0pt}\RaggedRight}X} \begin{document} \noindent ...


2

Use a tabularx: \documentclass[a4paper,french]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[showframe]{geometry} \usepackage{babel} \usepackage{tabularx,booktabs} \begin{document} \begin{table}[!htb] \begin{tabularx}{\textwidth}{@{}l X @{}} \toprule Source & La commission de contrôle procède à une véritable évaluation ...


2

You can have a solution swapping rows and columns and loading makecell for line breaks in cells. Here is a possible layout. In addition, I loaded siunitx to format coherently the (nonstandard) units in this table, and mhchem to have a simpler code for chemical formulae. \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} ...


2

put the \label{Example} after \end{tabular} if really needed. For LaTeX it is like a contents of the first column in a new line. [...] \end{tabular} \label{Example}


2

Note that \include should be \input, but it's not the problem. The issue is that \rowcolor must be the first item in a row, after expansion, so you need to use an expandable test, which \ifthenelse isn't. With etoolbox it's easy. By the way, beamer already loads xcolor, so in order to load colortbl it's best to pass it the table option, which is done by ...


2

Here is a solution, with the etoolbox package. You can reference the rows. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T2A]{fontenc} \usepackage[russian]{babel} % Включаем пакет для поддержки русского \usepackage{multirow,tabularx} \usepackage[a4paper,margin=1in,landscape]{geometry} \usepackage{etoolbox} \newcounter{rowcnt} ...


2

The fact that ltablex affects all tabularx is not the best feature of the package, you could instead use ltxtable package but anyway with ltablex as with normal tabularx if you want the tabke to float it must be inside a table environment, and once inside such an environment it will not split as table makes a box. You can not add float options such as [h] to ...


1

As far as I can see, there's no provision for changing the column alignment in \csvautotabular; you can generate a different command by mimicking what csvsimple does for the stock command: \documentclass[11pt,a4paper]{memoir} \usepackage{csvsimple} % For csv importing. \makeatletter \csvset{ autotabularcenter/.style={ file=#1, after ...


1

You have used m instead of cm in the first column |p{1.8m}


1

It is perfectly centred. The only reason for what you get is two empty rows. I've commented out the spurious \\ in the relevant part of your code (lines 82-91). \midrule \text{behaviour} & \text{increasing for } x>0, \text{decreasing for }x<0 & \text{decreasing for } x>0, \text{increasing for }x<0 \\%\\ \midrule \text{vertext} & ...


1

The problem is that the first time you call \mytablespec, \mytablespec itself is redefined. So, when you call it the second time, it has its new definition and not the old one. If you redefine a macro, you cannot continue to use it with its old definition. It now has its new definition and it can only have one definition at a time. The problem can be easily ...


1

With \documentclass{article} \usepackage{diagbox,tabularx} \begin{document} \begin{table} \centering \begin{tabularx}{\textwidth}{| l | *{4}{>{\centering\arraybackslash}X|}} \hline \diagbox[width=7.5em, trim=l]{Symptom}{Auswirkung\\auf} & körp. Gesundheit & soziales Umfeld & psych. Wohlbefinden ...


1

Use a tabularx and, of course, use less tabular lines: \documentclass[a4paper,fontsize=11pt]{scrbook} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{tabularx,diagbox,ragged2e} \begin{document} \noindent \begin{tabularx}{\textwidth}{| l | *4{>{\Centering\hspace{0pt}}X|}} \hline \diagbox[width=7.5em, ...


1

Very similar to Zarko's, but the gist of either is that you have to enable hyphenation, otherwise the words are simply too long to fit on one line. I also cleaned up the formatting with the booktabs package. \documentclass{article} \usepackage{array} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} % http://tex.stackexchange.com/a/157400 ...


1

Here is a trick. use \tabtag{table} before \caption. \documentclass{article} \usepackage{amsmath} \newcommand{\tabtag}[1]{% \renewcommand{\thetable}{\ref{#1}}% \addtocounter{table}{-1}} \begin{document} \begin{equation} x = 1 \label{eq1} \end{equation} \begin{equation} x \not= 2 \tag{\ref{eq1}} \end{equation} \begin{table} \begin{tabular}{c} hello ...


1

Use \documentclass[ngerman]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \usepackage{tabularx,booktabs,ragged2e} \renewcommand\tabularxcolumn[1]{>{\hspace{0pt}\RaggedRight}p{#1}} \begingroup \begin{document}\tabcolsep=3pt \begin{tabularx}{\textwidth}{@{}XX|XXX|XXX@{}} \rlap{Alternativen} & & $A_1$ & ...


1

For automatic lines break you need to use adequate column type. For example p{<width>} or X, if you use tabularx environment (which I prefer): \documentclass{article} \usepackage{booktabs,tabularx} \usepackage[utf8]{inputenc} \usepackage[showframe]{geometry} \begin{document} \begin{table} \begin{tabularx}{\textwidth}{lX} ...


1

The ifacconf class is not compatible with caption, as the warning Package caption Warning: Unsupported document class (or package) detected, (caption) usage of the caption package is not recommended. See the caption package documentation for explanation. tells you. This means that also subcaption cannot be used. In these cases, the good ...


1

Here is a solution: you need 8 columns, and an array environment, rather than tabular: \documentclass{article} \usepackage{mathtools} \begin{document} \[ \renewcommand\arraystretch{1.5} \begin{array}{|*{8}{c|}} \hline \multicolumn{4}{|c|}{a > 0} & \multicolumn{4}{c|}{a < 0} \\ \hline \multicolumn{2}{|c|}{n\enspace\text{even}} & ...



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