TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have data consisting of groups of key-value pairs and associated images. I'd like the key-value pairs to show in a table to the right of the images. Like this:

LaTeX screenshot

The above screenshot is produced by the following code:

  \begin{tabular}{ >{\bfseries \raggedleft}p{0.4\textwidth}<{:}  p{.6\textwidth}  }
    Key & Value \\
    Another key & 56.1481049 \\
    Ipsum bla & Lorem tutasee \\
    Kvalatit & Tip top \\
    Fordus tius & Lorem ipsum bla supresium vitales ektum eksaput doktinus mit dei fyrte granikus.\\
    Estimat is & 1337 \\
    Lokale & Viktualierum \\

The code works as I want and several groups of tables and images can be placed after each other.

However unfortunately it seems that a minipage is restricted to a single page. Thus, if the images or the table takes more space than a single page, they will simply overflow the page and continue on into non-existence.

Is there any way that I can achieve what I want in a way so that if possible the tables aren't broken across several pages but in the cases where the minipages simply can't fit in a page they behave decently?

Figure of the desired result

The above is a rough illustration of what I'd like to end op with. That is: the tabels/images only breaks on pages when they have to, otherwise they act like normal LaTeX floats.

share|improve this question
neither the minipage nor the nested tabular (if you removed the minipage) will break over a page, It looks like you want a list for the text (which will break over a page) then put the images in the margin using \marginpar or similar (with a wide left margin) – David Carlisle Jan 8 '14 at 13:24
But i only want the things to break over a page when the content is longer than a page and absolutely has to. – paldepind Jan 8 '14 at 13:42
so you can set the inter-line penalties within the list to be very high. – David Carlisle Jan 8 '14 at 13:59
Could maybe create and answer with an example? I've no experience with penalties and I'm not sure how you'll get the same look for the key-value pairs with a list? – paldepind Jan 14 '14 at 11:59
I would have thought about \marginnote{} the illustrations at places where you want them. As far as I remember, you might want then to have a smaller textwidth but more margin... That's my current idea. – strpeter Jan 29 '14 at 21:06
up vote 5 down vote accepted

You could take advantage of the new scrlayer packages in the new KOMA-script version (3.12). The column in the margin will continue, if necessary, on the next page. To me, this seems something rather new. However, you'd need longtable and I did not really test that. Just as an example I add some code, but you'll have to play with the width and the margins...

\usepackage{scrlayer-notecolumn, scrlayer-scrpage, graphicx, calc, longtable}

 \DeclareNewNoteColumn[font=\sffamily\footnotesize, width=3cm, 

    \protect\begin{longtable}{p{1.5cm}p{2cm} }
      Key & Value \\
      Another key & 56.1481049 \\
      Ipsum bla & Lorem tutasee \\
      Kvalatit & Tip top \\
      Fordus tius & Lorem ipsum bla supresium vitales ektum eksaput doktinus mit dei fyrte granikus.\\
      Estimat is & 1337 \\
      Lokale & Viktualierum \\
      \protect\end{longtable} }
share|improve this answer
Hm, I'm not sure that the version of KOMA-script you mention is available to me (I'm using texlive from the Ubuntu repos). – paldepind Jan 10 '14 at 11:10
@paldepind This should be interesting for you: How to install “vanilla” TeXLive on Debian or Ubuntu? – Speravir Jan 21 '14 at 17:52
Alex, better use an image from package mwe, and perhaps add package showframe, so one can see better the overlapping of margin. – Speravir Jan 21 '14 at 23:14
Sorry. I've played around with your code, and I can not get it to display properly. – paldepind Jan 29 '14 at 12:52
@paldepind No need to be sorry, but this code runs on my machine so probably your installations includes older versions of KOMA-script files. \listfiles at the beginning of the code will print all files into the log and you can look out for the culprit. – Keks Dose Jan 29 '14 at 13:11

Here's a fairly simplistic solution using longtable, together with adjustbox to help with vertical alignment of the figures.


I have used a simple itemize list for your 'key-value' list, and used the enumitem to help with the formatting of it.

Note that the longtable environment will never break cells across pages, but will happily put page breaks between rows, which sounded like it was your main goal- the output should be almost exactly as it is in your mock-up, although you may get some bad pagination depending on the dimensions of your images.

% arara: pdflatex
% !arara: indent: {overwrite: yes, trace: yes, localSettings: yes}


        \item[Key] Value
        \item[Another key] 56.1481049
        \item[Ipsum bla] Lorem tutasee
        \item[Kvalatit] Tip top
        \item[Fordus tius] Lorem ipsum bla supresium vitales
              ektum eksaput doktinus mit dei fyrte granikus.
        \item[Estimat is] 1337
        \item[Lokale] Viktualierum
share|improve this answer
The longtable you're using here has only a single row per data/image set. Doesn't this mean that this solution has the exactly same problem as my original one if one set of data or images takes up more space than a page? – paldepind Feb 6 '14 at 7:04
@paldepind you're correct, it does have that limitation. The mark up is slightly more robust in my solution because we don't have to specify a minipage every time, and we only have to specify the column widths once. If you have a set of data that takes up more than a page, you're going to have to tweak it manually; perhaps you might be interested in grid typesetting. Thanks for the bounty, I appreciate it :) – cmhughes Feb 6 '14 at 17:29
Unfortunately manual tweaking is not an option for me since the LaTeX file is automatically generated based on data from a database. – paldepind Feb 7 '14 at 14:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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