1

I am using pylatex to create a report on a single page. The page consists of three parts.

  1. A two column supertabular with dynamic number of rows
  2. A two column tabu each cell containing a two column tabular with fixed number of rows
  3. A plain text section that should occupy the remaining space on the page

I want the supertabular to flow into two columns when its height exceeds the height specified forthe minipage.

\documentclass[10pt]{article}%
\usepackage[T1]{fontenc}%
\usepackage[utf8]{inputenc}%
\usepackage{lmodern}%
\usepackage{textcomp}%
\usepackage[T1]{fontenc}%
\usepackage[utf8]{inputenc}%
\usepackage[swedish]{babel}%
\usepackage{fancyhdr}%
\usepackage{graphicx}%
\usepackage{siunitx}%
\usepackage{gensymb}%
\usepackage[scaled]{helvet}%
\usepackage[margin=30mm,headsep=20mm]{geometry}%
\usepackage{supertabular}%
\usepackage{siunitx}%
\usepackage{tabu}%
\pagestyle{fancy}
\lhead{\includegraphics[keepaspectratio=true,width=50mm]{logo}}%
\rhead{Test document}%
\cfoot{\today}%
\DeclareSIUnit\rpm{rpm}%
\sisetup{per-mode=symbol}%
\renewcommand\familydefault{\sfdefault}%

\begin{document}
\begin{minipage}[t]
  [15cm][t]{\textwidth}
  \twocolumn
\section{Data}
\begin{supertabular}{l l} %This should flow in two columns when height exceeds 15cm
  \textbf{Label} & value \\
  ...
\end{supertabular}
\end{minipage}

\begin{minipage}[t]
  {\textwidth}
  \begin{tabu}{X[l] X[l]}
  \begin{tabular}{l l}
      \textbf{Left label} & value \\ 
      \textbf{Left label} & value \\ 
      \textbf{Left label} & value \\ 
      \textbf{Left label} & value \\ 
      \textbf{Left label} & value \\ 
    \end{tabular}       & \begin{tabular}{l l}
      \textbf{Right label} & value \\ 
      \textbf{Right label} & value \\ 
      \textbf{Right label} & value \\ 
      \textbf{Right label} & value \\ 
      \textbf{Right label} & value \\ 
    \end{tabular}
  \end{tabu}
\end{minipage}

\begin{minipage}[t]
  {\textwidth}
\section{Comments} bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla
\end{minipage}

\end{document}

I thought I solved this in another thread earlier today, but when I started adding other stuff to the document things started overlapping.

  • why do you want the minipage there? a minipage that is the full width of the page does nothing other than prevent page breaking and floats. – David Carlisle Aug 23 '16 at 11:19
  • @DavidCarlisle I was thinking it could act as a two column container with a fixed height for the supertabular to flow in – John Aug 23 '16 at 11:20
  • no, it disables all page (and column) breaking:-) – David Carlisle Aug 23 '16 at 11:21
  • given the description of your input why do you need the outer table at all? what purpose does it serve, compared to just have a sequence of paragraphs each containing two of the inner tables – David Carlisle Aug 23 '16 at 11:23
  • Do you mean the tabu? The left and right tables are related and contain the same number of rows, so I putting them in the tabu to make them occupy the entire page width and get positioned next to each other. – John Aug 23 '16 at 11:27
1

I replaced the supertabular with a description enviroment and wrapped it inside a multicols enviroment as pointed out by @DavidCarlisle.

It worked really well in this case.

  • It is not truly related but you mentioned you used supertabular with pylatex? How did you do it? As far as I can see it is not included in the library – Delosari Apr 12 '17 at 1:35

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.