-
Notifications
You must be signed in to change notification settings - Fork 0
/
review-cover.sty
176 lines (156 loc) · 6.3 KB
/
review-cover.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{review-cover}[2019/05/18 v1.1]
\makeatletter
\newif\ifrv@debug\rv@debugfalse
\newif\ifrv@debugmore\rv@debugmorefalse
\newif\ifrvonlyone\rvonlyonefalse
\newif\ifrv@newjis\rv@newjistrue
\DeclareOptionX{paper}[b5]{\gdef\rvpaper{#1}}
\DeclareOptionX{spine}[0mm]{\gdef\rvspinewidth{#1}}
\DeclareOptionX{debug}[false]{\csname rv@debug#1\endcsname} % デバッグモード
\DeclareOptionX{debugmore}[false]{\csname rv@debugmore#1\endcsname} % さらに位置表示付き
\DeclareOptionX{onlyone}[false]{\csname rvonlyone#1\endcsname} % 表1だけにするか
\DeclareOptionX{pxchfonmap}[noto-otc]{\gdef\rvpxchfonmap{#1}} % pxchfonのマップ
\DeclareOptionX{newjis}[true]{\csname rv@newjis#1\endcsname} % JIS2004にするか
\ExecuteOptionsX{paper,spine,debug,debugmore,onlyone,pxchfonmap,newjis}
\ProcessOptionsX\relax
% パッケージ
\usepackage{plext}
\usepackage{tikz}
\ifrv@newjis
\def\rv@otfopt{jis2004}
\def\rv@pxchfonopt{prefer2004jis}
\else
\def\rv@otfopt{}
\def\rv@pxchfonopt{}
\fi
\usepackage[uplatex,deluxe,expert,\rv@otfopt]{otf}
\usepackage[alphabet,relfont,\rvpxchfonmap,\rv@pxchfonopt]{pxchfon}
\newlength{\rvpaperwidth}
\newlength{\rvpaperheight}
\def\rv@tmp{b5}\ifx\rvpaper\rv@tmp
\setlength{\rvpaperwidth}{182mm}
\setlength{\rvpaperheight}{257mm}
\else\def\rv@tmp{a5}\ifx\rvpaper\rv@tmp
\setlength{\rvpaperwidth}{148mm}
\setlength{\rvpaperheight}{210mm}
\else
\PackageError{review-cover}{\rvpaper はサポートしていない紙サイズです (b5またはa5)}{}
\fi\fi
% 半分を計算しておく
\newlength{\rvpaperwidthhalf}
\setlength{\rvpaperwidthhalf}{\dimexpr \the\rvpaperwidth / 2\relax}
\newlength{\rvpaperheighthalf}
\setlength{\rvpaperheighthalf}{\dimexpr \the\rvpaperheight / 2\relax}
\newlength{\rvspinewidthhalf}
\setlength{\rvspinewidthhalf}{\dimexpr \rvspinewidth / 2\relax}
\if@pdftombo
% トンボ紙サイズに合わせて原点移動
\def\pgf@sys@pdf@mark@pos@pgfpageorigin{%
\pgf@x=\dimexpr0.5\dimexpr\pdfpagewidth - \paperwidth\relax\relax
\pgf@y=\dimexpr0.5\dimexpr\pdfpageheight - \paperheight\relax\relax
\ignorespaces
}
\fi
% 色指定
% draw内でカラー指定はしづらいので、事前にここで定義する必要
\definecolor{commentred}{cmyk}{0,1,1,0}
\definecolor{commentgreen}{cmyk}{0.6,0,0.93,0}
% フォント
\def\rv@metainfofont{\sffamily\fontsize{10pt}{15pt}\selectfont}
%
\def\rvorientation{%
% 基本4方位+センター
\coordinate (N) at (current page.north);
\coordinate (W) at (current page.west);
\coordinate (NW) at (current page.north west);
\coordinate (E) at (current page.east);
\coordinate (NE) at (current page.north east);
\coordinate (S) at (current page.south);
\coordinate (SW) at (current page.south west);
\coordinate (SE) at (current page.south east);
\coordinate (C) at (current page.center);
% 左(表4)
\coordinate (LNW) at (NW); %anchor=north west
\coordinate (LN) at ([xshift=\the\rvpaperwidthhalf]LNW); %anchor=north
\coordinate (LNE) at ([xshift=\the\rvpaperwidth]LNW); %anchor=north east
\coordinate (LW) at (W); % anchor=west
\coordinate (LC) at ([xshift=\the\rvpaperwidthhalf]LW); % anchor=center
\coordinate (LE) at ([xshift=\the\rvpaperwidth]LW); % anchor=east
\coordinate (LSW) at (SW); %anchor=south west
\coordinate (LS) at ([xshift=\the\rvpaperwidthhalf]LSW); %anchor=south
\coordinate (LSE) at ([xshift=\the\rvpaperwidth]LSW); %anchor=south east
% 背
\coordinate (NC) at ([xshift=\the\rvspinewidthhalf]LNE); %anchor=north
\coordinate (SC) at ([xshift=\the\rvspinewidthhalf]LSE); %anchor=south
% 右(表1)
\ifrvonlyone% 表1のみモード
\coordinate (RNW) at (NW); %anchor=north west
\coordinate (RN) at (N); %anchor=north
\coordinate (RNE) at (NE); %anchor=north east
\coordinate (RW) at (W); %anchor=west
\coordinate (RC) at (C); %anchor=center
\coordinate (RE) at (E); %anchor=east
\coordinate (RSW) at (SW); %anchor=south west
\coordinate (RS) at (S); %anchor=south
\coordinate (RSE) at (SE); %anchor=south east
\else
\coordinate (RNW) at ([xshift=-\the\rvpaperwidth]NE); %anchor=north west
\coordinate (RN) at ([xshift=\the\rvpaperwidthhalf]RNW); %anchor=north
\coordinate (RNE) at (NE); %anchor=north east
\coordinate (RW) at ([yshift=-\the\rvpaperheighthalf]RNW); %anchor=west
\coordinate (RC) at ([xshift=\the\rvpaperwidthhalf]RW); %anchor=center
\coordinate (RE) at (E); %anchor=east
\coordinate (RSW) at ([xshift=-\the\rvpaperwidth]SE); %anchor=south west
\coordinate (RS) at ([xshift=\the\rvpaperwidthhalf]RSW); %anchor=south
\coordinate (RSE) at (SE); %anchor=south east
\fi
}
\def\rvmetainfo{%
% ------------------------------
% メタ情報
\draw (NW) node[anchor=south west,xshift=2mm,yshift=4mm] {\rv@metainfofont\rvmetainfostring};
\draw (NE) node[anchor=south east,xshift=-2mm,yshift=4mm] {\rv@metainfofont\rvmetainfodate};
% プレビューモード情報
\ifrv@debug
\draw (SW) node[anchor=north west,xshift=2mm,yshift=-4mm] {\rv@metainfofont \textcolor{commentred}{プレビューモード(印刷入稿用ではありません)}};
\draw[commentgreen,dashed,line width=0.1mm] (SW) rectangle (NE);% 仕上がり罫線
\draw[commentred,dotted, line width=0.1mm] % センター罫線
(N) -- (S)
(W) -- (E);
\draw[commentgreen,dashed,line width=0.1mm] (LNE) --(LSE); % 表4範囲罫線
\draw[commentgreen,dashed,line width=0.1mm] (RNW) --(RSW); % 表1範囲罫線
\ifrv@debugmore
% 位置丸 (よりデバッグ向き)
\draw[commentred,line width=0.1mm,dashed]
(LNW) circle (5mm) node {LNW}
(LN) circle (5mm) node {LN}
(LNE) circle (5mm) node {LNE}
(LW) circle (5mm) node {LW}
(LC) circle (5mm) node {LC}
(LE) circle (5mm) node {LE}
(LSW) circle (5mm) node {LSW}
(LS) circle (5mm) node {LS}
(LSE) circle (5mm) node {LSE}
(RNW) circle (5mm) node {RNW}
(RN) circle (5mm) node {RN}
(RNE) circle (5mm) node {RNE}
(RW) circle (5mm) node {RW}
(RC) circle (5mm) node {RC}
(RE) circle (5mm) node {RE}
(RSW) circle (5mm) node {RSW}
(RS) circle (5mm) node {RS}
(RSE) circle (5mm) node {RSE}
(NC) circle (5mm) node {NC}
(C) circle (5mm) node {C}
(SC) circle (5mm) node {SC}
;
\fi
\fi
}
\ifrvonlyone % 表1モードの場合はメッセージ等入れる余地なし
\def\rvmetainfo{}
\fi
\makeatother
\pagestyle{empty}
\endinput