File: length_units_latex.tex

package info (click to toggle)
python-docutils 0.22.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,508 kB
  • sloc: python: 54,189; lisp: 14,475; xml: 1,807; javascript: 1,032; makefile: 102; sh: 96
file content (368 lines) | stat: -rw-r--r-- 9,276 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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
\documentclass[a4paper,landscape]{article}
% generated by Docutils <https://docutils.sourceforge.io/>
\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage[T1]{fontenc}
\usepackage{float} % extended float configuration
\floatplacement{figure}{H} % place figures here definitely
\usepackage{graphicx}
\setcounter{secnumdepth}{0}
\usepackage{longtable,ltcaption,array}
\setlength{\extrarowheight}{2pt}
\newlength{\DUtablewidth} % internal use in tables
\newcommand{\DUcolumnwidth}[1]{\dimexpr#1\DUtablewidth-2\tabcolsep\relax}

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

%%% User specified packages and stylesheets
\usepackage{geometry}
\usepackage{nohyperref}

%%% Fallback definitions for Docutils-specific commands
\usepackage{docutils}[2025-08-06]

\ifdefined\DUchdimen  % lengh unit "ch": width of a zero char
\else
  \newlength{\DUchdimen}
  \AtBeginDocument{\settowidth\DUchdimen{0}}  % set after font setup,
  % update with font changes (requires LaTeX > 2021-06-01, see lthooks-doc.pdf)
  \AddToHook{cmd/selectfont/after}{\settowidth\DUchdimen{0}}
\fi

% hyperlinks:
\ifdefined\hypersetup
\else
  \usepackage[hyperfootnotes=false,
              colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
  \usepackage{bookmark}
  \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
\fi
\hypersetup{
  pdftitle={Test length specifications},
}

%%% Body
\begin{document}
\title{Test length specifications%
  \label{test-length-specifications}}
\author{}
\date{}
\maketitle


\section{Images and Figures%
  \label{images-and-figures}%
}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[scale=1]{../input/data/blue square.png}}
\caption{scale 100\%, no size specification}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[width=0.25\linewidth]{../input/data/blue square.png}}
\caption{width 25\%, no height, figure width 50\%}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=0.25\linewidth]{../input/data/blue square.png}}
\caption{width 25\%, height 16px, figure width 50\%}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=10em]{../input/data/blue square.png}}
\caption{width 10 em, figure width 20 em}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=20ex]{../input/data/blue square.png}}
\caption{width 20 ex, figure width 40 ex}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=15\DUchdimen]{../input/data/blue square.png}}
\caption{width 15 ch, figure width 30 ch}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=10\DUremdimen]{../input/data/blue square.png}}
\caption{width 10 rem, figure width 20 rem}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=0.25\paperwidth]{../input/data/blue square.png}}
\caption{width 25 vw, figure width 30 vw}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=0.25\paperheight]{../input/data/blue square.png}}
\caption{width 25 vh, figure width 30 vh}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=25\DUvmindimen]{../input/data/blue square.png}}
\caption{width 25 vmin, figure width 30 vmin}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=25\DUvmaxdimen]{../input/data/blue square.png}}
\caption{width 25 vmax, figure width 30 vmax}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=5cm]{../input/data/blue square.png}}
\caption{width 5 cm, figure width 10 cm}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=50mm]{../input/data/blue square.png}}
\caption{width 50 mm, figure width 100 mm}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=50.0mm]{../input/data/blue square.png}}
\caption{width 200 Q, figure width 400 Q}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=2in]{../input/data/blue square.png}}
\caption{width 2 in, figure width 4 in}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=12pc]{../input/data/blue square.png}}
\caption{width 12 pc, figure width 24 pc}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=144bp]{../input/data/blue square.png}}
\caption{width 144 pt, figure width 288pt}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=192px]{../input/data/blue square.png}}
\caption{width 192 px, figure width 384 px}
\end{figure}

\begin{figure}
\noindent\makebox[\linewidth][c]{\includegraphics[height=16px,width=192bp]{../input/data/blue square.png}}
\caption{width 192 <no unit>, figure width 384 <no unit>}
\end{figure}


\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}%
  \label{ch-em-and-rem-test1ch-test1em-test1rem}%
}

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}

The units \textquotedbl{}em\textquotedbl{} and \textquotedbl{}ch\textquotedbl{} change with the current font size.
The unit \textquotedbl{}rem\textquotedbl{} is tied to the document root fontsize.


\section{Tables%
  \label{tables}%
}

\setlength{\DUtablewidth}{\dimexpr\linewidth-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

value
 & 
unit
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr0.25\linewidth-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

25
 & 
\%
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr10em-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

10
 & 
em
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr20ex-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

20
 & 
ex
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr15\DUchdimen-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

15
 & 
ch
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr10\DUremdimen-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

10
 & 
rem
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr0.25\paperwidth-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

25
 & 
vw
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr0.25\paperheight-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

25
 & 
vh
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr25\DUvmindimen-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

25
 & 
vmin
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr25\DUvmaxdimen-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

25
 & 
vmax
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr5cm-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

5
 & 
cm
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr50mm-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

50
 & 
mm
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr50.0mm-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

200
 & 
Q
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr2in-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

2
 & 
in
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr12pc-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

12
 & 
pc
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr144bp-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

144
 & 
pt
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr192px-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

192
 & 
px
 \\
\hline
\end{longtable*}

\setlength{\DUtablewidth}{\dimexpr192bp-3\arrayrulewidth\relax}%
\begin{longtable*}{|p{\DUcolumnwidth{0.500}}|p{\DUcolumnwidth{0.500}}|}
\hline

192
 & 
<no unit>
 \\
\hline
\end{longtable*}

\end{document}