1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
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 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
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
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.
31 %%% From File: ltlength.dtx
35 \ProvidesFile{ltlength.dtx}
36 [2015/01/08 v1.1c LaTeX Kernel (Lengths)]
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltlength.dtx}
52 \MaintainedByLaTeXTeam{latex}
61 % \changes{v1.0c}{1994/03/29}
62 % {Create file ltcntlen from parts of ltmiscen and ltherest.}
63 % \changes{v1.1a}{1994/05/19}
64 % {Extract file ltlength from ltcntlen.}
65 % \changes{v1.1b}{1995/08/11}
66 % {Doc typos fixed for latex/753}
70 % \DescribeMacro{\newlength}
71 % Declare |#1| to be a new length command.
73 % \DescribeMacro{\setlength}
74 % Set the length command, |#1|, to the value |#2|.
76 % \DescribeMacro{\addtolength}
77 % Increase the value of the length command, |#1|, by the value |#2|.
79 % \DescribeMacro{\settowidth}
80 % Set the length, |#1| to the width of a box containing |#2|.
82 % \DescribeMacro{\settoheight}
83 % Set the length, |#1| to the height of a box containing |#2|.
85 % \DescribeMacro{\settodepth}
86 % Set the length, |#1| to the depth of a box containing |#2|.
95 % \begin{macro}{\newlength}
97 \def\newlength#1{\@ifdefinable#1{\newskip#1}}
101 % \begin{macro}{\setlength}
102 % \changes{v1.1c}{2015/01/08}{add = to ensure first length argument is terminated.
106 %<latexrelease>\IncludeInRelease{2015/01/01}%
107 %<latexrelease> {\setlength}{Using \setlength with \dimen0}%
108 %<*2ekernel|latexrelease>
111 \def\setlength#1#2{#1 #2\relax}
112 %</2ekernel|latexrelease>
113 %<latexrelease>\EndIncludeInRelease
114 %<latexrelease>\IncludeInRelease{0000/00/00}%
115 %<latexrelease> {\setlength}{Using \setlength with \dimen0}%
116 %<latexrelease>\def\setlength#1#2{#1#2\relax}
117 %<latexrelease>\EndIncludeInRelease
122 % \begin{macro}{\addtolength}
123 % |\relax| added 24 Mar 86
125 \def\addtolength#1#2{\advance#1 #2\relax}
130 % \begin{macro}{\settoheight}
131 % \changes{LaTeX2e}{1993/11/22}{Macro added}
132 % \begin{macro}{\settodepth}
133 % \changes{LaTeX2e}{1993/11/22}{Macro added}
134 % \begin{macro}{\settowidth}
135 % \begin{macro}{\@settodim}
136 % \changes{LaTeX2e}{1993/11/22}{Macro added}
137 % \changes{v1.0a}{1994/03/07}{(DPC) Extra group for colour}
138 % The obvious analogs of |\settowidth|.
140 \def\@settodim#1#2#3{\setbox\@tempboxa\hbox{{#3}}#2#1\@tempboxa
142 % Clear the memory afterwards (which might be a lot).
144 \setbox\@tempboxa\box\voidb@x}
145 \def\settoheight{\@settodim\ht}
146 \def\settodepth {\@settodim\dp}
147 \def\settowidth {\@settodim\wd}
155 % \begin{macro}{\@settopoint}
156 % This macro takes the contents of the skip register that is
157 % supplied as its argument and removes the fractional part to make
158 % it a whole number of points. This can be used in class files to
159 % avoid values like |345.4666666pt| when calulating a dimension.
160 % \changes{LaTeX2e}{1993/11/22}{Macro added}
162 \def\@settopoint#1{\divide#1\p@\multiply#1\p@}