File: latex_cornercases.tex

package info (click to toggle)
python-docutils 0.14%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,976 kB
  • sloc: python: 44,718; lisp: 14,476; xml: 1,782; sh: 167; makefile: 150
file content (344 lines) | stat: -rw-r--r-- 5,651 bytes parent folder | download
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
\documentclass[a4paper]{article}
% generated by Docutils <http://docutils.sourceforge.net/>
\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{multirow}
\setcounter{secnumdepth}{0}
\usepackage{longtable,ltcaption,array}
\setlength{\extrarowheight}{2pt}
\newlength{\DUtablewidth} % internal use in tables

%%% Custom LaTeX preamble
% PDF Standard Fonts
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}

%%% User specified packages and stylesheets

%%% Fallback definitions for Docutils-specific commands

% transition (break, fancybreak, anonymous section)
\providecommand*{\DUtransition}{%
  \hspace*{\fill}\hrulefill\hspace*{\fill}
  \vskip 0.5\baselineskip
}

% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
  \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
  \usepackage{bookmark}
  \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}
\hypersetup{
  pdftitle={Some Tests for the LaTeX Writer},
}

%%% Title Data
\title{\phantomsection%
  Some Tests for the LaTeX Writer%
  \label{some-tests-for-the-latex-writer}}
\author{}
\date{}

%%% Body
\begin{document}
\maketitle

These tests contain unusual combinations of syntax elements which may cause
trouble for the LaTeX writer but do not need to be tested with other writers.


\section{Block Quotes%
  \label{block-quotes}%
}

\begin{quote}
This block quote comes directly after the section heading and is
followed by a paragraph.

This is the second paragraph of the block quote and it contains
some more text filling up some space which would otherwise be
empty.
\nopagebreak

\raggedleft —Attribution
\end{quote}

This is a paragraph.

\begin{quote}
This block quote does not have an attribution.
\end{quote}

This is another paragraph.

\begin{quote}
Another block quote at the end of the section.
\end{quote}


\section{More Block Quotes%
  \label{more-block-quotes}%
}

\begin{quote}
Block quote followed by a transition.
\end{quote}

%___________________________________________________________________________
\DUtransition

\begin{quote}
Another block quote.
\end{quote}


\section{Images%
  \label{images}%
}

Image with 20\% width:

\includegraphics[width=0.200\linewidth]{../../../docs/user/rst/images/title.png}

Image with 100\% width:

\includegraphics[width=1.000\linewidth]{../../../docs/user/rst/images/title.png}


\section{Rowspanning tables%
  \label{rowspanning-tables}%
}

Several rowspanning cells in a table.

Problem:

In LaTeX, \textquotedbl{}overwritten\textquotedbl{} cells need to be defined as empty cells.

Docutils (similarily to HTML) uses is the \textquotedbl{}Exchange Table Model\textquotedbl{} (also known
as CALS tables, see docs/ref/soextblx.dtd) which defines only the remaining
cells in a row \textquotedbl{}affected\textquotedbl{} by multirow cells.

Therefore, visit\_entry() is only called for the remaining cells and the
LaTeX writer needs bookkeeping to write out the required number of extra
'\&'s.

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.075\DUtablewidth}|p{0.133\DUtablewidth}|p{0.133\DUtablewidth}|p{0.086\DUtablewidth}|}
\hline

11
 & 
12
 & 
13
 & 
14
 \\
\hline

21
 & \multirow{2}{0.13\DUtablewidth}{%
2/3 2
} & \multirow{3}{0.13\DUtablewidth}{%
2…4 3
} & 
24
 \\
\cline{1-1}
\cline{4-4}

31
 &  &  & 
34
 \\
\cline{1-1}
\cline{2-2}
\cline{4-4}

41
 & 
42
 &  & 
14
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.098\DUtablewidth}|p{0.098\DUtablewidth}|p{0.063\DUtablewidth}|}
\hline

11
 & 
12
 & 
13
 \\
\hline
\multirow{2}{0.10\DUtablewidth}{%
2/3 1
} & \multirow{2}{0.10\DUtablewidth}{%
2/3 2
} & 
23
 \\
\cline{3-3}
 &  & 
33
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.098\DUtablewidth}|p{0.063\DUtablewidth}|}
\hline

11
 & 
12
 \\
\hline
\multirow{2}{0.10\DUtablewidth}{%
2/3 1
} & 
22
 \\
\cline{2-2}
 & 
32
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.063\DUtablewidth}|p{0.110\DUtablewidth}|p{0.063\DUtablewidth}|}
\hline

11
 & 
12
 & 
13
 \\
\hline

21
 & \multirow{2}{0.11\DUtablewidth}{%
2/3 2
} & 
23
 \\
\cline{1-1}
\cline{3-3}

31
 &  & 
33
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.063\DUtablewidth}|p{0.110\DUtablewidth}|}
\hline

11
 & 
12
 \\
\hline

21
 & \multirow{2}{0.11\DUtablewidth}{%
2/3 1
} \\
\cline{1-1}

31
 &  \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.063\DUtablewidth}|p{0.110\DUtablewidth}|}
\hline

11
 & \multirow{2}{0.11\DUtablewidth}{%
1/2 1
} \\
\cline{1-1}

21
 &  \\
\hline

31
 & 
32
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.063\DUtablewidth}|p{0.156\DUtablewidth}|p{0.110\DUtablewidth}|}
\hline

11
 & \multirow{2}{0.16\DUtablewidth}{%
1/2 2
} & \multirow{2}{0.11\DUtablewidth}{%
1/2 3
} \\
\cline{1-1}

21
 &  &  \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.098\DUtablewidth}|p{0.063\DUtablewidth}|p{0.110\DUtablewidth}|}
\hline
\multirow{2}{0.10\DUtablewidth}{%
1/2 3
} & 
12
 & \multirow{2}{0.11\DUtablewidth}{%
1/2 3
} \\
\cline{2-2}
 & 
22
 &  \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.098\DUtablewidth}|p{0.063\DUtablewidth}|}
\hline
\multirow{2}{0.10\DUtablewidth}{%
1/2 3
} & 
12
 \\
\cline{2-2}
 & 
22
 \\
\hline

31
 & 
32
 \\
\hline
\end{longtable*}

\end{document}