0

I am reffering to How to make a table on more than one page by using the table environment and Implementing page break in tabularx environment.

I am trying to create a symbols list in tabular form, which can span over several pages. The document I am working on uses a KOMA-Skript scrbook class. I define a new enviornment symbols as a tabularx as shown. Due to preceeeding text my tabularx environment should spread across two pages, as it is part of a symbols-list/glossary.

I have seen suggestions regarding ltxtable over ltablex packages, wehereby the first according to @DavidCarlisle has the problem of redefining tabularx for all apges which I don´t want. However, ltxtable requires importing additional .tex documents, and that´s a bit of a hastle as I have 5 different symbols list.

Additionnaly, as soon as I use \usepackage{ltablex}the compilation does no longer work, as some error regarding \end{tabluarx} appears.

Question: Is there some way of spanning a table across two pages, using an environment (as the one given), without importing external .tex data? What package would be need?

I am grateful for any help! Many Thanks in Advance

An example of my current code is:

\documentclass[a4paper, fontsize=14pt, DIV=calc,version=first, twoside, headsepline, ngerman, headings=small, open=right, numbers=noenddot]{scrbook}
%...
\usepackage{tabularx}
\usepackage[version=4]{mhchem} %Necessary for the Chemical Formula
%...
\begin{document}
%...
\newenvironment{symbols}
  {%
   \tabularx{\textwidth}{
   @{}p{0.1\textwidth} X>{\centering\arraybackslash[}p{0.05\textwidth}<{]}@{}
   }%
  }
  {\endtabularx\\[\belowdisplayskip]}
%...
%A Lot of Text comes here
%...
\addsec*{Lateinische Kleinbuchstaben}
\begin{symbols}
C & Kalk; \ce{CaO} & Pa\\
S & Kieselsäure; \ce{SiO2} & m\\
A & Aluminat; \ce{Al2O3} \\
F & Eisenoxid; \ce{Fe2O3}\\
H & Wasser; \ce{H2O} \\
$\overline{\text{S}}$ & Sulfat; \ce{SO3} \\
\ce{C2S} & Dicalciumsilikat; \ce{2CaO*SiO2}\\
\ce{C3S} & Tricalciumsilikat; \ce{3CaO*SiO2}\\
\ce{C3A} & Tricalciumaluminat; \ce{3CaO*Al2O3}\\
\ce{C4AF} & Tetracalciumaluminatferrit; \ce{4CaO*Al2O3*Fe2O3}\\
AFt & Ettringit, Trisulfat; \ce{3CaO*Al2O3*3CaSO4*32H2O}\\
AFm & Monosulfat; \ce{3CaO*Al2O3*CaSO4*12H2O}\\
CSH & Calciumsilikathydrat \\
CH & Calciumhydroxid \\
\end{symbols}
%...
\end{document}

[EDIT] Thanks @DavidCarlisle for your answer.

I need However a combination of 2 and 3, as I need to stretch the columns apart (not my decision, that of my supervisor) and there is also some very long text in german which needs wrapping. What would the solution for that be?

In addition, I have various symbols list in a row, and all have to be aligned, that´s why I used two fixed p{..\textwidth colums} and a x Column. Is there some way around it with longtables? (see pictured for an idea of what I need)

enter image description here

  • 1
    you have absolutely no need for tabularx here, just use a standard longtable, all the column widths are fixed in advance and do not depend on the content so tabularx can do nothing useful. – David Carlisle Sep 9 '16 at 8:24
  • 1
    Also I would not spread the columns out to full text width, it just makes the table hard to read, just use three l columns and centre the table as a whole (which is the default for longtable anyway) – David Carlisle Sep 9 '16 at 8:25
2

Just using longtable you do not need any external files or other weird declarations:

enter image description here

\documentclass[a4paper, fontsize=14pt, DIV=calc,version=first, twoside, headsepline, ngerman, headings=small, open=right, numbers=noenddot]{scrbook}
%...
\usepackage{longtable,array}
\usepackage[version=4]{mhchem} %Necessary for the Chemical Formula
%...

\begin{document}
%...
%...
%A Lot of Text comes here
%...
\addsec*{Lateinische Kleinbuchstaben}
\begin{longtable}{lll}
C & Kalk; \ce{CaO} & Pa\\
S & Kieselsäure; \ce{SiO2} & m\\
A & Aluminat; \ce{Al2O3} \\
F & Eisenoxid; \ce{Fe2O3}\\
H & Wasser; \ce{H2O} \\
$\overline{\text{S}}$ & Sulfat; \ce{SO3} \\
\ce{C2S} & Dicalciumsilikat; \ce{2CaO*SiO2}\\
\ce{C3S} & Tricalciumsilikat; \ce{3CaO*SiO2}\\
\ce{C3A} & Tricalciumaluminat; \ce{3CaO*Al2O3}\\
\ce{C4AF} & Tetracalciumaluminatferrit; \ce{4CaO*Al2O3*Fe2O3}\\
AFt & Ettringit, Trisulfat; \ce{3CaO*Al2O3*3CaSO4*32H2O}\\
AFm & Monosulfat; \ce{3CaO*Al2O3*CaSO4*12H2O}\\
CSH & Calciumsilikathydrat \\
CH & Calciumhydroxid \\
\end{longtable}


or if you \emph{really} want to stretch the columns apart 

{
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{longtable}{@{\extracolsep{\fill}}lll@{}}
C & Kalk; \ce{CaO} & Pa\\
S & Kieselsäure; \ce{SiO2} & m\\
A & Aluminat; \ce{Al2O3} \\
F & Eisenoxid; \ce{Fe2O3}\\
H & Wasser; \ce{H2O} \\
$\overline{\text{S}}$ & Sulfat; \ce{SO3} \\
\ce{C2S} & Dicalciumsilikat; \ce{2CaO*SiO2}\\
\ce{C3S} & Tricalciumsilikat; \ce{3CaO*SiO2}\\
\ce{C3A} & Tricalciumaluminat; \ce{3CaO*Al2O3}\\
\ce{C4AF} & Tetracalciumaluminatferrit; \ce{4CaO*Al2O3*Fe2O3}\\
AFt & Ettringit, Trisulfat; \ce{3CaO*Al2O3*3CaSO4*32H2O}\\
AFm & Monosulfat; \ce{3CaO*Al2O3*CaSO4*12H2O}\\
CSH & Calciumsilikathydrat \\
CH & Calciumhydroxid \\
\end{longtable}
}


Or if that middle column can get really long and needs to linewrap:


\begin{longtable}{l>{\raggedright\arraybackslash}p{.7\textwidth}l}
C & Kalk; \ce{CaO} & Pa\\
S & Kieselsäure; \ce{SiO2} & m\\
A & Aluminat; \ce{Al2O3} \\
F & Eisenoxid; \ce{Fe2O3}\\
H & Wasser; \ce{H2O} \\
$\overline{\text{S}}$ & Sulfat; \ce{SO3} \\
\ce{C2S} & Dicalciumsilikat; \ce{2CaO*SiO2}\\
\ce{C3S} & Tricalciumsilikat; \ce{3CaO*SiO2}\\
\ce{C3A} & Tricalciumaluminat; \ce{3CaO*Al2O3}\\
\ce{C4AF} & Tetracalciumaluminatferrit chemistryandgermantogetherresultsinsuchlongwords; \ce{4CaO*Al2O3*Fe2O3}\\
AFt & Ettringit, Trisulfat; \ce{3CaO*Al2O3*3CaSO4*32H2O}\\
AFm & Monosulfat; \ce{3CaO*Al2O3*CaSO4*12H2O}\\
CSH & Calciumsilikathydrat \\
CH & Calciumhydroxid \\
\end{longtable}

\end{document}
  • Thanks @DavidCarlisle. I need a combination of the options you posted. Could you look at the EDIT of the question and help me out with that? Many Thanks! – magicdivadd Sep 9 '16 at 9:09
  • @magicdivadd just do the code from both that is take 2 but replace the middle l by >{\raggedright\arraybackslash}p{.7\textwidth} – David Carlisle Sep 9 '16 at 9:19
  • Thanks. I played around a bit with the formatting, and got it all done :) Many Thanks once again! – magicdivadd Sep 9 '16 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.