Tag Info

New answers tagged

2

The problem is that the table is too large even for being contained in a page, so first of all LaTeX pushes it on the next page because it can't be contained in the chapter title. Then it tries to set it in the next page which again doesn't have room for it, so it pushes it to the next page and finally it gives up. You simply don't need tabularx. ...


4

Your columns are too narrow (with your code you receive Overfull \hbox warnings); as soon as you increase the width, you get the desired result, Using \extrarowheight you can improved the vertical alignment: \documentclass[xcolor=table]{beamer} \usepackage{ragged2e} \usepackage{tabularx} \newcolumntype{C}[1]{>{\Centering}m{#1}} ...


2

You can avoid guessing the required length by noticing you want to span 2 X columns, a 3cm p column and two intercolumn gaps each of width 2\tabcolsep \documentclass[a4paper]{article} \usepackage{tabularx} \usepackage{array} \usepackage{booktabs} \begin{document} \textbf{Array A :} \vspace{\baselineskip} \noindent ...


4

The tabularx documentation suggests to not use the X specifier in \multicolumns and also to not use \multicolumn entries which cross any X column. If you really want to do that, you'd better use a p column and you don't need a minipage. Also, without a \noindent, using \linewidth exceeds the margins. Last, but not least, use \sffamily instead of the ...


7

After relocating some of lines, \documentclass{Article} \usepackage{tabularx} \newcounter{StepListCounter} \renewcommand\item[2]{% \medskip\noindent {\textbf{\arabic{StepListCounter}}\stepcounter{StepListCounter}} & #1 & & #2 \\ } \newenvironment{steplist} {% \medskip \setcounter{StepListCounter}{1}% ...


2

The first column is already declared in math mode with >{$} and <{$}, so what you have in the last row is, after all substitutions $ $\sigma$\textsubscript{f} $ which causes \sigma to be outside of math mode. So just omit $. You shouldn't use \textsubscript. Here's a better version that avoids specifying \hspace{0.5cm} every time. ...


1

longtable breaks naturally at the end of the page, as shown here where I have doubled the length of the table, and reduced the length of the page, so it goes on to page 2. \documentclass[a4paper, 10pt]{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[italian]{babel} ...


1

Just a bit of math, assuming the standard text width of article (345pt), the standard \tabcolsep (6pt) and the standard rule width (0.4pt). With 19 columns you have to do (345-38*6-20*0.4)/19 = 5.73684 (rounded), so you have just 5.73684pt width for the X columns and each digit is about 5pt. Indeed, for this case I get Overfull \hbox (4.26317pt too wide) ...


2

You can make the utf8 handling more robust: \documentclass[ngerman]{scrbook} \usepackage{savesym} \usepackage[LGR,T1]{fontenc} \usepackage[utf8]{inputenc} \input{ix-utf8enc.dfu} \usepackage[math=normal,main=ngerman,greek,]{babel} \usepackage{teubner} \savesymbol{breve} \savesymbol{aa} \usepackage[osf,sc]{mathpazo} \restoresymbol{pplj}{breve} ...


2

The main problem is bad interaction with tabularx: stating \selectlanguage{polutonikogreek} in the prefix to an X column causes errors that are amplified by teubner; but without it the problem is still present causing \textpi to be considered undefined. A temporary workaround might be delaying the language setting when the paragraph is started: ...


6

You can use \\* to prevent a page break \multicolumn{2}{c}{\cellcolor[gray]{0.75}2013}\\* If lines are involved you need to change the commands for the lines too: Prevent page break after \midrule in \longtable How to disable pagebreak on \hline in longtable?


7

You can not save a floating environment in a box, but you can save the tabularx \documentclass{article} \usepackage{tabularx} \begin{document} \newsavebox{\mybox} \begin{lrbox}{\mybox} \begin{tabularx}{\textwidth}{|l|ll|} x & y & z\\\hline \end{tabularx} \end{lrbox} \begin{table} \usebox{\mybox} \end{table} \end{document}


1

I have a somewhat different approach to your mixed problem. Below I use a list-like setting of a table and utilize array's functionality for inserting content in the beginning of a column via >{<stuff>} - acting like a column separation mechanism. This latter approach only sets <stuff> if the column is used, leaving no <stuff> if the ...


10

During its trials tabularx makes various local definitions to stop things happening multiple times, or to stop you getting multiple warnings about the bad boxes for bad trials. In particular it does \hfuzz=\maxdimen (Actually without the =) so you get no overfull hbox warnings during the trials. On the final run it does a setting with all these ...


8

You need \\[10\normalbaselineskip] as \baselineskip is 0pt in tabular enviornments so that rows (and especially vertical rules) have no gaps. It sort of works by accident if the final column is a p (or here X) column as locally within that column the baseline is reset for normal typesetting. Note however you are picking up that local setting, if the ...


1

I want to point that cellspace has the same functionality as tabls and is compatible with tabularx and array. It defines minimal vertical distances between the top of a cell and the bottom of the above cell, and between the bottom of a cell and the top of the below cell. You have to prefix column qualifiers with the letter S(or C if you use SIunitx). ...


5

Here is my addition to David Carlisle's answer. I sorted things a little bit different and added some options which might be useful. Especially, the right edge problem is resolved and the caption put into the title. Here is the code: \documentclass{article} \usepackage{blindtext} \usepackage{tcolorbox} \tcbuselibrary{breakable,skins} \usepackage{caption} ...


3

Here's a simple approach with tabulary and xcolor. \documentclass{article} % FONT \usepackage[T1]{fontenc} \usepackage{tgheros} \renewcommand*\familydefault{\sfdefault} % TABLE FORMATS \usepackage{tabulary} \usepackage[table]{xcolor} % Format header rows uniformly \newcommand{\tableheader}[1]{% \cellcolor{cyan}\textbf{#1}% } % DUMMY TEXT FOR EXAMPLE ...


5

It's straightforward to create such a table using the xcolor and colortbl packages. You didn't indicate the preferred width of the table, so I've assumed it should be as wide as the text block. \documentclass{article} \usepackage[table,svgnames]{xcolor} \usepackage{tabularx,lipsum,ragged2e} \newcolumntype{Y}{>{\RaggedRight\arraybackslash}X} % allow ...


4

csvtabular has \csvautobooktabular for this purpose. \documentclass{article} \usepackage{csvsimple,booktabs} \usepackage{filecontents} \begin{filecontents*}{mycsvdata.csv} A, B 0.0, 1.0 0.0, -0.5 \end{filecontents*} \begin{document} \begin{table}[htb] \centering \caption[Short Caption for LoT]{Title of table}\label{table:tablename} ...


1

A short example with pgfplotstable \documentclass{article} \usepackage{booktabs} \usepackage{pgfplotstable} \pgfplotstableread{ A B 0.0 1.0 0.0 -0.5 }\datatable \begin{document} \begin{table} \centering \caption[Short Caption for LoT]{Title of table} \pgfplotstabletypeset[% every head row/.style={ before ...


5

The behavior you are noticing is due to your \multicolumns like \multicolumn{4}{|p{\linewidth}|}{contentcontent} In all these cases replace p{\linewidth} with l and the problem is solved. An example which doesn't work with your settings \documentclass{article} \usepackage[margin=3cm]{geometry} \usepackage{tabularx,colortbl,xcolor} \begin{document} ...



Top 50 recent answers are included