summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/geometry/test/gcheck.sty
blob: 787e5e5b7c5f549679316eacb7678befa32abf25 (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
\usepackage{calc}

\newif\ifcheckpass
\checkpasstrue

\def\checkresults{%
  \ifcheckpass
    \typeout{---^^JTest (\jobname): success.^^J---}
  \else
    \typeout{---^^JTest (\jobname): FAILED.\@spaces Check \jobname.log.^^J---}
  \fi
}

\def\dcheck#1#2{%
  \setlength\@tempdima{#2}%
  \setlength\@tempdimb{#2}%
  \addtolength\@tempdimb{-#1}%
  \@tempcnta=\z@
  \ifdim\@tempdimb > -0.01pt
    \ifdim\@tempdimb < 0.01pt
      \@tempcnta=\@ne
      \wlog{OK: #1= \the#1 (diff=\the\@tempdimb).}
    \fi
  \fi
  \ifnum\@tempcnta=\z@
    \checkpassfalse
    \immediate\typeout{NG: #1= \the#1 (expected=\the\@tempdima).}
  \fi}

\def\ccheck#1#2{%
  \edef\@@tempa{#2}
  \@tempcnta=\@@tempa
  \advance\@tempcnta-#1\relax
  \ifnum\@tempcnta=\z@
    \wlog{OK: #1= \the#1 (diff=\the\@tempcnta).}
  \else
    \checkpassfalse
    \immediate\typeout{NG: #1= \the#1 (expected=\@@tempa).}
  \fi}

\def\nompstring{\renewcommand\mynote\relax}

\newcommand\mynote{\marginpar%
[\raggedright\rule{\marginparwidth}{.7pt}\\A left side note.]%
{\raggedright\rule{\marginparwidth}{.7pt}\\A side note.}}%
\def\fox{A quick brown fox jumps over the lazy dog. }
\def\fivefoxes{\fox\fox\fox\fox\fox}
\def\manyfoxes{\fivefoxes\mynote\fivefoxes\par\fivefoxes\fivefoxes\par}
% \let\mynote\relax % removes marginal notes.