4 tools/3726: bug in calc package
7 \setlength and friends do not allow syntax allowed by LaTeX.
12 \documentclass{article}
14 \AUTHOR{Hendri Adriaens}
15 \PACKAGE{2005/08/06 v4.2 Infix arithmetic (KKT,FJ)}
21 \newcommand*\zzz{\yyy}
22 % this one doesn't work with calc v4.1b
30 % some hidden commands with spurious spaces.
31 \def\fakeminof{ \minof}
32 \def\fakemaxof{ \maxof}
33 \def\fakewidthof{ \widthof}
35 \totalheightof{\rule{10pt}{%
36 \totalheightof{\rule{11pt}{2pt}}}}
43 \newcommand\testsetlength[2]{\setlength#1{#2}\typeout{\the#1}}
44 \newcommand\testaddtolength[2]{\addtolength#1{#2}\typeout{\the#1}}
45 \newcommand\testsetcounter[2]{\setcounter{#1}{#2}\typeout{\the\value{#1}}}
46 \newcommand\testaddtocounter[2]{\addtocounter{#1}{#2}\typeout{\the\value{#1}}}
50 \settototalheight\lengthA{\rule{11pt}{2pt}}
51 \typeout{\the\lengthA}
54 \testsetlength\lengthA{\totalheightof{\rule{11pt}{2pt}}}
57 \testsetlength\lengthA{
58 \totalheightof{\rule{10pt}{\totalheightof{\rule{11pt}{2pt}}}}}
60 \testsetlength\lengthA{ \hiddenmacro}
62 \setlength\lengthB{ 5pt }
63 \testsetlength\lengthA{ 3pt - \testcasedim}
65 \testsetlength\lengthA{ \testcasedim +3pt }
67 \testsetlength\lengthA{
68 5pt + \maxof{ 5pt -10pt }{ \maxof{ 5pt -10pt }{0pt+1pt} }
71 \testsetlength\lengthA{
72 5pt + \maxof{ 5pt -10pt }{ \minof{ 5pt -10pt }{0pt+1pt} }
75 \testsetlength\lengthA{
76 5pt + \maxof{ 5pt -10pt }
77 { \minof{ 5pt -10pt }{0pt+1pt}*\ratio{1pt+1pt}{2pt} }
80 \testsetlength\lengthA{
81 5pt + \maxof{ 5pt -10pt }
82 { \minof{ 5pt -10pt }{0pt+1pt}*\minof{3+4}{1+1-1} }
85 \testsetlength\lengthA{
87 { \maxof{ -5pt }{1pt}/\minof{3+4}{1+1-1} }
90 \testsetlength\lengthA{
91 (5pt) \zzz \fakeminof{ \xxx }
92 { \fakemaxof{ -5pt }{1pt}/\fakeminof{3+4}{1+1-1} }
95 \testsetlength\lengthA{
96 (5pt) \zzz \fakeminof{ \fakewidthof{\rule{10pt}{10pt}}*\real{-1} }
97 { \fakemaxof{ -5pt }{1pt}/\fakeminof{3+4}{1+1-1} }
100 \testaddtolength\lengthA{5pt+\minof{100pt}{200pt}*\real{0}}
103 \testsetcounter{countA}{\maxof{4+4*-2}{3*3}}
105 \testsetcounter{countB}{\minof{4+4*-2}{3*3}}
107 \testsetcounter{countB}{\fakemaxof{ \value{countA}-\value{countB}}{0}}
109 \testsetcounter{countB}{
112 \minof{ \value{countB} }{ -10 * \real{2.5} }
117 \testsetcounter{countA}{
118 34 / \maxof{ \value{countA} }{ \value{countB} *\real{.5} }}
120 \testsetcounter{countA}{\value{countB}/\real{.2}}
122 \testsetcounter{countA}{\value{countA}*\real{-.5}}
124 \testaddtocounter{countB}{\value{countA}/5}