summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltlength.dtx
blob: f5b63ed35ea48b5fedf938624826a9c4a0604cd2 (plain)
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
% \iffalse meta-comment
%
% Copyright (C) 1993-2020
% The LaTeX3 Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
% -------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
%    https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.txt'. See also `legal.txt' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
%
% \fi
%
% \iffalse
%%% From File: ltlength.dtx
%
%<*driver>
% \fi
\ProvidesFile{ltlength.dtx}
             [2019/08/27 v1.1d LaTeX Kernel (Lengths)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltlength.dtx}
\title{\filename}
\date{\filedate}
 \author{%
  Johannes Braams\and
  David Carlisle\and
  Alan Jeffrey\and
  Leslie Lamport\and
  Frank Mittelbach\and
  Chris Rowley\and
  Rainer Sch\"opf}

\begin{document}
 \MaintainedByLaTeXTeam{latex}
 \maketitle
 \DocInput{\filename}
\end{document}
%</driver>
% \fi
%
%
% \changes{v1.0c}{1994/03/29}
%     {Create file ltcntlen from parts of ltmiscen and ltherest.}
% \changes{v1.1a}{1994/05/19}{Extract file ltlength from ltcntlen.}
% \changes{v1.1b}{1995/08/11}{Doc typos fixed for latex/753}
% \changes{v1.1d}{2019/08/27}{Make various command robust}
%
% \section{Lengths}
%
% \DescribeMacro{\newlength}
% Declare |#1| to be a new length command.
%
% \DescribeMacro{\setlength}
% Set the length command, |#1|, to the value |#2|.
%
% \DescribeMacro{\addtolength}
% Increase the value of  the length command, |#1|, by the value |#2|.
%
% \DescribeMacro{\settowidth}
% Set the length, |#1| to the width of a box containing |#2|.
%
% \DescribeMacro{\settoheight}
% Set the length, |#1| to the height of a box containing |#2|.
%
% \DescribeMacro{\settodepth}
% Set the length, |#1| to the depth of a box containing |#2|.
%
% \StopEventually{}
%
%    \begin{macrocode}
%<*2ekernel>
\message{lengths,}
%    \end{macrocode}
%
% \begin{macro}{\newlength}
%    \begin{macrocode}
\def\newlength#1{\@ifdefinable#1{\newskip#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\setlength}
% \changes{v1.1c}{2015/01/08}{add = to ensure first length argument is terminated.
%             (latexrelease)}
%    \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2015/01/01}%
%<latexrelease>                 {\setlength}{Using \setlength with \dimen0}%
%<*2ekernel|latexrelease>
%    \end{macrocode}
%    \begin{macrocode}
\def\setlength#1#2{#1 #2\relax}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease>                 {\setlength}{Using \setlength with \dimen0}%
%<latexrelease>\def\setlength#1#2{#1#2\relax}
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\addtolength}
% |\relax| added 24 Mar 86
%    \begin{macrocode}
\def\addtolength#1#2{\advance#1 #2\relax}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\settoheight}
% \changes{LaTeX2e}{1993/11/22}{Macro added}
% \begin{macro}{\settodepth}
% \changes{LaTeX2e}{1993/11/22}{Macro added}
% \begin{macro}{\settowidth}
% \begin{macro}{\@settodim}
% \changes{LaTeX2e}{1993/11/22}{Macro added}
% \changes{v1.0a}{1994/03/07}{(DPC) Extra group for colour}
%    The obvious analogs of |\settowidth|.
%    \begin{macrocode}
\def\@settodim#1#2#3{\setbox\@tempboxa\hbox{{#3}}#2#1\@tempboxa
%    \end{macrocode}
%    Clear the memory afterwards (which might be a lot).
%    \begin{macrocode}
       \setbox\@tempboxa\box\voidb@x}
\DeclareRobustCommand\settoheight{\@settodim\ht}
\DeclareRobustCommand\settodepth {\@settodim\dp}
\DeclareRobustCommand\settowidth {\@settodim\wd}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\@settopoint}
%    This macro takes the contents of the skip register that is
%    supplied as its argument and removes the fractional part to make
%    it a whole number of points. This can be used in class files to
%    avoid values like |345.4666666pt| when calulating a dimension.
% \changes{LaTeX2e}{1993/11/22}{Macro added}
%    \begin{macrocode}
\def\@settopoint#1{\divide#1\p@\multiply#1\p@}
%</2ekernel>
%    \end{macrocode}
% \end{macro}
%
% \Finale
%