Position:Absolute in LaTeX

posted in: LaTeX, Technicalities | 0

In css there is the handy absolute positioning. Today I found out how to do it in LaTeX:

In the preamble

\usepackage{textpos}

In the document

\begin{textblock}{2}[0,0](8,1.5)
    Lorem ipsum dolor sit amet
\end{textblock}

The arguments are as follows:

\begin{textpos}
    {<width>}
    [
<left handle>,<top handle>]
    (<leftmargin>,<topmargin>)

Width: width of the box. Height is determined automatically.

Handle: Where the box is being grabbed. Default is [0,0], which means left/top corner; [0.5,0.5] would be the center of the box and [1,1] the right bottom corner.

Margin: Where the box will be positioned on the page.

For more detailed instructions (on the units of measurement for instance), refer to Norman Gray’s textpos doc. The textpos bundle can be found at tug.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.