summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/textpos/examples/t10.tex
blob: 3c8677353d8c00162eb6d9d2fcbd530c56f6222a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
%%% Testing:interactions between (x,y)-positioning and \TPMargin
% See https://bitbucket.org/nxg/textpos/issues/3/
% Thanks to Richard Schreiber for the report and initial test code.

\documentclass{minimal}
\usepackage[top=0mm,bottom=0mm,left=0mm,right=0mm,a5paper]{geometry}
\usepackage{color}
\usepackage[absolute,showboxes]{textpos}

\parindent0mm
\begin{document}

\textblockrulecolour{magenta}
\TPGrid[0mm,0mm]{6}{9}%
\TPMargin{5mm}%

\null\vskip 4cm
\noindent \hrule width 2\TPHorizModule
\smallskip
\hbox to 2\TPHorizModule{$\leftarrow$\hfil two units wide\hfil $\rightarrow$}

\begin{textblock}{2}(0,0)
  This box is top-left.
  The top and left margin lines touch the edge of the page.
\end{textblock}

\begin{textblock}{2}[0,1](0,9)
  This box should sit at the bottom left.
  The box should be two units wide, and the text correspondingly narrower.
  The bottom and left margin lines should touch the edge of the page.
\end{textblock}

\TPMargin*{5mm}
\begin{textblock}{2}[1,0](6,0)
  This box should sit at the top right of the page, and the text
  should be two units wide.  The top and right margin lines should be
  off the page.
\end{textblock}

\TPMargin{0mm}%
\begin{textblock}{2}[1,1](6,9)
  This box sits at the bottom right edge.
  The text and box are two units wide.
  The bottom and right margin lines touch the edge of the page.
\end{textblock}
\end{document}