summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/sillypage/sillypage.sty
blob: 3bb8a4c03ff7eab3e71e9b38f38ab0cc959f998b (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
%%
%% This is file `sillypage.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% sillypage.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright 2022 Phelype Oleinik /phelype.oleinik@latex-project.org/
%%                Paulo Cereda /cereda.paulo@gmail.com/
%% 
%% This work 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
%% 
%%     http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\def\sillypageDate{2022-01-11}
\def\sillypageVersion{1.2}
\ProvidesPackage{sillypage}[\sillypageDate\space\sillypageVersion\space
  The silly walk as page numbering style]
\RequirePackage{graphicx}
\newcommand*\silly[1]{\expandafter\@silly\csname c@#1\endcsname}
\newcommand*\sillystep[1]{\@silly{#1}}
\newcommand*\@silly[1]{\expandafter\@silly@walk
  \expandafter{\number\numexpr#1\relax}}
\newcommand*\silly@steps{12}%
\newcommand*\silly@width{48px}%
\newcommand*\silly@height{.8cm}%
\newcommand*\silly@picture{sillywalk-map.png}%
\def\@silly@walk#1{%
  \@ifundefined{texorpdfstring}{\@firstoftwo}{\texorpdfstring}%
    {\@silly@walk@{#1}}% TeX
    {#1}}% pdf string
\def\@silly@walk@#1{%
  \ifnum#1>\silly@steps\space
    \expandafter\@silly@walk@\expandafter
      {\number\numexpr#1-\silly@steps\expandafter}%
  \else
    \expandafter\includegraphics\expanded{[height=\silly@height,trim={%
      \the\dimexpr\silly@width*(#1-1)\relax\space 0
      \the\dimexpr\silly@width*(\silly@steps-#1)\relax\space 0},clip]}%
        {\silly@picture}%
  \fi}
%% 
%% This work is "maintained" (as per the LPPL maintenance status)
%% by Phelype Oleinik and Paulo Cereda.
%% 
%% This work consists of the files sillypage.dtx, and
%%                                 sillypage.ins,
%% and the derived files           sillypage.sty,
%%                                 sillypage.pdf,
%%                                 sillywalk-map.png, and
%%                                 README.md.
%%
%% End of file `sillypage.sty'.