Textpos: absolute positioning of text on the page^{∗}

Norman Gray

                 (norman@astro.gla.ac.uk)

1998/04/30

This package facilitates placing boxes at absolute positions on the LaTeX page. There are several reasons why this might be useful, but the main one (or at least my motivating one) is to help produce a large-format conference poster.

This package provides a single environment, which contains the text (or graphics, or table, or whatever) which is to be placed on the page, and which specifies where it is to be placed.

The package tries not to get in the way. That is, you should be able to use most of the apparatus of LaTeX in your poster, such as section headings, citations, graphics inclusion, and so on. Please let me know if you experience problems in this respect.

1 Description

textblock The environment is used as follows

     \begin{textblock}{⟨hsize⟩}(⟨hpos⟩,⟨vpos⟩)

text...

     \end{textblock}

The ⟨hsize⟩, ⟨hpos⟩ and ⟨vpos⟩ arguments are all given in units of a module \TPmodule, which you can set using the command \setlength{\TPmodule}{⟨dimen ⟩}. The arguments may be real numbers, and you may use the module as a unit elsewhere in your document if you wish to, for example in \makebox[2\TPmodule]{gnus}. The text in the environment will be set in a box hsize modules wide, and placed on the page with its upper left corner at the position (hpos,vpos)

You may give a further argument, specifying which point in the box is to be placed at the specified point:

\begin{textblock}{⟨hsize⟩}[⟨ho⟩,⟨vo⟩](⟨hpos⟩,⟨vpos⟩)

text...

     \end{textblock}

∗This file has version number v1.0b, last revised 1998/04/30

The coordinates ⟨ho⟩ and ⟨vo⟩ are fractions of the width and height of the text box, respectively, and state that the box is to be placed so that the point (⟨ho⟩,⟨vo⟩) within the box is to be placed at the point (⟨hpos⟩,⟨vpos⟩) on the page. The default specification is [0,0], the top left of the box: [0,1] would be the bottom left, and [0.5,0.5] the middle.

Each textblock environment takes up zero space on the page (which means, by the way, that it cannot detect that it’s overprinting or being overprinted), so you can (and typically will) use several of the environments in a row to scatter text all over the page.

The environment works by offsetting the set text from the current position on the page. This is what you want if you’re placing text here and there on a page within a document, or if you’re laying out a figure. If your entire document is to be laid out piece by piece (which is the case in the canonical use of the package, to lay out a poster), then you might want to be more sure of where the origin is. In this case you can set the position of the top-left corner of the printed page using the command \textblockorigin{⟨hpos ⟩}{⟨vpos ⟩}. Here ⟨hpos⟩ and ⟨vpos⟩ are dimensions such as ‘10mm’, relative to the top-left corner of the paper. This command sets a number of TEX dimensions (topmargin, voffset, topskip, headheight, headsep, hoffset, oddsidemargin, evensidemargin), so things might look a little odd if you use this command in an otherwise conventional document.

1.1 Package options

There are two package options:

showboxes When you are laying things out, it can be useful to have the boxes drawn in for you. This option draws a box fitting closely round the set text.

noshowtext This suppresses the display of the text in each block (so it’s not really usable without the showboxes option). The resulting box will be the correct size, but empty, unless the \textblocklabel command has been given. This can be useful when you are previewing a document.

1.2 Package parameters

\TPmodule \TPmodule The length unit which is used for the positioning and size parameters of the textblock environment. Set it using the command

     \setlength{\TPmodule}{⟨dimen ⟩} (or indeed \addtolength). The

default is one sixteenth of the paper width or height, whichever is larger.

\TPboxrulesize \TPboxrulesize When you use the showboxes option, the lines drawn are of this width. If this too small to show up when you are previewing your document, you may adjust the size using \setlength or \addtolength. The default is 0.4pt.

\textblocklabel \textblocklabel This may be used within any textblock environment. It is ignored, unless the noshowtext option has been specified, when it will be used to label the textblock it is inside. Use:

     \textblocklabel{Identifying text}.
\showtextsize  \showtextsize When \textblocklabel is being shown, the text appears in

size \showtextsize, which is defined by default to be \normalsize. If this is too small, you may adjust it using

     \newcommand{\showtextsize}{\large}, or whatever size you prefer.

\textblockorigin \textblockorigin Sets the position of the top-left of the printable area. See above.

1.3 Producing large-format posters

If you are producing a large-format poster, such as A0 size, you might want to use Gerlinde Kettl and Matthias Weiser’s a0poster class, which painlessly deals with the miscellaneous hassles of printing to a large-format postscript printer.

The text on a large poster will typically use a very large font. It can be a hassle to create (or have dvips create) these fonts, and they take up a good deal of space on your disk. You might want to investigate the BaKoMa fonts (available at CTAN), which are postscript versions of the Computer Modern fonts, and which can therefore be scaled arbitrarily.

2 Example

Here is a short example file.

1 ⟨∗example⟩

 2 \documentclass{article}

3

 4 \usepackage{textpos}

5

 6 \setlength{\TPmodule}{30mm}
 7 \textblockorigin{10mm}{10mm} % start everything near the top-left corner

8

 9 \begin{document}

10

11 \begin{textblock}{3}(0,0)
12 This block is 3 modules wide, and is placed with its top left corner
13 at the `origin' on the page.  Note that the length of the block is not
14 specified in the arguments -- the box will be as long as necessary to
15 accomodate the text inside it.  You need to examine the output of the
16 text to adjust the positioning of the blocks on the page.
17 \end{textblock}

18

19 \begin{textblock}{2}(2,1)
20 \textblocklabel{block two}
21 Here is another, slightly narrower, block, at position (2,1) on the page.
22 \end{textblock}

23

24 \begin{textblock}{3}[0.5,0.5](1,3)
25 This block is at position (1,3), but because the optional argument
26 [0.5,0.5] has been given, it is the centre of the block which is
27 located at that point, rather than the top-left corner.
28 \end{textblock}

29

30 \end{document}

31 ⟨/example⟩