summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/textpos/examples/t11.tex
blob: e07c3572b06204b4d4f4647a6fc1250183bef1c4 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
%%% Testing: textblock in horizontal mode
%
% In textpos up to 1.9.1, a textblock in horizontal mode, with the
% [absolute] option, worked, in the sense of not failing, but produced
% ugly spacing, because in generating a `\par` it messed up
% inter-paragraph spacing.  This had the result that the text either
% side of the textblock appeared as separate paragraphs with no space
% between them.  The appearance in [relative] mode was OK, but with
% the `\par` visible.  This isn't a _bug_, since the documentation
% didn't say anything other than that a `\par` is inserted at this
% point, but it's not pretty.

\documentclass{article}

\parindent=0pt
\baselineskip=12pt

\usepackage[absolute]{textpos}
\usepackage{color}

\definecolor{Blue}{rgb}{0.9,0.9,1.0}
\definecolor{Red}{rgb}{1.0,0.5,0.5}
\textblockcolour{Blue}

% Make the textblock contents, and size, stand out
\def\content#1{\noindent
  \textcolor{Red}{\hbox to 1em{%
      \vrule height 9pt depth 3pt width 2pt %12 pt total
      \hss
      \vrule width 2pt }\relax
    #1}}

\begin{document}

\TPoptions{absolute=false}

Line 1.  Line 1a.               % no descenders on this line
% The sentence space between these should be the same as between these
% and 1bis
\begin{textblock}{5}(0,0)
\content{Relative, hmode}
\end{textblock}
Line \smash{1bis, preceded by sentence space}. % \smash, to ensure line has zero depth

Line 2 should be the usual baseline from 1.

\vskip 1cm

Line 3.

\begin{textblock}{5}(0,0)
\content{Relative, vmode}
\end{textblock}

Line 4.

Line 5 should be separated from line 4 by the same baseline as 4 from~3.

Line 6. Line 6a.
\begin{textblock*}{10cm}(0mm,0mm)
\content{Relative, hmode, star.}
\end{textblock*}
Line \smash{6bis, preceded by sentence space.}

Line 7. With second sentence.

\begin{textblock*}{10cm}(0mm,0mm)
\content{Relative, vmode, star.}
\end{textblock*}

Line 8 should be separated from 7 by the usual baseline.

\newpage
\TPoptions{absolute=true}

Line 9. Line 9a.
\begin{textblock}{5}(0,0)
\content{Absolute 1}
\end{textblock}
Line 9bis, preceded by sentence space.  % the smash doesn't matter in absolute mode

Line 10.

\begin{textblock*}{5cm}(0mm,10mm)
\content{Absolute 2}
\end{textblock*}

Line 11 should be separated from 10 by the usual baseline.

\end{document}