Tag Info

Hot answers tagged

4

You can use $\vcenter{...}$: \documentclass{article} \usepackage{graphicx} \usepackage{longtable,amsmath,tabularx} \begin{document} \begin{longtable}{m{0.2\linewidth} m{0.7\linewidth}} \hline $\vcenter{\includegraphics[keepaspectratio,width=\linewidth]{example-image-a.jpg}}$ & $\!\begin{aligned} A &= b\cdot{}h\\ P &= 2(b+h)\\ ...


4

You can use adjustbox package with export option so that the keys are available inside the \includegraphics command. \usepackage[export]{adjustbox} and then use valign=c \includegraphics[keepaspectratio,width=\linewidth,valign=c]{example-image-a.jpg} Code: \documentclass{article} \usepackage{graphicx} \usepackage{longtable,amsmath,tabularx} ...


4

You need to make TeX think it is starting a new word after these breaks so that allows hyphenation of the following part. \hspace{0pt} will accomplish such a break. It is best to collect your code for this in to custom commands for the behaviour you wish to allow at the given punctuation mark: \documentclass[a4paper,leqno,twoside]{article} ...


4

Instead of reducing font size, choose proper column widths such that each column can accomodate the widest content (if not, allows wrapping) with the total width of all columns not exceeding \textwidth. \begin{longtable}{C{\dimexpr0.12\textwidth-2\tabcolsep\relax} *2{C{\dimexpr0.19\textwidth-2\tabcolsep\relax}} ...


4

It's not the case that the table is "shifted" to the right in the MWE. Instead, the MWE's table is wider than \textwidth, i..e, the width of the text block. This makes its material stick out to the right of the text block. Assuming the document's left-hand and right-hand margins are actually 1 inch (2.54 cm) wide each, you can get the longtable environment ...


3

A solution based on tabularx. I also use the array package, for its *{n}{} and >{…} constructs that saves typing, and booktabsto improve the look of the table. The siunitx package is used to align columns of numbers. Finally, I've automated row numbering and the GO: label. \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} ...


3

\vfill instructs TeX to insert vertical space as necessary to, well, fill when appropriate. What this means depends on the context but, in this case, you are telling TeX that if it needs to, it is perfectly fine to put such space before and after the table, effectively pushing the first page of the table to the bottom and the final page to the top. If you ...


3

Perhaps this is, what the OP requests, but I could not test any feature, since the example by the OP is fragmented. I changed to tcolorbox with no rounded corners and switched off the box rules. In order to demonstrate the colorbox at all, I used a yellow background colour. \documentclass[12pt,a4paper]{article} \usepackage{longtable} \setlength{\LTpre}{0pt} ...


3

you can color the tabular with the \rowcolors macro: \documentclass[12pt,a4paper]{article} \usepackage{longtable} \setlength{\LTpre}{0pt} \setlength{\LTpost}{-6pt} \usepackage{array} \usepackage[UKenglish]{babel} \usepackage{geometry} \usepackage{booktabs} \usepackage{array} \usepackage{lscape} \usepackage{siunitx} \usepackage{parskip} ...


2

\begin{longtable}[r]{|lr|} Use the optional argument.


2

You can use threeparttablex. Here is an attempt. \documentclass{article} \usepackage{threeparttable} \usepackage{booktabs} \usepackage{dcolumn} \usepackage{longtable} \usepackage{threeparttablex} \usepackage{pdflscape} \newcolumntype{d}[1]{D{.}{.}{#1}} \newcommand\mc[1]{\multicolumn{1}{c}{#1}} \begin{document} \begin{landscape} \setlength\tabcolsep{0.1pt} ...


2

\label should never be before \caption and in particular a \caption in a longtable has to be the complete row, so it is best to put \label in the caption argument.


2

You have to move your \label{mytbl} just after the caption like \caption{My caption}\label{mytbl}\\ \toprule You can put the Continued on next page in the same way you do with a long table: \caption{My caption}\label{mytbl}\\ \toprule & \multicolumn{2}{c}{Grp 1} & \multicolumn{2}{c}{Grp 2} & \\ & ...


2

Would this be what you were after!. After some studies, errors were found \multicolumn{2}{c}{} % 2 such cases: missing the last {} $>>$ % 3 such cases: need math environment Code \documentclass[a4paper,leqno,twoside]{article} \usepackage[utf8]{inputenc} \title{dd} \usepackage{amsmath} \usepackage{color} \usepackage{tabu} ...


2

The problem is that the table is wider than the textwidth. When you use \usepackage[showframe]{geometry} then you see the borders: \documentclass[a4paper]{article} \usepackage{longtable} \usepackage[showframe]{geometry} \begin{document} \begin{longtable}{cccccccp{5cm}} \hline Row & GO term & P-value & OR & Exp Count & Count & ...


1

As Manuel Kuehner mentioned, your table is wider than the \textwidth. You may either Enlarge \textwidth by simply \usepackage[cm]{fullpage} or, as mentioned, using geometry. Add a negative space manually on the left of the table, as following: \documentclass[a4paper]{article} \usepackage{longtable} \begin{document} \begin{longtable}{cccccccp{5cm}} ...


1

You can use the S column type, from the siunitx package to have automatic formatting of number. Here is a code: \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{array, longtable} \usepackage{booktabs} \usepackage[table-format = 1.2,table-number-alignment = center, ...


1

\documentclass[a4paper]{tufte-book} \usepackage{booktabs} \usepackage{tabularx} \usepackage{longtable} \usepackage{lscape} \usepackage{colortbl} \begin{document} \begin{landscape} \advance\vsize6cm \csname @colroom\endcsname=\vsize \textheight=\vsize \csname @colht\endcsname=\vsize \small ...


1

You can add some potential breaking points to the long word by adding \- (if you want a hyphen when breaking} or \allowbreak (if you don't). Examples \fbox{\parbox[b]{5cm}{AAA\_BB\_CCC\_D\_EEE\-EEE\_FFF\_GGGGG\_HHHHHH}} \fbox{\parbox[b]{5cm}{AAA\_BB\_CCC\_D\_EEEEEE\allowbreak \_FFF\_GGGGG\_HHHHHH}} resulting in more information at this related ...


1

You can also have a look at the hyphenat package which redefines the underscore \_ so that hyphenation can automatically occur. This adds a hyphen at the end of the line. This has the advantage that you don't have to manually add \- in every word with an underscore. \documentclass[a4paper]{article} \usepackage{hyphenat} \begin{document} ...


1

Could have also done \begin{landscape} \begin{sidewaystable} INSERT TABLE \end{sidewaystable} \end{landscape}



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