Debian Codegraph @

texmf-dist/source/latex/base/ltlength.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2025
4 % The LaTeX Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % https://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2008 or later.
17 %
18 % This file has the LPPL maintenance status "maintained".
19 %
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23 %
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
27 %
28 % \fi
29 %
30 % \iffalse
31 %%% From File: ltlength.dtx
32 %
33 %<*driver>
34 % \fi
35 \ProvidesFile{ltlength.dtx}
36 [2024/09/04 v1.1e LaTeX Kernel (Lengths)]
37 % \iffalse
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltlength.dtx}
40 \title{\filename}
41 \date{\filedate}
42 \author{%
43 Johannes Braams\and
44 David Carlisle\and
45 Alan Jeffrey\and
46 Leslie Lamport\and
47 Frank Mittelbach\and
48 Chris Rowley\and
49 Rainer Sch\"opf}
50
51 \begin{document}
52 \MaintainedByLaTeXTeam{latex}
53 \maketitle
54 \DocInput{\filename}
55 \end{document}
56 %</driver>
57 % \fi
58 %
59 %
60 % \changes{v1.0c}{1994/03/29}
61 % {Create file ltcntlen from parts of ltmiscen and ltherest.}
62 % \changes{v1.1a}{1994/05/19}{Extract file ltlength from ltcntlen.}
63 % \changes{v1.1b}{1995/08/11}{Doc typos fixed for latex/753}
64 % \changes{v1.1d}{2019/08/27}{Make various command robust}
65 %
66 % \section{Lengths}
67 %
68 % \DescribeMacro{\newlength}
69 % Declare |#1| to be a new length command.
70 %
71 % \DescribeMacro{\setlength}
72 % Set the length command, |#1|, to the value |#2|.
73 %
74 % \DescribeMacro{\addtolength}
75 % Increase the value of the length command, |#1|, by the value |#2|.
76 %
77 % \DescribeMacro{\settowidth}
78 % Set the length, |#1| to the width of a box containing |#2|.
79 %
80 % \DescribeMacro{\settoheight}
81 % Set the length, |#1| to the height of a box containing |#2|.
82 %
83 % \DescribeMacro{\settodepth}
84 % Set the length, |#1| to the depth of a box containing |#2|.
85 %
86 % \MaybeStop{}
87 %
88 % \begin{macrocode}
89 %<*2ekernel>
90 \message{lengths,}
91 % \end{macrocode}
92 %
93 % \begin{macro}{\newlength}
94 % \begin{macrocode}
95 \def\newlength#1{\@ifdefinable#1{\newskip#1}}
96 % \end{macrocode}
97 % \end{macro}
98 %
99 % \begin{macro}{\setlength}
100 % \changes{v1.1c}{2015/01/08}{add = to ensure first length argument is terminated.
101 % (latexrelease)}
102 % \begin{macrocode}
103 %</2ekernel>
104 %<latexrelease>\IncludeInRelease{2015/01/01}%
105 %<latexrelease> {\setlength}{Using \setlength with \dimen0}%
106 %<*2ekernel|latexrelease>
107 % \end{macrocode}
108 % \begin{macrocode}
109 \def\setlength#1#2{#1 #2\relax}
110 %</2ekernel|latexrelease>
111 %<latexrelease>\EndIncludeInRelease
112 %<latexrelease>\IncludeInRelease{0000/00/00}%
113 %<latexrelease> {\setlength}{Using \setlength with \dimen0}%
114 %<latexrelease>\def\setlength#1#2{#1#2\relax}
115 %<latexrelease>\EndIncludeInRelease
116 %<*2ekernel>
117 % \end{macrocode}
118 % \end{macro}
119 %
120 % \begin{macro}{\addtolength}
121 % |\relax| added 24 Mar 86
122 % \begin{macrocode}
123 \def\addtolength#1#2{\advance#1 #2\relax}
124 % \end{macrocode}
125 % \end{macro}
126 %
127 %
128 % \begin{macro}{\settoheight}
129 % \changes{LaTeX2e}{1993/11/22}{Macro added}
130 % \begin{macro}{\settodepth}
131 % \changes{LaTeX2e}{1993/11/22}{Macro added}
132 % \begin{macro}{\settowidth}
133 % \begin{macro}{\@settodim}
134 % \changes{LaTeX2e}{1993/11/22}{Macro added}
135 % \changes{v1.0a}{1994/03/07}{(DPC) Extra group for colour}
136 % \changes{v1.1e}{2024/09/04}{(UF) Suspend tagging}
137 % The obvious analogs of |\settowidth|.
138 % \begin{macrocode}
139 %</2ekernel>
140 %<*2ekernel|latexrelease>
141 %<latexrelease>\IncludeInRelease{2024/11/01}%
142 %<latexrelease> {\@settodim}{suspend tagging}%
143 \def\@settodim#1#2#3{\setbox\@tempboxa\hbox
144 {{\SuspendTagging{\@settodim}#3\ResumeTagging{\@settodim}}}#2#1\@tempboxa
145 % \end{macrocode}
146 % Clear the memory afterwards (which might be a lot).
147 % \begin{macrocode}
148 \setbox\@tempboxa\box\voidb@x}
149 %</2ekernel|latexrelease>
150 %<latexrelease>\EndIncludeInRelease
151 % \end{macrocode}
152 % \begin{macrocode}
153 %<latexrelease>\IncludeInRelease{0000/00/00}%
154 %<latexrelease> {\@settodim}{suspend tagging}%
155 %<latexrelease>\def\@settodim#1#2#3{\setbox\@tempboxa\hbox{{#3}}#2#1\@tempboxa
156 %<latexrelease> \setbox\@tempboxa\box\voidb@x}
157 %<latexrelease>\EndIncludeInRelease
158 %<*2ekernel>
159 % \end{macrocode}
160 % \begin{macrocode}
161 \DeclareRobustCommand\settoheight{\@settodim\ht}
162 \DeclareRobustCommand\settodepth {\@settodim\dp}
163 \DeclareRobustCommand\settowidth {\@settodim\wd}
164 % \end{macrocode}
165 % \end{macro}
166 % \end{macro}
167 % \end{macro}
168 % \end{macro}
169 %
170 %
171 % \begin{macro}{\@settopoint}
172 % This macro takes the contents of the skip register that is
173 % supplied as its argument and removes the fractional part to make
174 % it a whole number of points. This can be used in class files to
175 % avoid values like |345.4666666pt| when calculating a dimension.
176 % \changes{LaTeX2e}{1993/11/22}{Macro added}
177 % \begin{macrocode}
178 \def\@settopoint#1{\divide#1\p@\multiply#1\p@}
179 %</2ekernel>
180 % \end{macrocode}
181 % \end{macro}
182 %
183 % \Finale
184 %