Debian Codegraph @

test/functional/expected/length_units_latex.tex

raw
1 \documentclass[a4paper,landscape]{article}
2 % generated by Docutils <https://docutils.sourceforge.io/>
3 \usepackage{cmap} % fix search and cut-and-paste in Acrobat
4 \usepackage[T1]{fontenc}
5 \usepackage{float} % extended float configuration
6 \floatplacement{figure}{H} % place figures here definitely
7 \usepackage{graphicx}
8 \setcounter{secnumdepth}{0}
9 \usepackage{longtable,ltcaption,array}
10 \setlength{\extrarowheight}{2pt}
11 \newlength{\DUtablewidth} % internal use in tables
12 \newcommand{\DUcolumnwidth}[1]{\dimexpr#1\DUtablewidth-2\tabcolsep\relax}
13
14 %%% Custom LaTeX preamble
15 % PDF Standard Fonts
16 \usepackage{mathptmx} % Times
17 \usepackage[scaled=.90]{helvet}
18 \usepackage{courier}
19
20 %%% User specified packages and stylesheets
21 \usepackage{geometry}
22 \usepackage{nohyperref}
23
24 %%% Fallback definitions for Docutils-specific commands
25 \usepackage{docutils}[2026-05-06]
26
27 \ifdefined\DUchdimen % lengh unit "ch": width of a zero char
28 \else
29 \newlength{\DUchdimen}
30 \AtBeginDocument{\settowidth\DUchdimen{0}} % set after font setup,
31 % update with font changes (requires LaTeX > 2021-06-01, see lthooks-doc.pdf)
32 \AddToHook{cmd/selectfont/after}{\settowidth\DUchdimen{0}}
33 \fi
34
35 % hyperlinks:
36 \ifdefined\hypersetup
37 \else
38 \usepackage[hyperfootnotes=false,
39 colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
40 \usepackage{bookmark}
41 \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
42 \fi
43 \hypersetup{
44 pdftitle={Test length specifications},
45 }
46
47 %%% Body
48 \begin{document}
49 \title{Test length specifications}
50 \author{}
51 \date{}
52 \maketitle
53
54
55 \section{Images and Figures}
56
57 \begin{figure}
58 \noindent\makebox[\linewidth][c]{\includegraphics[scale=1]{../input/data/blue square.png}}
59 \caption{scale 100\%, no size specification}
60 \end{figure}
61
62 \begin{figure}
63 \noindent\makebox[\linewidth][c]{\includegraphics[width=0.25\linewidth]{../input/data/blue square.png}}
64 \caption{width 25\%, no height, figure width 50\%}
65 \end{figure}
66
67 \begin{figure}
68 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=0.25\linewidth]{../input/data/blue square.png}}
69 \caption{width 25\%, height 16px, figure width 50\%}
70 \end{figure}
71
72 \begin{figure}
73 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=10em]{../input/data/blue square.png}}
74 \caption{width 10 em, figure width 20 em}
75 \end{figure}
76
77 \begin{figure}
78 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=20ex]{../input/data/blue square.png}}
79 \caption{width 20 ex, figure width 40 ex}
80 \end{figure}
81
82 \begin{figure}
83 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=15\DUchdimen]{../input/data/blue square.png}}
84 \caption{width 15 ch, figure width 30 ch}
85 \end{figure}
86
87 \begin{figure}
88 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=10\DUremdimen]{../input/data/blue square.png}}
89 \caption{width 10 rem, figure width 20 rem}
90 \end{figure}
91
92 \begin{figure}
93 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=0.25\paperwidth]{../input/data/blue square.png}}
94 \caption{width 25 vw, figure width 30 vw}
95 \end{figure}
96
97 \begin{figure}
98 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=0.25\paperheight]{../input/data/blue square.png}}
99 \caption{width 25 vh, figure width 30 vh}
100 \end{figure}
101
102 \begin{figure}
103 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=25\DUvmindimen]{../input/data/blue square.png}}
104 \caption{width 25 vmin, figure width 30 vmin}
105 \end{figure}
106
107 \begin{figure}
108 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=25\DUvmaxdimen]{../input/data/blue square.png}}
109 \caption{width 25 vmax, figure width 30 vmax}
110 \end{figure}
111
112 \begin{figure}
113 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=5cm]{../input/data/blue square.png}}
114 \caption{width 5 cm, figure width 10 cm}
115 \end{figure}
116
117 \begin{figure}
118 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=50mm]{../input/data/blue square.png}}
119 \caption{width 50 mm, figure width 100 mm}
120 \end{figure}
121
122 \begin{figure}
123 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=50.0mm]{../input/data/blue square.png}}
124 \caption{width 200 Q, figure width 400 Q}
125 \end{figure}
126
127 \begin{figure}
128 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=2in]{../input/data/blue square.png}}
129 \caption{width 2 in, figure width 4 in}
130 \end{figure}
131
132 \begin{figure}
133 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=12pc]{../input/data/blue square.png}}
134 \caption{width 12 pc, figure width 24 pc}
135 \end{figure}
136
137 \begin{figure}
138 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=144bp]{../input/data/blue square.png}}
139 \caption{width 144 pt, figure width 288pt}
140 \end{figure}
141
142 \begin{figure}
143 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=192px]{../input/data/blue square.png}}
144 \caption{width 192 px, figure width 384 px}
145 \end{figure}
146
147 \begin{figure}
148 \noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=192bp]{../input/data/blue square.png}}
149 \caption{width 192 <no unit>, figure width 384 <no unit>}
150 \end{figure}
151
152
153 \section{ch, em, and rem: \includegraphics[height=1\DUchdimen]{../input/data/blue square.png} \includegraphics[height=1em]{../input/data/blue square.png} \includegraphics[height=1\DUremdimen]{../input/data/blue square.png}}
154
155 Image height 1ch, 1em, and 1rem: \includegraphics[height=1\DUchdimen]{../input/data/blue square.png} \includegraphics[height=1em]{../input/data/blue square.png} \includegraphics[height=1\DUremdimen]{../input/data/blue square.png}
156
157 The units \textquotedbl{}em\textquotedbl{} and \textquotedbl{}ch\textquotedbl{} change with the current font size.
158 The unit \textquotedbl{}rem\textquotedbl{} is tied to the document root fontsize.
159
160
161 \section{Tables}
162
163 \setlength{\DUtablewidth}{\dimexpr\linewidth-3\arrayrulewidth\relax}%
164 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
165 \hline
166
167 value
168 &
169 unit
170 \\
171 \hline
172 \end{longtable*}
173
174 \setlength{\DUtablewidth}{\dimexpr0.25\linewidth-3\arrayrulewidth\relax}%
175 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
176 \hline
177
178 25
179 &
180 \%
181 \\
182 \hline
183 \end{longtable*}
184
185 \setlength{\DUtablewidth}{\dimexpr10em-3\arrayrulewidth\relax}%
186 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
187 \hline
188
189 10
190 &
191 em
192 \\
193 \hline
194 \end{longtable*}
195
196 \setlength{\DUtablewidth}{\dimexpr20ex-3\arrayrulewidth\relax}%
197 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
198 \hline
199
200 20
201 &
202 ex
203 \\
204 \hline
205 \end{longtable*}
206
207 \setlength{\DUtablewidth}{\dimexpr15\DUchdimen-3\arrayrulewidth\relax}%
208 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
209 \hline
210
211 15
212 &
213 ch
214 \\
215 \hline
216 \end{longtable*}
217
218 \setlength{\DUtablewidth}{\dimexpr10\DUremdimen-3\arrayrulewidth\relax}%
219 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
220 \hline
221
222 10
223 &
224 rem
225 \\
226 \hline
227 \end{longtable*}
228
229 \setlength{\DUtablewidth}{\dimexpr0.25\paperwidth-3\arrayrulewidth\relax}%
230 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
231 \hline
232
233 25
234 &
235 vw
236 \\
237 \hline
238 \end{longtable*}
239
240 \setlength{\DUtablewidth}{\dimexpr0.25\paperheight-3\arrayrulewidth\relax}%
241 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
242 \hline
243
244 25
245 &
246 vh
247 \\
248 \hline
249 \end{longtable*}
250
251 \setlength{\DUtablewidth}{\dimexpr25\DUvmindimen-3\arrayrulewidth\relax}%
252 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
253 \hline
254
255 25
256 &
257 vmin
258 \\
259 \hline
260 \end{longtable*}
261
262 \setlength{\DUtablewidth}{\dimexpr25\DUvmaxdimen-3\arrayrulewidth\relax}%
263 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
264 \hline
265
266 25
267 &
268 vmax
269 \\
270 \hline
271 \end{longtable*}
272
273 \setlength{\DUtablewidth}{\dimexpr5cm-3\arrayrulewidth\relax}%
274 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
275 \hline
276
277 5
278 &
279 cm
280 \\
281 \hline
282 \end{longtable*}
283
284 \setlength{\DUtablewidth}{\dimexpr50mm-3\arrayrulewidth\relax}%
285 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
286 \hline
287
288 50
289 &
290 mm
291 \\
292 \hline
293 \end{longtable*}
294
295 \setlength{\DUtablewidth}{\dimexpr50.0mm-3\arrayrulewidth\relax}%
296 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
297 \hline
298
299 200
300 &
301 Q
302 \\
303 \hline
304 \end{longtable*}
305
306 \setlength{\DUtablewidth}{\dimexpr2in-3\arrayrulewidth\relax}%
307 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
308 \hline
309
310 2
311 &
312 in
313 \\
314 \hline
315 \end{longtable*}
316
317 \setlength{\DUtablewidth}{\dimexpr12pc-3\arrayrulewidth\relax}%
318 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
319 \hline
320
321 12
322 &
323 pc
324 \\
325 \hline
326 \end{longtable*}
327
328 \setlength{\DUtablewidth}{\dimexpr144bp-3\arrayrulewidth\relax}%
329 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
330 \hline
331
332 144
333 &
334 pt
335 \\
336 \hline
337 \end{longtable*}
338
339 \setlength{\DUtablewidth}{\dimexpr192px-3\arrayrulewidth\relax}%
340 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
341 \hline
342
343 192
344 &
345 px
346 \\
347 \hline
348 \end{longtable*}
349
350 \setlength{\DUtablewidth}{\dimexpr192bp-3\arrayrulewidth\relax}%
351 \begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
352 \hline
353
354 192
355 &
356 <no unit>
357 \\
358 \hline
359 \end{longtable*}
360
361 \end{document}