Tag Info

New answers tagged

1

I found a way to achieve what I need by just adding an additional, "dummy" column. Just changing this: \begin{longtable}[h]{p{2cm}l@{\extracolsep{\fill}}} to this: \begin{longtable}[h]{p{2cm}l@{\extracolsep{\fill}}l} seems to do the trick. Example:


1

The usual way to achieve this is to use ltxtable where long table meets tabularx. The interface is different from tabu, the command \LTXtable reads an external file containing your longtable, e.g. \documentclass{article} \usepackage{longtable} \usepackage{tabu} \usepackage{array} \usepackage{booktabs} \usepackage{filecontents,ltxtable} ...


2

Here's my approach for longtable footnotes which uses mbenotes package. Note: mbenotes is simply a mbenotes.sty file and you can easily modify the commands from it as per your requirements, which I've done in my solution. Here's the MWE: % !TEX TS-program = arara \documentclass{scrbook} \usepackage{supertabular} \usepackage{longtable} \usepackage{multirow} ...


1

You can use the ltablex package, which brings the functionalities of longtable in tabularx environments: \documentclass{article} \usepackage[ nomarginpar]{geometry}%showframe, \usepackage{ragged2e} \usepackage{array} \usepackage{ltablex} \keepXColumns \usepackage{booktabs} \usepackage{lipsum} \setlength\parindent{0pt} \setlength\LTleft{0pt} ...


0

A slightly modified longtable, booktabs, & multirow -based solution: \documentclass[11pt,a4paper]{article} \usepackage{multirow} \usepackage{booktabs} % To nicely typeset tabular material \usepackage{longtable} % For multipage tables! \begin{document} % Table generated by Excel2LaTeX from sheet 'Sheet1' \begin{longtable}{ccccc} ...


1

As you've noted, in order to make LaTeX split a long table across pages, it's necessary to use a longtable environment instead of nested table and tabular environments. The following example first shows the table produced by your code (with the code simplified here and there), followed by the same table produced using a longtable environment. The four key ...


2

You could use adjustbox package for get centered tables with footnote and minipage option for this environment \documentclass{scrbook} \usepackage{supertabular} \usepackage{longtable} \usepackage{multirow} \usepackage{adjustbox} \begin{document} \begin{center} \tablehead{\hline} \tabletail{\hline} \tablecaption{mpsupertabular} ...


1

You need to account for the widths of the rules (\arrayrulewidth) and column padding (\tabcolsep on each side of the column) so: \documentclass[a4paper,12pt,headsepline,american]{scrreprt} \usepackage{array} \usepackage[english]{babel} \usepackage[labelfont=bf]{caption} \captionsetup{format=plain,font=footnotesize} \usepackage{float} ...


1

Turns out that caption package version is not expecting \LTleft to be set to 0pt. setting \setlength\LTleft{0pt plus \textwidth} \setlength\LTright{0pt plus \textwidth} centres the caption without affecting the table (as the fill glue in extracolsep cancels out this finite stretch) You should also remove the center environment which does not affect the ...


2

\documentclass{article} \usepackage{longtable,etoolbox} \begin{document} Nice \begin{longtable}{cc} \textbf{heading a}&\textbf{heading b}\\ 1&2\\3&4\\5&6\\1&2\\3&4\\5&6 \end{longtable} Horrible {\setlength\LTleft{0pt}\setlength\LTright{0pt} \begin{longtable}{@{\extracolsep{\fill}}cc@{}} \textbf{heading a}&\textbf{heading ...


0

Not sure if this is what you want, in case comment under my answer. 12.5cm for the multicolumn goes out of the page so I reduced it to 7.5cm. If you want to leave the first cell of each row empty, then just delete "some text:" from the \newcommand. \documentclass{article} \usepackage{longtable} \newcommand{\newrow}[1]{ Some text: & ...


0

David's wise answer guided me to the solution. I am just improving his answer but I lack reputation points to add a comment. First, it works also for longtabu. Second, we can also add a table caption with: \makeatletter \def\tabcaption{% \refstepcounter{table}% \@dblarg{\@caption{table}}} \makeatother Then use: \tabcaption{my caption} Third, I ...


1

I think I may have found a solution: (based on this question and answer) % !TEX TS-program = xelatex \documentclass[showtrims]{memoir} \usepackage{tikz} \setstocksize{11in}{8.5in} \settrimmedsize{8.5in}{5.5in}{*} \settrims{1in}{1in} \setulmarginsandblock{1in}{1in}{*} \setlrmarginsandblock{1in}{.75in}{*} \checkandfixthelayout \newcounter{headeronpage} ...


1

The header line is seen as sole administration information in csvsimple. It is uses to count the columns and it can be taken to address columns by their header name. But it is not used as data. The example you gave is the way it is meant to be. To treat the header line as normal data entry, there is the option no head. Then, the first line is just a data ...


2

There are two problems to solve. You need the booktabs package for the rules and you have to replace head to column names to avoid problems with the subscript in your heading. With these alterations, you get the following: \begin{filecontents*}{code.csv} code,sub_cd CITY,LIMA CITY,PUEBLOLIBRE CITY,JESUSMARIA CITY,TARMA \end{filecontents*} ...


0

I find another workaround. For longtable, you can write like \caption{The Caption} Column 1 & Column 2 \endfirsthead \caption[]{The Continued Caption} Column 1 & Column 2 \endhead For pgfplotstable, you can duplicate the head line in the data, and add two different captions to the 1st and 2nd row, using every head row and every first row. Here's ...


0

I have continued to look for a solution and found a "dirty" fix. Since I have spent 10+ hours in total, I just wanted to publish my solution in the hope that one day it may help someone. However, I still do want to see a proper solution, so I am not going to accept my solution. Please do write if you have a better solution or an explanation of the underlying ...


2

\documentclass[10pt]{article} \usepackage{graphicx,fancyhdr,import,hyperref} \usepackage{longtable} \usepackage{datatool} \usepackage[margin=.75in]{geometry} \usepackage[toc,page]{appendix} \begin{document} \section{System Constants} The following table contains the constants used throughtout the system. \DTLsetseparator{,} ...


3

The sidewaystable environment does not let you split its contents across multiple pages. Since you're using a longtable environment, which has its own \caption commands, etc., there's no real need to embed it in a sidewaystable environment anyway. Instead, consider loading the pdflscape package and using that package's landscape environment to rotate the ...


0

Here's a demonstration of how the standard vertical alignment options work: \documentclass{article} \usepackage{tikz} \begin{document} \newcommand\demobox[1]{% \fbox{% \begin{minipage}[#1]{.25\textwidth} \tikz[baseline=(n.base)]{% \node (n) [inner sep=0pt, outer sep=0pt, text width=\linewidth] {Top}; \draw [red] (n.west |- ...


1

\documentclass{article} \usepackage{hyperref} \usepackage{pdflscape} \usepackage{afterpage,array}% you need array \usepackage{capt-of}% or use the larger `caption` package \usepackage{lipsum}% dummy text \begin{document} \lipsum % Text before \afterpage{% %\clearpage% not needed \thispagestyle{empty}% empty page style (?) \begin{landscape}% ...


2

use the parbox within multicolumn (adding 3 columns gives 7.6cm) like this: \documentclass[a4paper,12pt]{book} \usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry} \usepackage{array} \usepackage{longtable} \usepackage{showframe} \usepackage{multicol} \usepackage{multirow} \begin{document} ...


0

The cellspace package is here for that: it defines minimal vertical spacig at the top and bottom of cell in columns with specifier prefixed by the letter S (or C if you use siunitx). I also simplified your code and corrected it where it was faulty: \documentclass{article} \usepackage[showframe]{geometry} \usepackage{graphicx} \usepackage{array, longtable} ...


0

\parbox[|c|]{2cm}{ \includegraphics[scale=0.40,height=8 cm,width=10 cm] This specifies a 10cm wide image in a 2cm wide box, so overprinting is expected. At least it would specify that if it was \parbox{2cm} but \parbox[|c|] is a syntax error (although latex does not report it as such), the optional argument can only be c, t or b. You just want to ...


1

Starting left on even pages Package showframe visualizes very good, why the table does start quite with an indentation on even pages. As can be seen, the head line is also moved and the left space is occupied by quite a large "marginpar" column with width 5.5cm. Therefore you might want to correct the option values for package geometry. Too wide table ...


1

\begin{center} around longtable does not affect alignment, it just adds spurious vertical space. longtable is centred by default, but if you want left alignment you can use \begin{longtable}[l] but you can not align it at all as it is much too wide Overfull \hbox (95.13185pt too wide) in alignment at lines 16--21 You don't have room for two 7cm ...


2

There is no need to use \resizebox for any table, just select a suitable font size such as \small or \footnotesize so {\small \begin{longtable} .... \end{longtable} } or equivalently \begin{small} \begin{longtable} .... \end{longtable} \end{small}


1

For repeating headings, use \endfirsthead and \endhead. To increase the gape between rows, you may use makecell and its \setcellgaps and \makegapedcells inside a group. You won't need center environment as longtale is centered by default. BTW your table won't fit within the width (and I didn't correct it). \documentclass{article} ...



Top 50 recent answers are included