1

I am working on a four-column document using the multicol package and want to insert a two-column table that spans upon multiple multicols* columns (and multiple pages), doing column and page breaks by itself. I did a mockup in Excel of how I'd like it to look like:

Excel table mockup

However, I couldn't achieve that with any tabular, longtable, supertabular or xtabular. I think an xtabular could work, but it does a page break every time it reaches the end of a column (see MWE), while I want it to automatically do a column break and fill the whole page before going to a new page.

MWE of what I achieved so far, using the xtab package:

\documentclass[12pt,twoside]{scrbook}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multicol}
\usepackage{xtab}

\begin{document} \begin{multicols}{4} %Beginning of the four-column environment \begin{xtabular}{rl} %Beginning of the two-column xtabular 1 & Montag \ 2 & Dienstag \ 3 & Mittwoch \ 4 & Donnerstag \ 5 & Freitag \ 6 & Samstag \ 7 & Sonntag \ 8 & Montag \ 9 & Dienstag \ 10 & Mittwoch \ 11 & Donnerstag \ 12 & Freitag \ 13 & Samstag \ 14 & Sonntag \ 15 & Montag \ 16 & Dienstag \ 17 & Mittwoch \ 18 & Donnerstag \ 19 & Freitag \ 20 & Samstag \ 21 & Sonntag \ 22 & Montag \ 23 & Dienstag \ 24 & Mittwoch \ 25 & Donnerstag \ 26 & Freitag \ 27 & Samstag \ 28 & Sonntag \ 29 & Montag \ 30 & Dienstag \ 31 & Mittwoch \ 32 & Donnerstag \ 33 & Freitag \ 34 & Samstag \ 35 & Sonntag \ 36 & Montag \ 37 & Dienstag \ 38 & Mittwoch \ 39 & Donnerstag \ 40 & Freitag \ 41 & Samstag \ 42 & Sonntag \ 43 & Montag \ 44 & Dienstag \ 45 & Mittwoch \ 46 & Donnerstag \ 47 & Freitag \ 48 & Samstag \ 49 & Sonntag \ 50 & Montag \ 51 & Dienstag \ 52 & Mittwoch \ \end{xtabular} \end{multicols}

\end{document}

Compiled MWE: Compiled MWE

Thanks in advance for any advice!

  • 3
    does this have to be a table? a list (which can have a fixed width item label) would just work without any special code – David Carlisle May 07 '22 at 13:41
  • unrelated but avoid \usepackage{ucs}\usepackage[utf8x]{inputenc} unless you really need these legacy forms for compatibility with some old document. – David Carlisle May 07 '22 at 13:42
  • Probably useful: https://tex.stackexchange.com/a/105736/134144 – leandriis May 07 '22 at 13:43
  • @DavidCarlisle Thank you! Some items are up to three lines long and I need constant column widths over the whole table, also I appreciate the easy conversion of Excel tables to LaTeX code. But I'm not sure if there are similar possibilities with lists. I need to directly input Umlauts and various diacritic marks directly into my code, is there a better way than inputenc? – MulticolMetallurgist May 07 '22 at 13:53
  • @leandriis Thanks, I will have a look into it! – MulticolMetallurgist May 07 '22 at 13:53
  • utf-8 has been the default latex encoding for years so you do not need to do anything. You mostly risk breaking the standard unicode support by loading ucs or the non stadard utf8x inputenc option, – David Carlisle May 07 '22 at 13:57

1 Answers1

0

I would use a list here. I used itemize of course if your first column really is a counter in your real document it can be simplified more and use enumerate

I used multicolumn not multicolumn* as there was not enough text to fill 4 unbalanced columns in this example.

enter image description here

\documentclass[12pt,twoside]{scrbook}
% no \usepackage{ucs}
% no \usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multicol}
%\usepackage{xtab}

\begin{document} \begin{multicols}{4} %Beginning of the four-column environment

\begin{itemize} \item[1] Montag \item[2] Dienstag \item[3] Mittwoch \item[4] Donnerstag \item[5] Freitag \item[6] Samstag \item[7] Sonntag \item[8] Montag \item[9] Dienstag \item[10] Mittwoch \item[11] Donnerstag \item[12] Freitag \item[13] Samstag \item[14] Sonntag \item[15] Montag \item[16] Dienstag \item[17] Mittwoch \item[18] Donnerstag \item[19] Freitag \item[20] Samstag \item[21] Sonntag \item[22] Montag \item[23] Dienstag \item[24] Mittwoch \item[25] Donnerstag \item[26] Freitag \item[27] Samstag \item[28] Sonntag \item[29] Montag \item[30] Dienstag \item[31] Mittwoch \item[32] Donnerstag \item[33] Freitag \item[34] Samstag \item[35] Sonntag \item[36] Montag \item[37] Dienstag \item[38] Mittwoch \item[39] Donnerstag \item[40] Freitag \item[41] Samstag \item[42] Sonntag \item[43] Montag \item[44] Dienstag \item[45] Mittwoch \item[46] Donnerstag \item[47] Freitag \item[48] Samstag \item[49] Sonntag \item[50] Montag \item[51] Dienstag \item[52] Mittwoch \end{itemize} \end{multicols}

\end{document}

David Carlisle
  • 757,742
  • Thank you, I tried it out and a list like that might actually be the perfect solution to my problem.

    Edit: enumerate surely would be useful, but the actual project uses country codes in the left, and full country names in the right column so I'm only handling text. The usage of numbers in the MWE should help to show the columns' order.

    – MulticolMetallurgist May 07 '22 at 14:00