Skip to content

Commit

Permalink
deflength tests for etoolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev committed May 5, 2018
1 parent 6d2cc36 commit 75f4651
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
Binary file modified t/expansion/etoolbox.pdf
Binary file not shown.
27 changes: 26 additions & 1 deletion t/expansion/etoolbox.tex
Expand Up @@ -20,7 +20,7 @@
\mypath
% --- end overload test

% --- basic macros
% --- counters
\newcommand\basic{basic}
\robustify{\basic}
\protecting{\textit{\basic}}
Expand All @@ -29,4 +29,29 @@
\defcounter{countfour}{2+2}
\the\value{countfour}

% --- lengths
% source: https://tex.stackexchange.com/a/286171/78008
\newcommand{\etminof}[2]{%
\ifdimgreater{#1}{#2}{%
#2%
}{%
#1% Is smaller or equal
}%
}
\newcommand{\etmaxof}[2]{%
\ifdimgreater{#1}{#2}{%
#1%
}{%
#2% Is greater or equal
}%
}
\newlength{\foo}
\newlength{\foobar}
\deflength{\foo}{\etminof{1in}{2in}}
\deflength{\foobar}{\etmaxof{5in}{10in}}

\the\foo

\the\foobar

\end{document}
6 changes: 6 additions & 0 deletions t/expansion/etoolbox.xml
Expand Up @@ -20,4 +20,10 @@
<para xml:id="p5">
<p>4</p>
</para>
<para xml:id="p6">
<p>72.27pt</p>
</para>
<para xml:id="p7">
<p>722.7pt</p>
</para>
</document>

0 comments on commit 75f4651

Please sign in to comment.