Debian Codegraph @

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

raw
1 %%% Testing:colours, borders and margins
2 \documentclass{article}
3
4 \usepackage{textpos}
5 \usepackage{color}
6
7 \setlength{\TPHorizModule}{20pt}
8 \setlength{\TPVertModule}\TPHorizModule
9
10 \setlength\parindent{0pt}
11 \pagestyle{empty}
12
13 \begin{document}
14
15 \definecolor{Blue}{rgb}{0.8,0.8,1.0}
16 \definecolor{Borders}{rgb}{0.8,1.0,0.8}
17
18 \begin{textblock}{4}(0,0)
19 \textblockcolour{Blue}
20 Blue
21 \end{textblock}
22
23 \begin{textblock}{12}(4,-1)
24 \hrule width 12\TPHorizModule
25 \vbox to 0pt{\hbox{12 units}\vss}
26 \vskip1\TPVertModule
27 \hrule width 8\TPHorizModule
28 \vbox to 0pt{\hbox{8 units}\vss}
29 \vskip1\TPVertModule
30 \hrule width 4\TPHorizModule
31 \vbox to 0pt{\hbox{4 units}\vss}
32 \vskip1\TPVertModule
33 \hrule width 2\TPHorizModule
34 \vbox to 0pt{\hbox{2 units}\vss}
35 \vskip1\TPVertModule
36 \hrule width 1\TPHorizModule
37 \end{textblock}
38
39 \begin{textblock}{12}(4,4)
40 This text is inside a box with a blue background. The text is flush
41 with the edge of the box, and the whole thing is twelve units wide.
42
43 There's a second paragraph in here.
44 \begin{itemize}
45 \item Here is a list item. It should be appropriately narrower than
46 the text around it, and specifically not abut the border.
47 \item Here is a second item.
48 \end{itemize}
49 \end{textblock}
50
51 \TPshowboxestrue
52 \textblockrulecolour{red}
53 \setlength\TPboxrulesize{0.25\TPHorizModule}
54
55 \TPMargin{1\TPHorizModule}
56
57 \begin{textblock}{4}(0,7)
58 \textblockcolour{Blue}
59 Blue
60 \end{textblock}
61
62 \begin{textblock}{12}(4,11)
63 This text is also inside a box with a blue background. However,
64 this time, there's a red border and a margin. The box as a whole is
65 twelve units wide, and the text is correspondingly narrower.
66 \begin{itemize}
67 \item Here is a list item. It should be appropriately narrower than
68 the text around it, and specifically not abut the border.
69 \item Here is a second item.
70 \end{itemize}
71 \end{textblock}
72
73 \TPMargin*{1\TPHorizModule}
74
75 \begin{textblock}{4}(0,19)
76 \textblockcolour{Blue}
77 Blue
78 \end{textblock}
79 \tekstblokroolkulur{Borders}
80
81 \begin{textblock}{12}(4,21)
82 Finally, here is some text on a blue background with an
83 unattractive green border. This time, the text is twelve units wide,
84 and the box, and its border, is consequently wider than that.
85 \begin{itemize}
86 \item Here is a list item. It should be appropriately narrower than
87 the text around it, and specifically not abut the border.
88 \item Here is a second item.
89 \end{itemize}
90 Here's some final text, and a quotation:
91 \begin{quotation}
92 \noindent
93 You shall see them on a beautiful quarto page, where a neat rivulet
94 of text shall meander through a meadow of
95 margin.
96 \hfil\penalty50\hskip2em\hbox{}\nobreak\hfil
97 \emph{--- Sheridan, The School for Scandal}\parfillskip=0pt
98 \end{quotation}
99 \end{textblock}
100
101
102 \end{document}
103