Debian Codegraph @

texmf-dist/doc/latex/wrapfig/multiple-span.txt

raw
1 Using wrapfig to span multiple columns
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
4 Wrapfig can't automatically make matching cutouts in adjacent columns
5 because it doesn't know which text will land in just the right place
6 in the column next-door. It certainly can't handle floating in such
7 situations!
8
9 Here are some methods for doing such layout "by hand". They are
10 practical for one or a few such figures where you can tweak the
11 layout for the final copy. It is too painful to do this for long
12 or frequently-revised documents. If you do have multiple fiddling,
13 fix the first one in each chapter (or after any forced page break),
14 rerun, then fix the second, etc.
15
16 (These examples use calc.sty to evaluate overhangs in place.)
17
18 Cutouts in Matching Columns
19
20 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
21 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
22 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
23 ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y
24 ~~~~~~~~~ ~~~~~~~~~
25 ~~~~~~~~~ ~~~~~~~~~
26 ~~~~~~~~~ ~~~~~~~~~
27 ~~~~~~~~~ ~~~~~~~~~
28 ~~~~~~~~~ ~~~~~~~~~
29 ~~~~~~~~~ ~~~~~~~~~
30 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
31 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
32 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
33 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
34
35 Initially, write the document without the wrapfigure, and locate the
36 desired natural linebreak at "X". (This first step is used for all
37 methods described here.) Then change to
38
39 ~~~~~~~~X
40 \begin{wrapfigure}[6]{r}[.5\width+.5\columnsep]{6cm}
41 ...
42 \end{wrapfigure}
43 ~~~~....
44
45 and run LaTeX again. This will print the figure overlapping the right
46 column, but no matter. Use this run to locate position "Y" in the text.
47 For the final run, switch to:
48
49 ~~~~~~~~X
50 \begin{wrapfigure}[6]{r}[.5\width+.5\columnsep]{6cm}
51 ...
52 \end{wrapfigure}
53 ~~~~....
54 ...~~~~~~~Y
55 \begin{wrapfigure}[6]{l}[.5\width+.5\columnsep]{6cm}
56 \vfill
57 \end{wrapfigure}
58 ~~~~~~~~~~~
59
60
61 Taking a whole column plus a cutout
62
63 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
64 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
65 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
66 ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y
67 ~~~~~~~~~
68 ~~~~~~~~~
69 ~~~~~~~~~
70 ~~~~~~~~~
71 ~~~~~~~~~
72 ~~~~~~~~~
73 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
74 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
75 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
76 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
77
78 Locate "X" first, without any figure, as above, then write the
79 document like:
80
81 ~~~~~~~~X
82 \begin{wrapfigure}[6]{r}[\columnwidth+\columnsep]{9cm}
83 ...
84 \end{wrapfigure}
85 ~~~~....
86
87 and ignore the overprinting of the right column. Then, after locating
88 "Y" in the text, switch to:
89
90 ~~~~~~~~X
91 \begin{wrapfigure}[6]{r}[\columnwidth+\columnsep]{9cm}
92 ...
93 \end{wrapfigure}
94 ~~~~....
95 ...~~~~~~~Y\vspace{6\baselinskip}
96 ~~~~~~~~~~~
97 for the final layout
98
99
100 a whole column preceding a cutout
101
102 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
103 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
104 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
105 ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y
106 ~~~~~~~~~
107 ~~~~~~~~~
108 ~~~~~~~~~
109 ~~~~~~~~~
110 ~~~~~~~~~
111 ~~~~~~~~~
112 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
113 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
114 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
115 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
116
117 After locating "X", write the draft document like:
118
119 ~~~~~~~~X\vspace{6\baselinskip}
120 ~~~~....
121 ~~~~~~~~~~~~~
122 ~~~~~~~~~
123
124 run LaTeX to locate "Y", and then switch to:
125
126 ~~~~~~~~X\vspace{6\baselinskip}
127 ~~~~....
128 ~~~~~~~~~~~~~Y
129 \begin{wrapfigure}[6]{l}[\columnwidth+\columnsep]{9cm}
130 ...
131 \end{wrapfigure}
132 ~~~~~~~~~
133
134 Spanning (parts of) three columns
135
136 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
137 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
138 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
139 ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y ~~~~~~~~~~~~~~~~~Z
140 ~~~~~~~~~ ~~~~~~~~~
141 ~~~~~~~~~ ~~~~~~~~~
142 ~~~~~~~~~ ~~~~~~~~~
143 ~~~~~~~~~ ~~~~~~~~~
144 ~~~~~~~~~ ~~~~~~~~~
145 ~~~~~~~~~ ~~~~~~~~~
146 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
147 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
148 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
149 ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
150
151 This uses a combination of the above. First locate X, then use
152
153 ~~~~~~~~X
154 \begin{wrapfigure}[6]{r}[.5\width+.5\columnwidth+\columnsep]{12cm}
155 ...
156 \end{wrapfigure}
157 ~~~~....
158
159 Locate Y from this, and change to
160
161 ~~~~~~~~X
162 \begin{wrapfigure}[6]{r}[.5\width+.5\columnwidth+\columnsep]{12cm}
163 ...
164 \end{wrapfigure}
165 ~~~~....
166 ~~~~~~~~~~~~Y\vspace{6\baselineskip}
167 ~~~~~~~....
168
169 which allows you to locate Z, to end up with
170
171 ~~~~~~~~X
172 \begin{wrapfigure}[6]{r}[.5\width+.5\columnwidth+\columnsep]{12cm}
173 ...
174 \end{wrapfigure}
175 ~~~~....
176 ~~~~~~~~~~~~Y\vspace{6\baselineskip}
177 ~~~~~~~....
178 ~~~~~~~~~~~~Z
179 \begin{wrapfigure}[6]{l}[.5\width+.5\columnwidth+\columnsep]{12cm}
180 \vfill
181 \end{wrapfigure}
182
183
184
185
186 (Of course, to do matching cut-outs properly requires typesetting
187 the text to a grid.)