New answers tagged

0

The caption must be incorporated in the table, inside the foot specifications, if you want the caption at the bottoms of the table, or in the head soecifications to have it above the table (which is recommended). Also, if you load ltablex, you don't have to load tabularx nor longtable since they're loaded by ltablex. \documentclass[a4paper]{article}% ...


0

use \usepackage{booktabs} \usepackage{ltablex} \setkomafont{disposition}{\normalfont\bfseries} \setkomafont{caption}{\small} \begin{document} \keepXColumns \begin{tabularx}{\textwidth}{Xx}\toprule \textbf{Column 1} & \textbf{Column 2} \\\midrule $R$ & 1This is an example sentence \\ $R$ & 2As well as the line before ...


2

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


1

Here is another solution with a tabitem environment, which actually is an itemize environment and so also takes care of the indention after a linebreak. Unfortunately it seems that the array packages causes a spurious extra line at the end of the tabitem environment, so I haven't loaded this package and therefore also not the ragged2e package. I want to ...


1

I'm not sure if this is what you looking for: The obtain above picture of table is obtained by your code, where I erase \setlength{\extrarowheight}{10pt} (whic add only space above cells content) and add \renewcommand\arraystretch{1.5}. So, the complete code (with some changes in setting of math expressions), is: \documentclass[a4paper, ...


1

If for some reason you do not want additional packages, you can correct the tabular manually: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{setspace} \usepackage{mathrsfs} \onehalfspacing \usepackage{algorithmic} \textheight=23cm \textwidth=16cm \topmargin=-1cm \oddsidemargin=0cm \parindent=0mm \pretolerance=2000 \tolerance=3000 \title{} ...


4

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


1

Firstly you should use array not tabular so you don't need >{$} (that is more or less the only difference between the environments. Then since you have r columns anyway you can remove all the \multicolumnn{1}{r} this would also have the advantage of always using math mode, as is you are using text for positive numbers and math for negative, which isn't ...


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


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


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


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


1

May I suggest to use a version like this: \documentclass[a4paper, fontsize=11pt]{scrartcl} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage[onehalfspacing]{setspace} \usepackage{amsmath,array,booktabs} \begin{document} \begin{table} \begin{tabular}{*{4}{c}} \toprule Spieler $1$ & ...


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


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


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


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

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


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


1

Using the p-column type for the first column: \documentclass{article} \usepackage[a5paper]{geometry} \usepackage{ltablex} \usepackage{lipsum} % only for this example \begin{document} \lipsum[2] \medskip \noindent \begin{tabularx}{\linewidth}{@{}>{\bfseries}p{2.5cm}@{\hspace{.5em}}X@{}} 2009--present & very long text 1, very long text 2, very ...


1

Finally found this answer: http://tex.stackexchange.com/a/35669/97184 After looking at all the different workarounds and not getting savenotes to work, tablefootnote-package seems to be the only solution that is simple and works. Too bad I get the footnote on the previous page, but I'll try fixing that too. Other answers still welcome!


2

I suspect, that you like to have the following appearance of table: The problem is that the height of text in multi row cel is bigger than corresponding of rows, which are spanning by multirow. As one (rude) solution is to make one of this row higher. With Assumption, that multirow cells will have maximal 4 lines of text, I define two new commands (for ...


1

(Earlier comment re-posted as an answer.) It looks like your document uses the \flushbottom setting. To change this, insert the instruction \raggedbottom immediately before \begin{document}.


4

Here's a possible solution: \documentclass{article} \usepackage[table]{xcolor} \usepackage{xparse,environ} \ExplSyntaxOn \NewEnviron{matlabtabular}[1] { \tl_set:Nx \l_angelino_matlab_preamble_tl { \tl_tail:n { #1 } } \tl_put_left:Nn \l_angelino_matlab_preamble_tl { | >{\columncolor{red!20}} } \angelino_matlabtab:VV ...


1

A solution with the makecellpackage (allow for linebreaks and a common formatting and alignment in cells), cellspace (ensures a minimal vertical padding between a cell in a columb and the above and below cells) and colortbl. I also turned deg into the math operator \deg: \documentclass{article} \usepackage[english]{babel} ...


4

Something like this: For above piscture I only add to your MWE \usepackage[table]{xcolor} and in diagonal cells put \cellcolor{gray!10}: \documentclass{article} \usepackage[english]{babel} \usepackage[table]{xcolor}% <-- added \usepackage{amsmath,amssymb,amsthm, bm} \begin{document} \begin{center} \begin{tabular}{ | c | c | c | c | ...


0

I suggest you use a tabularx environment instead of a tabular environment for the existing 8-column table, setting the total width to something like 0.8\textwidth. Then, just add a second tabularx environment, with the same width as the first but containing only two columns rather than eight. \documentclass{article} \usepackage{multirow,rotating,tabularx} ...


2

To solve your problem, you need to know the final width of table. Since it is not known in advance, it is difficult to divide last row onto two equal parts. On basis of "trial-and-error" I succeed to obtain the following result: For this picture I add on the end of your code for table: %%%%%%%%%%%%%%%%%%% Part with two columns (nested) %%%%%%%%%% ...


2

Calculations can be done with \numexpr number1 operator number2, but in this case, the example is a little bit useless, since the number of & is fixed to use 3 columns (in between) anyway! \documentclass{article} \newcounter{myCounter} \setcounter{myCounter}{3} \begin{document} \begin{tabular}{cl*{\value{myCounter}}{c}c} & ...


1

Solution based on Ulrike's comment: \begin{table}[h!] \begin{tabular}{ p{2.5cm} p{12cm} } \textsc{My Table} & \\ \hline 1st row & {\fullcite{test}} \\ 2nd row & something else \\ \end{tabular} \end{table}


1

Problem ocurred from using booktabs insted of regular horizontal rules. Implementing this change the code will look such as follows: \begin{table}[htp] \centering \resizebox{\textwidth}{!}{% \begin{tabular}{@{}|c|c|c|@{}} \hline \rowcolor[HTML]{9B9B9B} Posición & Función & Valores \\ \hline & & R ...


3

You can't use booktabs rules with vertical rules, because booktabs adds some vertical padding around its horizontal rules. For the same reason, one has problems trying to use colours in table cells with booktabs. You can replace booktabs with boldlines, which allows for variable width rules in tables, in order to emulate the different kinds of rules of ...


5

The vertical rule on the right is not short, it's missing, because you've used \multicolumn{4}{c}{ROR} instead of \multicolumn{4}{c|}{ROR} However, instead of adding the vertical rules, follow the guidelines suggested by booktabs (since you're using it anyway): You will not go far wrong if you remember two simple guidelines at all times: ...


0

Two suggestions: Use judiciously placed typographic struts to improve the vertical spacing above and below the various horizontal lines. Note that I wouldn't increase the value of \arraystretch (default value: 1.0), as doing so will insert more vertical whitespace in all rows, and not just in those that are adjacent to a horizontal line. Since most of the ...


2

I'm not sure I think that the structure of your table is optimal, but I will leave that aside when answering on the vertical space. I would suggest using the booktabs package and then use \toprule, \midrule and \bottomrule. Thus, first of all add \usepackage{booktabs} to your preamble. Next, try this table: \begin{tabular}{cll} \toprule Unit (i) & ...


2

The last column is too wide because the ‘title’ is too wide w.r.t. the natural width of the rest of the table. I propose a solution with equal cell widths: it uses the eqparbox and tabularx packages and ensures the tabularx table has minimal width. Furthermore, I use hhlines to have correct intersections of horizontal rules and double vertical rules. ...


1

It seems you are new with latex. Your primary purpose of labeling the table could be fulfilled by this simple code instead. \documentclass{amsart} \usepackage{makecell} \begin{document} \begin{table} \centering \caption{Force in newtons required to move an object \boldmath$x$ meters\unboldmath} \begin{tabular}{|| c !{\vrule width0.8pt}c | c | c ...


4

I suggest you use a tabularx environment instead of the basic tabular environment. Moreover, I think the nine data columns should have equal widths. Use a \settowidth instruction to calculate the required width of the tabularx. You may also want to get rid of all vertical lines, to give the table a more "open" look. \documentclass{amsart} ...


1

I propose another layout, based on tabular only: \documentclass{article} \usepackage[table, x11names]{xcolor} \usepackage{graphicx} \usepackage{caption, makecell} \renewcommand\theadfont{\normalsize} \renewcommand\theadalign{bc} \usepackage{siunitx} \usepackage{etoolbox} \colorlet{slightgray}{LightSteelBlue3!25} ...


2

Even after your edit of question it is still cryptic to me. So on basis of guessing and a bit of considering, how I will wrote similar table, I made the following example: \documentclass{article} \usepackage{tabularx} \usepackage[table]{xcolor} \usepackage{siunitx} \begin{document} \begin{table}[h] \renewcommand{\arraystretch}{1.5} \sffamily ...


0

The table is based on LaTeX. Using Rmarkdown inside the table environment is never going to work, as it doesn't recognise Rmarkdown. Using LaTeX citations is logical idea, however, LaTeX citations don't work the same way Rmarkdown citations work. This is an Rmarkdown document and doesn't provide any instructions for LaTeXtables. As you can see, the YAML ...


1

As percusse and cmhughes have pointed out already in their comments, one can try to accomplish your needs with the pgfplotstable package. Here some code for a starting point, which I think works quite well for vertical tables, but lack for horizontal tables. Although the solution isn't perfect, it hopefully is a good starting point to experiment with. ...


3

The documentation of pgfgantt includes a chapter "Style Examples", starting at page 45. The syntax for ganttbars is: \ganttbar[ options ]{ label }{ start tss }{ end tss }. You can make different settings for most of the available elements. Also, you can adjust the colour of the bars quite easily: \ganttbar[bar/.append ...


1

For exercises and starting point: \documentclass[border=3mm, tikz, preview ]{standalone} \usetikzlibrary{fit, matrix, } \begin{document} \begin{tikzpicture}[ every node/.style = {inner sep=0.5mm} ] \matrix (magic) [matrix of nodes, column ...


5

I can't understand why you use \tabularx if you than not use X column type ... If you like to have table width equal to \textwidth, than exploit tabularx capabilities! Anyway, see if the following solutions is what you looking for: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usepackage{newtxtext,newtxmath} ...


3

In addition to providing at least one type-X column in a tabularx environment, you should also use a font family that actually provides bold-smallcaps glyphs (Computer Modern does not), and not use full justification in narrow columns, as doing so will almost certainly create unacceptably large gaps between words; instead, use ragged-right mode in narrow ...


4

You ask for a tabular length of \textwidth but do not adpate the size of the column. You could use X to do so. In tabularx, X will expand the column to fit the required size. For example: \documentclass{article} \usepackage{tabularx} \begin{document} \begin{tabularx}{1\textwidth}{|X||p{4cm}||p{3cm}|} \hline \textsc{\textbf{Nombre}} & ...


0

I tested all other methods above with packages but I found this simple method by David most useful -- actually I got all kind of malfunctioning with other answers such as only one element in a row changed the size of the text and so on, this may be due to rotating's sidewaystable but anyway -- this most simplest method works! \footnotesize ...


4

Being not versed in expl3, I would rater use a shell escape in this case. You have to adapt this to your operating system, but on Unix-like is quite simple; let this file being main.tex: \documentclass[12pt]{scrartcl} \begin{document} abc \input{|"grep -v ^main mwe2.tex"} def \end{document} ...and then run it with pdflatex --shell-escape main-tex ...


1

This still needs some work to be done, but you may start with: % arara: pdflatex \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[spanish]{babel} \usepackage[table]{xcolor} \usepackage{array} \usepackage{microtype} \usepackage{siunitx} \sisetup{range-phrase=--} \usepackage{ragged2e} \begin{document} ...



Top 50 recent answers are included