-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpocketmod.sty
61 lines (55 loc) · 2.8 KB
/
pocketmod.sty
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
%% Quick hack by LianTze Lim ([email protected])
\ProvidesPackage{pocketmod}[2023/11/10 package pocketmod.sty by LianTze Lim ([email protected])]
\newif\if@showmarks\@showmarksfalse
\DeclareOption{showmarks}{
\@showmarkstrue
}
\ProcessOptions
\RequirePackage{ifxetex}
\ifxetex
\def\pgfsysdriver{pgfsys-dvipdfmx.def}
\fi
\RequirePackage{pgfpages}
\pgfpagesuselayout{8 on 1}
\newlength{\@adjlength}
\pgfmathsetmacro{\@myratio}{0.25*\paperheight/\paperwidth}
\pgfmathsetlength{\@adjlength}{(\@myratio * \paperheight)/2}
\pgfpageslogicalpageoptions{1}{
center=\pgfpoint{.125\pgfphysicalwidth}{.5\pgfphysicalheight - \@adjlength},%
rotation=180%
}
\pgfpageslogicalpageoptions{2}{
center=\pgfpoint{.125\pgfphysicalwidth}{.5\pgfphysicalheight + \@adjlength}%
}
\pgfpageslogicalpageoptions{3}{
center=\pgfpoint{.375\pgfphysicalwidth}{.5\pgfphysicalheight + \@adjlength}%
}
\pgfpageslogicalpageoptions{4}{
center=\pgfpoint{.625\pgfphysicalwidth}{.5\pgfphysicalheight + \@adjlength}%
}
\pgfpageslogicalpageoptions{5}{
center=\pgfpoint{.875\pgfphysicalwidth}{.5\pgfphysicalheight + \@adjlength}%
}
\pgfpageslogicalpageoptions{6}{
center=\pgfpoint{.875\pgfphysicalwidth}{.5\pgfphysicalheight - \@adjlength},%
rotation=180
}
\pgfpageslogicalpageoptions{7}{
center=\pgfpoint{.625\pgfphysicalwidth}{.5\pgfphysicalheight - \@adjlength},
rotation=180
}
\pgfpageslogicalpageoptions{8}{
center=\pgfpoint{.375\pgfphysicalwidth}{.5\pgfphysicalheight - \@adjlength},%
rotation=180
}
\if@showmarks
\RequirePackage{pgf}
\pgfpageslogicalpageoptions{1}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\pgfpageslogicalpageoptions{2}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\pgfpageslogicalpageoptions{3}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\pgfpageslogicalpageoptions{4}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\pgfpageslogicalpageoptions{5}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\pgfpageslogicalpageoptions{6}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\pgfpageslogicalpageoptions{7}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\pgfpageslogicalpageoptions{8}{border code=\pgfsetlinewidth{0.4pt}\pgfsetstrokecolor{gray!40}\pgfsetdash{{0.2in}{0.2in}}{0pt}\pgfusepath{stroke}\pgfsetdash{}{0pt}}
\fi