-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patherratastyles.tex
175 lines (175 loc) · 7.32 KB
/
erratastyles.tex
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
%%
%% This is file `erratastyles.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% errata.dtx (with options: `erratastyles')
%%
%% Define the default errata formatting
%%
\NewDocumentCommand{\erratalistitem}{ m }{\item[#1]}
\errataset{%
styles/basekeyformats/.style={%
actionidformat/add/.setStrKeyFmt={##1}{Addition},
actionidformat/delete/.setStrKeyFmt={##1}{Deletion},
actionidformat/note/.setStrKeyFmt={##1}{Note},
actionidformat/replace/.setStrKeyFmt={##1}{Correction},
%%
listformats/listbeforenewgroup/.setStrKeyFmt={##1}{},
listformats/listafternewgroup/.setStrKeyFmt={##1}{},
listformats/listbeforesamegroup/.setStrKeyFmt={##1}{},
listformats/listaftersamegroup/.setStrKeyFmt={##1}{},
%% The name of the errata labels
errformats/errfmt/.setStrKeyFmt={##1}{Err(##1)},
errformats/eerrbeginfmt/.setStrKeyFmt={##1}{BErr(##1)},
errformats/eerrendfmt/.setStrKeyFmt={##1}{EErr(##1)},
%% Set the format for the action description for each erratum command
actionformat/add/.setStrKeyFmt={##1}{ ##1 },
actionformat/delete/.setStrKeyFmt={##1}{##1},
actionformat/replace/.setStrKeyFmt={##1+##2}{ ##2 --> ##1},
%%
listformats/erratumlabel/.setStrKeyFmt={##1}{\@errata@labelname},
listformats/erratumlistitem/.setStrKeyFmt={##1}{\erratalistitem{##1}},
listformats/erratumlisttarget/.setStrKeyFmt={##1}{\@errata@htargeterratum{##1}{}},
listformats/erratumnamedlink/.setStrKeyFmt={##1+##2}{\@errata@hlink{##1}{##2}},
%%
listformats/erratalistbegin/.setStrKeyFmt={##1}{\makeatletter\begin{description}},
listformats/erratalistend/.setStrKeyFmt={##1}{\end{description}\makeatother},
},
}
\errataset{%
defaultkeyformats/.style={%
%% Formats for the footnotes
footformats/description/.setStrKeyFmt={##1}{~##1},
footformats/action/.setStrKeyFmt={##1}{~##1},
footformats/actiondescription/.setStrKeyFmt={##1}{~##1},
%% Set the format for the action description for each erratum command
actionformat/add/.setStrKeyFmt={##1}{ (added text)},
actionformat/delete/.setStrKeyFmt={##1}{(deleted ``##1'')},
actionformat/replace/.setStrKeyFmt={##1+##2}{ (original text was: ``##2'')},
%% Errata list format
listformats/description/.setStrKeyFmt={##1}{~##1},
listformats/erratumlistitemtitle/.setStrKeyFmt={##1+##2}{%
\@errata@hlink{##1}{\protect\makebox[\@errata@groupindent][l]{##2}}},
listformats/type/.setStrKeyFmt={##1}{Type: ##1 },
listformats/date/.setStrKeyFmt={##1}{ (Date reported: ##1)},
listformats/reported-by/.setStrKeyFmt={##1}{Reported by: ##1},
listformats/action/.setStrKeyFmt={##1}{~##1},
listformats/actiondescription/.setStrKeyFmt={##1}{~##1},
},
defaultlistandfootstyle/.code={%
%% Define the default format of the errata list and footnotes
\errataSetListFormat{+erratumlisttarget, +description}
\errataSetFootFormat{+description, +actiondescription}
},
styles/default/.style={styles/basekeyformats, defaultkeyformats, defaultlistandfootstyle},
}
%%
%% END style: default
%%
%% Define the detailed formatting
%%
\errataset{%
detailedstylekeyformats/.style={%
%% Errata list format
listformats/description/.setStrKeyFmt={##1}{~(##1)},
listformats/erratumlistitemtitle/.setStrKeyFmt={##1+##2}{%
{\@errata@hlink{##1}{%
\protect\makebox[\@errata@groupindent][l]{##2}}%
\@errata@hlinkerratum{\the@errata@erratum}{\@errata@erratumname}}},
listformats/action/.setStrKeyFmt={##1}{~##1},
listformats/actiondescription/.setStrKeyFmt={##1}{\newline ##1},
listformats/pageref/.setStrKeyFmt={##1}{Page~\pageref{##1}},
listformats/lineref/.setStrKeyFmt={##1}{Line \lineref{##1}},
%% Foot format
footformats/description/.setStrKeyFmt={##1}{~(##1)},
footformats/action/.setStrKeyFmt={##1}{~##1},
footformats/actiondescription/.setStrKeyFmt={##1}{~##1},
%% Action format
actionformat/replace/.setStrKeyFmt={##1+##2}{##1 (original text was: ``##2'')},
actionformat/add/.setStrKeyFmt={##1}{##1 (added)},
actionformat/delete/.setStrKeyFmt={##1}{##1 (deleted)},
},
styles/margintcolorboxstyle/.style={
marginfmt/marginnote/.setStrKeyFmt={##1+##2}{%
{\vspace{-4pt}%
{\begin{tcolorbox}[size=fbox,nobeforeafter,
colframe=red!50!white,colback=red!25!yellow!5!white,%
leftrule=0pt,rightrule=0pt,bottomrule=1pt,toprule=1pt,
arc=0cm, outer arc=0mm, % Remove the rounded corners
fontupper=\scriptsize,%
code={\pgfkeysalsofrom##1}
]##2\end{tcolorbox}}}},%
},
detailedlistandfootstyle/.code={%
\errataSetListFormat{+erratumlisttarget, +pageref, +action, -description, -date, +actiondescription}
\errataSetFootFormat{+action, -description,:, +actiondescription}
},
detailedstylesetupcode/.code={%
\newlength{\@errata@listindent}
\setlength\@errata@listindent{33mm}
\setlength\@errata@groupindent{16mm}
\setcounter{@errata@uniquelistlabels}{3}
\AtBeginDocument{%
\@errata@requirepackage{tcolorbox}
\@errata@requirepackage{enumitem}
\AtBeginEnvironment{errata} {
\setlist[description]{labelindent=0pt,labelwidth=\@errata@listindent,leftmargin=!}%
}
}
},
styles/detailed/.style={detailedstylekeyformats, detailedlistandfootstyle,
detailedstylesetupcode},
}
%%
%% END style: detailed
%%
%% Define the tablelist style for formatting the errata list as a table
%%
\NewDocumentCommand{\errataamersand}{}{&}
\NewDocumentCommand{\erratalistbeginnewgroup}{}{\\[4pt]\hline\rule[1ex]{0pt}{1em}}
\NewDocumentCommand{\erratacustomendline}{}{\\}
\errataset{%
liststyletablekeyformats/.style={%
listformats/pageref/.setStrKeyFmt={##1}{\pageref{##1} },
listformats/description/.setStrKeyFmt={##1}{##1},
listformats/type/.setStrKeyFmt={##1}{Type: ##1},
listformats/date/.setStrKeyFmt={##1}{ (Date reported: ##1)},
listformats/reported-by/.setStrKeyFmt={##1}{Reported by: ##1},
listformats/actiondescription/.setStrKeyFmt={##1}{ ##1},
listformats/erratumlistitem/.setStrKeyFmt={##1}{},
listformats/erratumlistitemtitle/.setStrKeyFmt={##1+##2}{%
{\@errata@hlink{##1}{\protect\makebox[\@errata@groupindent][l]{##2}}}},
%%
listformats/listbeforenewgroup/.setStrKeyFmt={##1}{\noexpand\erratalistbeginnewgroup},
listformats/listafternewgroup/.setStrKeyFmt={##1}{},
listformats/listbeforesamegroup/.setStrKeyFmt={##1}{\noexpand\erratacustomendline},
listformats/listaftersamegroup/.setStrKeyFmt={##1}{},
%%
listformats/erratalistbegin/.setStrKeyFmt={##1}{\makeatletter%
\begin{longtable}{ p{1.3cm} p{1.3cm} c p{5cm} c }%
& Title & Type & Description & Page %
},
listformats/erratalistend/.setStrKeyFmt={##1}{\end{longtable}\makeatother},
},
requirelongtable/.code={%
\AtBeginDocument{%
\@errata@requirepackage{longtable}
}
},
liststylefortable/.code={
\errataSetListFormat{+erratumlistitemtitle,+erratumlisttarget,\noexpand\errataamersand,%
+erratumnamedlink,\noexpand\errataamersand,+action,\noexpand\errataamersand,%
+actiondescription,\noexpand\errataamersand,+pageref}%
\setcounter{@errata@uniquelistlabels}{4}
},
styles/tablelist/.style={liststyletablekeyformats, requirelongtable,
defaultlistandfootstyle, liststylefortable},
}
%%
%% END style tablelist
%%
\endinput
%%
%% End of file `erratastyles.tex'.