Debian Codegraph @

texmf-dist/doc/latex/ghsystem/ghsystem-manual.cls

raw
1 % --------------------------------------------------------------------------
2 % the GHSYSTEM package
3 %
4 % globally harmonised system
5 %
6 % --------------------------------------------------------------------------
7 % Clemens Niederberger
8 % --------------------------------------------------------------------------
9 % https://github.org/cgnieder/ghsystem/
10 % [email protected]
11 % --------------------------------------------------------------------------
12 % If you have any ideas, questions, suggestions or bugs to report, please
13 % feel free to contact me.
14 % --------------------------------------------------------------------------
15 % Copyright 2011--2020 Clemens Niederberger
16 %
17 % This work may be distributed and/or modified under the
18 % conditions of the LaTeX Project Public License, either version 1.3
19 % of this license or (at your option) any later version.
20 % The latest version of this license is in
21 % http://www.latex-project.org/lppl.txt
22 % and version 1.3 or later is part of all distributions of LaTeX
23 % version 2005/12/01 or later.
24 %
25 % This work has the LPPL maintenance status `maintained'.
26 %
27 % The Current Maintainer of this work is Clemens Niederberger.
28 % --------------------------------------------------------------------------
29 \ProvidesClass{ghsystem-manual}[2020/02/17]
30
31 \LoadClass[load-preamble,add-index]{cnltx-doc}
32 \RequirePackage{imakeidx}
33 \RequirePackage[utf8]{inputenc}
34
35 \RequirePackage{ghsystem,chemmacros}
36
37 \setcnltx{
38 package = {ghsystem},
39 info = \acl*{ghs} ,
40 url = https://github.com/cgnieder/ghsystem/ ,
41 authors = Clemens Niederberger ,
42 email = [email protected] ,
43 abstract = {%
44 \centering
45 \includegraphics{chemmacros-logo.pdf}
46 \par
47 } ,
48 add-cmds = {
49 chemsetup,
50 ghs, ghslistall, ghspic, ghssetup
51 } ,
52 index-setup = { noclearpage , level = \addsec }
53 }
54
55 \RequirePackage{booktabs}
56
57 \def\libertine@figurestyle{LF}
58 \RequirePackage{amsmath}
59 \undef\lvert \undef\lVert
60 \undef\rvert \undef\rVert
61 \RequirePackage[libertine]{newtxmath}
62 \def\libertine@figurestyle{OsF}
63
64 \RequirePackage[biblatex]{embrac}
65 \ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
66 \ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
67
68 \RequirePackage[accsupp]{acro}
69 \acsetup{
70 long-format = \scshape ,
71 short-format = \scshape
72 }
73
74 \chemsetup{
75 greek = newtx ,
76 formula = chemformula ,
77 chemformula/format = \libertineLF
78 }
79
80 \ghssetup{
81 language = {german,english}
82 }
83
84 \sisetup{
85 detect-mode=false,
86 mode=text,
87 text-rm=\libertineLF
88 }
89
90 \RequirePackage{fontawesome}
91 \RequirePackage{datetime2}
92 \DTMsetup{useregional=numeric,datesep=/}
93 \newrobustcmd*\ghsystem@add@version[2]{%
94 \csdef{ghsystem@ver@#2}{%
95 \DTMdate{#1}%
96 \csgdef{ghsystem@ver@#2used}{}%
97 \csdef{ghsystem@ver@#2}{\DTMdate{#1}}%
98 }%
99 }
100
101 \newrobustcmd*\ghsystem@date[1]{%
102 \ifcsdef{ghsystem@ver@#1used}{}{ (\csuse{ghsystem@ver@#1})}}
103 \newrobustcmd*\ghsystem@ifnew[1]{\ifcsstring{c_ghsystem_version_tl}{#1}}
104 \newrobustcmd*\ghsystem@NEW{\faStarO\ New}
105
106 \renewrobustcmd*\sinceversion[1]{%
107 \ghsystem@ifnew{#1}%
108 {\cnltx@version@note{\textcolor{red}{\ghsystem@NEW}}}%
109 {\cnltx@version@note{\GetTranslation{cnltx-introduced}~#1\ghsystem@date{#1}}}%
110 }
111 \renewrobustcmd*\changedversion[1]{%
112 \cnltx@version@note{\GetTranslation{cnltx-changed}~#1\ghsystem@date{#1}}%
113 }
114
115 \newnote*\sincechanged[2]{%
116 \GetTranslation{cnltx-introduced}~#1\ghsystem@date{#1},
117 changed with version~#2\ghsystem@date{#2}\ghsystem@ifnew{#2}{ \ghsystem@NEW}{}%
118 }
119
120 \RenewDocumentEnvironment{commands}{}
121 {%
122 \cnltx@set@catcode_{12}%
123 \let\command\cnltx@command
124 \cnltxlist
125 }
126 {\endcnltxlist}
127
128 \RequirePackage{tcolorbox,xsimverb}
129 \tcbuselibrary{skins,breakable}
130 \tcbset{enhanced,enhanced jigsaw}
131
132 \newtcolorbox{bewareofthedog}{
133 colback = white ,
134 colframe = red ,
135 underlay={%
136 \path[draw=none]
137 (interior.south west)
138 rectangle node[red]{\Huge\bfseries !}
139 ([xshift=-4mm]interior.north west);
140 }%
141 }
142
143 \newtcolorbox{cnltxcode}[1][]{
144 boxrule = 1pt ,
145 colback = cnltxbg ,
146 colframe = cnltx ,
147 arc = 5pt ,
148 beforeafter skip = .5\baselineskip ,%
149 #1%
150 }
151
152 \newcommand*\ghsystem@readoptions[1]{%
153 \catcode`\^^M=13
154 \ghsystem@read@options{#1}%
155 }
156
157 \begingroup
158 \catcode`\^^M=13
159 \gdef\ghsystem@read@options#1#2^^M{%
160 \endgroup
161 \ifblank{#2}{}{\ghsystem@read@options@#2}%
162 #1%
163 \XSIMfilewritestart*{\jobname.tmp}%
164 }%
165 \endgroup
166 \def\ghsystem@read@options@[#1]{\pgfqkeys{/cnltx}{#1}}
167
168 \RenewDocumentEnvironment{sourcecode}{}
169 {%
170 \begingroup
171 \ghsystem@readoptions{%
172 \setlength\cnltx@sidebysidewidth
173 {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}%
174 \expanded{%
175 \noexpand\lstset{
176 style=cnltx,
177 \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
178 {linewidth=\cnltx@sidebysidewidth,}{}%
179 \expandonce\cnltx@local@listings@options
180 }%
181 }%
182 \XSIMgobblechars{2}%
183 }%
184 }
185 {%
186 \XSIMfilewritestop
187 \cnltxcode[breakable]%
188 \lstinputlisting[style=cnltx]{\jobname.tmp}%
189 \endcnltxcode
190 }
191
192 \RenewDocumentEnvironment{example}{}
193 {%
194 \begingroup
195 \ghsystem@readoptions{%
196 \setlength\cnltx@sidebysidewidth
197 {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}%
198 \expanded{%
199 \noexpand\lstset{
200 style=cnltx,
201 \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
202 {linewidth=\cnltx@sidebysidewidth,}{}%
203 \expandonce\cnltx@local@listings@options
204 }%
205 }%
206 \XSIMgobblechars{2}%
207 }%
208 }
209 {%
210 \XSIMfilewritestop
211 \ifbool{cnltx@sidebyside}
212 {%
213 \cnltxcode
214 \noindent
215 \minipage[c]{\cnltx@sidebysidewidth}%
216 \cnltx@pre@source@hook
217 \lstinputlisting[style=cnltx] {\jobname.tmp}%
218 \cnltx@after@source@hook
219 \endminipage\hfill
220 \minipage[c]{\cnltx@sidebysidewidth}%
221 \cnltx@pre@example@hook
222 \input {\jobname.tmp}%
223 \cnltx@after@example@hook
224 \endminipage
225 }
226 {%
227 \cnltxcode[breakable]%
228 \cnltx@pre@source@hook
229 \lstinputlisting{\jobname.tmp}%
230 \cnltx@after@source@hook
231 \tcblower
232 \cnltx@pre@example@hook
233 \input {\jobname.tmp}%
234 \cnltx@after@example@hook
235 }%
236 \endcnltxcode
237 }
238
239 \RequirePackage[
240 backend=biber,
241 style=cnltx,
242 sortlocale=en_US,
243 indexing=cite]{biblatex}
244 \RequirePackage{csquotes,varioref}
245 \defbibheading{bibliography}{\section{References}}
246
247 \RequirePackage[biblatex]{embrac}[2012/06/29]
248 \ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
249 \ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
250
251 \ghsystem@add@version{2012-01-28}{3.0}
252 \ghsystem@add@version{2012/01/30}{3.0a}
253 \ghsystem@add@version{2012/02/05}{3.0c}
254 \ghsystem@add@version{2012/05/13}{3.3a}
255 \ghsystem@add@version{2012/05/18}{3.3b}
256 \ghsystem@add@version{2012/05/18}{3.3c}
257 \ghsystem@add@version{2012/07/24}{3.3d}
258 \ghsystem@add@version{2013/02/19}{3.5a}
259 \ghsystem@add@version{2013/07/06}{4.0}
260 \ghsystem@add@version{2013/12/13}{4.0a}
261 \ghsystem@add@version{2014/01/09}{4.2e}
262 \ghsystem@add@version{2014/04/08}{4.5}
263 \ghsystem@add@version{2014/04/13}{4.5a}
264 \ghsystem@add@version{2014/06/30}{4.5b}
265 \ghsystem@add@version{2014/08/08}{4.6}
266 \ghsystem@add@version{2016/01/15}{4.7}
267 \ghsystem@add@version{2016/07/16}{4.8}
268 \ghsystem@add@version{2019/09/30}{4.8a}
269 \ghsystem@add@version{2020/01/16}{4.8b}
270 \ghsystem@add@version{2020/02/17}{4.8c}
271
272 \endinput