Debian Codegraph @

texmf-dist/doc/latex/textpos/examples/t9.tex

raw
1 %%% Testing: switching between absolute and relative mode
2
3 \documentclass{article}
4
5 \usepackage[absolute,showboxes]{textpos}
6 \setlength{\parindent}{0pt}
7 \TPHorizModule=1cm
8 \TPVertModule=1cm
9
10 \usepackage{color}
11
12 \begin{document}
13
14 Here is some text, which appears in the body of the page.
15 \begin{textblock}{5}(0,0)
16 This text is at (0,0), and should appear at the very top-left corner.
17 \end{textblock}
18
19 Here is more text, which also appears in the body.
20 \begin{textblock}{5}(1,1)
21 This text is at (1,1), and should appear near the top-left corner, 1cm
22 in and down.
23 \end{textblock}
24
25 \newpage
26 \TPoptions{ absolute=false,
27 showboxes = false}
28
29 Here is some text, which appears in the body of page two.
30 \begin{textblock}{5}(0,0)
31 This text is at (0,0), and appears at the top-left of the text block,
32 just under `Here is some text'.
33 It should not have a box around it.
34 \end{textblock}
35
36 \vskip4cm
37 Here is more text, which also appears in the body of p.2.
38 \begin{textblock}{5}(1,1)
39 This text is at (1,1), and also appears in the text block 1cm along
40 and down from the `Here is more text', and without a surrounding box.
41 \end{textblock}
42
43 \TPoptions{absolute=true, showboxes=true, showtext=false}
44
45 \vskip4cm
46 Text. The corresponding text block should appear only as a box, with
47 no text inside it. It appears in the top-left corner of the page.
48 \begin{textblock}{5}(0,0)
49 This text should not appear (just the box, positioned 2cm along and
50 down from `Text.'
51 \end{textblock}
52
53 \TPoptions{absolute=false, showboxes=true, showtext=true}
54
55 \vskip4cm
56 Text 2.
57 \begin{textblock}{5}(6,0)
58 This text should appear surrounded by a box, level with, but along from, `Text 2'.
59 \end{textblock}
60
61 \newpage
62 \TPoptions{absolute=true,overlay=true} % the overlay option is ignored
63
64 Page 3. Page 3. Page 3. Page 3. Page 3. Page 3. Page 3. Page 3.
65 Page 3. Page 3. Page 3. Page 3. Page 3. Page 3. Page 3. Page 3.
66
67 \begin{textblock}{5}(0,0)
68 This text appears at the extreme top-left of page three.
69 \end{textblock}
70
71 \textblockcolour{yellow}
72 \begin{textblock}{5}(4,4.5)
73 This text appears at (4,5). It appears \emph{below} the text: that
74 is, the \texttt{overlay=true} option is currently ignored (this
75 might potentially change in future, but I've no current plans to
76 implement that).
77 \end{textblock}
78
79 \end{document}