For a report I'm writing, I have got an MS Word template for a page that needs to be included. The page looks like this (print screen from Word):

A printscreen of the Word document

However, there are a few things that makes me not want to use this template in its current form, but rewrite it in LaTeX:

  1. This page is in Word, while the rest of my report is in LaTeX. Hence the styles will be different, which includes fonts and line widths for example.
  2. Word converts vector images stored in pdf format to low-resolved raster images when you include them (and yes it is still rasterized after you have printed it as a pdf file).

Anyway, enough of the arguing for using LaTeX already and to the question: How do I achieve this kind of layout using LaTeX? All I need to know for the moment is how to create these kind of boxes that exist right next to each other in this pattern, and how to get the text adjusted properly within the boxes.

Edit: It would be nice if the dimensions of the boxes were independent of the content inside of them. In that way the layout would stay the same for different people who used the same LaTeX template. My department at the university is maybe going to use it as an official alternative to the Word template.

  • Could you edit your question (including the title) to focus more on the boxes than on this design as a whole? That would make it a much better fit for this site.
    – doncherry
    Apr 12, 2013 at 20:25
  • @doncherry: What more than the boxes is it I am asking about that you think is unnecessary for this question? Apr 13, 2013 at 21:25
  • I’m mostly thinking about the title and how users facing a similar challenge would find this question. A title like Constructing a page layout with framed boxes might be more helpful in that, but you might be able to come up with an even better title.
    – doncherry
    Apr 14, 2013 at 16:26
  • @doncherry: I've updated the title. Apr 19, 2013 at 15:00

4 Answers 4


I do this in my reports. First you need the setup in your class or style file. In my case, it is our report class and it contains the following definitions for doing a govt SF-298 form:


As you can see, it uses the native picture environment of LaTeX, in which it overlays your text on top of a blank form (the blank form is imported as a graphic). In your document, you then need to call on the environment to draw the picture:

  \SFitemTHREE{January 2011-October 2011}
  \SFitemFOUR{Frontiers in Anisotropic Shock-Wave Modeling}
  \SFitemSIX{Alexander A. Lukyanov\\Steven B. Segletes}
  \SFitemSEVEN{Abingdon [EDITED OUT]}
%  \SFitemNINE{As needed...}
Studies of anisotropic materials and the discovery of various novel and
unexpected phenomena under shock loading has contributed significantly
to our understanding of the behavior of condensed matter. The variety of
experimental studies for isotropic materials displays systematic
patterns, giving basic insights into the underlying physics of
anisotropic shock-wave modeling. There are many similarities and
significant differences in the phenomena observed for isotropic and
anisotropic materials under shock-wave loading. Despite this, the
anisotropic constitutive equations must represent, mathematically and
physically, the generalization of the conventional constitutive equations for
isotropic material and reduce to the conventional constitutive equations
in the limit of isotropy. This report presents the current state of the
art in the experimental and theoretical developments of this fascinating
  \SFitemFIFTEEN{anisotropic material, anisotropic 
plasticity, shock waves, equation of state, stress decomposition}
  \SFitemNINETEENa{Steven B. Segletes}

The net result is

enter image description here

In response to the request for a self-contained example, I took the questioner's image at the top of this page, and saved it (as form.png). I then wrote this abbreviated snippet

\SFitemSEVENTEEN{This is the extended text  This is the extended text  
This is the extended text  This is the extended text  This is the 
extended text  This is the extended text  This is the extended text  }

The result is as follows, where a report number, a date, and an extended text section have been added to the user's form. In this example, I use both the environment to add data (\SFitemSEVENTEEN) as well as using previously defined data (\pubdate and \rptno) within the form

enter image description here

  • Could you please extend this code snippet in such a way that it is self-contained?
    – user26372
    Apr 12, 2013 at 20:57
  • @user26372 done. Apr 13, 2013 at 12:37
  • Nice approach for dealing with lots of forms, I like it! Could you comment on using the {picture} environment vs. textpos for the absolute placement? Any reason (other than familiarity) you didn't do the latter?
    – alexis
    Apr 16, 2014 at 12:11
  • @alexis It was purely a question of familiarity. I am unfamiliar with textpos. If I were to re-do it today, I might even try something like my answer at tex.stackexchange.com/questions/169808/… . Apr 16, 2014 at 12:27

Just some tips,

  1. Use minipages and use a key-value interface for entering the data. Entering data when you have 10 minutes to get a form out for a late report that gets lost in an avalanche of LaTeX commands is confusing and error prone. Think of minipages as divs if you familiar with html is the same concept.
  2. Get to know thy minipages. You will have to use the full form of the commands, i.e., catering for outer and inner alignment as well as specifying the height of the box.
  3. Use fbox when prototyping, but you may want to use rules in the final version.
  4. Budget at least 1-2 hours to get a form perfect. TikZ can be your friend too, if you familiar with it. In case anyone asks for round corners.

I normally use PGF for keys. Here is a MWE

\newcommand\setform{\pgfqkeys{/form }}
\setform{field1/.store in=\fieldi,
  field2/.store in=\fieldii,


  \textbf{Name} \fieldi
  \textbf{Subject} \fieldii

\setform{field1 = G. Wales,
         field2 = Mathematics}

  • While the \pgfkeys macro seems nice, in order to have it defined you need to \usepackage{pgf}. If you're not already using this package, how much will you by doing so slow down the compilation? Apr 19, 2013 at 15:02
  • @StrawberryFieldsForever It will slow the compilation, probably by 10 seconds. The \setform will speed up the data capturing by probably 5 minutes for a complicated form. You win some you lose some.
    – yannisl
    Apr 19, 2013 at 15:22
  • How can the data capturing take so long time? Is that true even if you write macros for setting each individual parameter that the form uses? Apr 19, 2013 at 15:33
  • @StrawberryFieldsForever That is from my own experience, if you have a lot of fields, even if they are macros. Try both approaches and see what is best for you.
    – yannisl
    Apr 19, 2013 at 15:54
  • Do you know how the space between the fboxes are calculated? In the code you provided (in the myform environment), there is no space between the first two of the three fboxes (which are surrounded by the larger one), but there is a small space between the last two of them. When I remove the %-symbol after the first one though there becomes a small space between the first two as well. Why is that? I thought TeX ignored whitesspaces after macro calls. Apr 19, 2013 at 17:14

Use table environment with combination of minipage environment in columns and you will get it. You need to consider multicolumn and multirow packages to make this format happen.

Another solution is to check baposter for LaTeX posters. It is very optimized to create such strange layouts. Create a PDF with it and include it in your LaTeX document.

  • I was thinking along the lines of minipages and frame them, but it gave me the willies...
    – vonbrand
    Apr 12, 2013 at 17:43

Using floating elements or minipages has the disadvantage Latex still can alter the layout. Which is normally a good thing, but not with forms which must follow exact dimensions.

I use PGF/Tikz which let you put anything exactly where you want it, on a page.

Although it is a kind of brute force (I want !that! exactly !there!) it creates just the layout you need. Latex styles are fully preserved, and all macros are accessible.

The options for nodes are infinite so I added only the most basic ones here. Inserting graphics is equally easy.

    \begin{tikzpicture}[remember picture, overlay]
    \node at (current page.south west){%
         \begin{tikzpicture}[remember picture, overlay]
            \draw (25mm,250mm) node [draw, anchor = south west, text width = 10 cm, minimum height = 3 cm]
           {Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in 
reprehenderit in voluptate velit esse cillum } ;
            \draw (135mm,250mm) node [draw, anchor = south west, text width = 3 cm, minimum height = 3 cm] {};

enter image description here

  • My bad. I used background for creating those boxes at random places on pages in the entire document. For just one page you don't need that. I have edited my anwer accordingly. Sep 10, 2015 at 23:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .