-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpharmrep.cls
More file actions
265 lines (264 loc) · 9.17 KB
/
pharmrep.cls
File metadata and controls
265 lines (264 loc) · 9.17 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
%%
%% This is file `pharmrep.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pharmrep.dtx (with options: `class')
%% Copyright (C) 2015,2016 by Barbara Bredner <bredner@bb-sbl.de>,
%% Barbara Jentges <barbara.jentges@phact.ch> and
%% Martin Sievers <martin.sievers@schoenerpublizieren.de>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version. The latest version of this license is in the file:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status) by
%% Barbara Bredner, Barbara Jentges and Martin Sievers.
%%
%% This work consists of all files listed in manifest.txt.
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{pharmrep}
[2016/07/27 v2.0 PharmRep -- a LaTeX package for medical reports]
% \item subitem 1
% \item subitem 2
% \begin{itemize}
% \item subsubitem 1
% \item subsubitem 2
% \end{itemize}
% \item subitem 3
% \end{enumerate}
%%% master.tex file:
%%% TODO: %%%todo{a comment in the margin}Comments can be included with \verb|\todo{text}| for comments in the %margin and \verb|[inline]{text}| for comments in the text. Do % TODO: % not use \verb|\todo|-comments within other %environments (e.g. figures, tables, etc.)
%%% TODO: %%%%todo[inline, color=green]{a green inline comment}
%%% TODO: %%%%todo{differentiation between separate 'List of Abbreviations' and 'Glossary' foreseen?}
%%% TODO: %%%todo{description to convert arbitrary graphs and documents (e.g. powerpoint slides) into pdf/a %documents using printer functionality}
%%% TODO: %%%todo{other useful things for pdf/a compatibility using Acrobat Professional}
%%% TODO: %%%todo{an BB: Diesen Abschnitt bitte auf Korrektheit prüfen}
%%% TODO: %%%todo{an BJ: Subfolder mit CTD Example-Datei erzeugen und als screenshot-Figure einbinden}
\RequirePackage{kvoptions}
\SetupKeyvalOptions {
family = pharmrep,%
prefix = pharmrep@,%
setkeys = \kvsetkeys,%
}
\DeclareStringOption[utf8]{inputenc}
\DeclareStringOption[sRGB_IEC61966-2-1_black_scaled.icc]{colorprofile}
\DeclareBoolOption[true]{pdfa}
\DeclareBoolOption[false]{letter}
\DeclareVoidOption{US}{\pharmrep@lettertrue}
\ProcessKeyvalOptions*\relax
\PassOptionsToPackage{\pharmrep@inputenc}{inputenc}
\RequirePackage{etoolbox}
\RequirePackage{pdf14}
\input glyphtounicode.tex
\input glyphtounicode-cmr.tex
\pdfgentounicode=1
\pdfobjcompresslevel=0
\pdfinclusioncopyfonts=1
\ifpharmrep@letter
\PassOptionsToPackage{paper=letter,pagesize}{typearea}
\fi%
\LoadClass[parskip=half,fontsize=12bp,%
bibliography=totoc,listof=totoc,%
numbers=noendperiod]{scrartcl}
\RequirePackage{hyperxmp}
\RequirePackage{inputenc}
\RequirePackage[T1]{fontenc}
\hyphenchar\font=\string"7F
\RequirePackage[english]{babel}
\addto{\captionsenglish}{\renewcommand*{\contentsname}{Table of Contents}}
\addto{\extrasenglish}{\def\figureautorefname{figure}}
\addto{\extrasenglish}{\def\tableautorefname{table}}
\RequirePackage{mathptmx} % times font
\RequirePackage{couriers} % monospace fonts
\RequirePackage[scaled=0.91]{helvet} % for sans serif fonts (\textsf{...} or \sffamiliy)
\RequirePackage{pifont} % symbols
\RequirePackage[full]{textcomp} % symbols
\RequirePackage{upquote}
\RequirePackage{microtype}% microtypographic extensions
\RequirePackage{xspace} % automatic spacing with own commands
\RequirePackage{graphicx}
\RequirePackage{grffile}
\RequirePackage[rgb]{xcolor}
\ifpharmrep@pdfa
\IfFileExists{\pharmrep@colorprofile}
{\immediate\pdfobj stream attr{/N 3} file{\pharmrep@colorprofile}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \the\pdflastobj\space 0 R
/OutputConditionIdentifier (\pharmrep@colorprofile)
/Info(\pharmrep@colorprofile)
>> ]
}}{\ClassError{pharmrep}{Color profile \pharmrep@colorprofile not found!}{Please check your installation}}
\else
\ClassInfo{pharmrep}{PDF/A support is disabled!}
\fi%
\RequirePackage{siunitx}
\RequirePackage{geometry}
\geometry{textheight=600pt,head=50pt,left=60pt,right=60pt,includeheadfoot}
\setlength{\footheight}{38pt}
\RequirePackage[section]{placeins}
\RequirePackage{lastpage}
\RequirePackage{totcount}
\regtotcounter{figure}
\regtotcounter{table}
\IfFileExists{scrlayer-scrpage.sty}
{\RequirePackage[headsepline,footsepline]{scrlayer-scrpage}}%
{\RequirePackage[headsepline,footsepline]{scrpage2}}%
\setkomafont{pageheadfoot}{\small}
\setkomafont{pagenumber}{\small}
\clearscrheadfoot
\ihead{%
\begin{minipage}[b][16mm]{0.48\textwidth}%
Applicant: \@Applicant\\%
Drug Product: \@DrugProduct\hspace{0pt}%
\end{minipage}%
}%
\ohead{%
\begin{minipage}[b][16mm]{0.48\textwidth}%
\raggedleft%
\@PharmRepTitle\hspace{0pt}%
\end{minipage}%
}%
\ifoot{%
\begin{minipage}[t][10mm]{0.3\textwidth}%
\vspace{0pt}%
\@eCTDno%
\end{minipage}%
}%
\cfoot{%
\begin{minipage}[t][10mm]{0.3\textwidth}%
\vspace{0pt}%
\centering%
\jobname{}%
\end{minipage}%
}
\ofoot{%
\begin{minipage}[t][10mm]{0.3\textwidth}%
\vspace{0pt}%
\flushright%
\pagemark/\upshape\pageref*{LastPage}%
\end{minipage}%
}%
\pagestyle{scrheadings}
\newcommand{\landscapeformat}{%
\clearpage%
\pdfpagewidth=\paperheight%
\pdfpageheight=\paperwidth%
\newgeometry{textwidth=600pt,left=50pt,top=60pt,bottom=60pt,includeheadfoot}}
\newcommand{\portraitformat}{%
\clearpage%
\pdfpagewidth=\paperwidth%
\pdfpageheight=\paperheight%
\restoregeometry}
\renewcommand{\fps@table}{htbp}
\renewcommand{\fps@figure}{htbp}
\RequirePackage[%
justification=RaggedRight,%
singlelinecheck=false,%
labelfont=bf,%
hypcap=false]{caption}%%%TODO: Umsteigen auf KOMA-Script-Bordmittel?
\RequirePackage{rotating}
\RequirePackage{booktabs}
\RequirePackage{multirow}
\RequirePackage{ltablex}
\RequirePackage{enumitem}
\setlist[1]{parsep=4pt}
\RequirePackage[backgroundcolor=orange!40,%
linecolor=black!20!orange,%
textsize=footnotesize,%
colorinlistoftodos]{todonotes}
\reversemarginpar%
\setlength{\marginparwidth}{20mm}
\RequirePackage[autostyle]{csquotes}
\RequirePackage[backend=biber,%
style=authoryear]{biblatex}
\RequirePackage{xpatch}% author bold
\xpretobibmacro{author}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{author}{\egroup}{}{}
\xpretobibmacro{bbx:editor}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{bbx:editor}{\egroup}{}{}
\renewcommand*{\labelnamepunct}{\mkbibbold{\addcolon\space}}
\AtEndPreamble{%
\ifdefempty{\@BibFileName}{%
\ClassError{pharmrep}%
{You have to provide a bib file!}%
{Please use the macro \string\BibFileName{<MYFILE.bib>}\space in
the preamble}%
}%
{\addbibresource{\@BibFileName}}%
}%
\RequirePackage[pdftex,pdfa]{hyperref}%
\AtEndPreamble{%
\hypersetup{%
pdftitle = {\@PharmRepTitle},%
pdfauthor = {\@Applicant},%
pdfsubject = {\@eCTDno},%
pdfkeywords = {},%
pdflang = en,%
bookmarks = true,%
pdfdisplaydoctitle = true,%
plainpages = false,%
hypertexnames = false,%
pdfpagelabels = true,%
hyperindex = true,%
unicode = true,%
pdfmetalang = {en},%
pdfpagemode = UseOutlines,%
bookmarksopen = true,%
bookmarksnumbered = true, %
bookmarksopenlevel = 2,%
colorlinks = true,%
allcolors = blue,%
breaklinks = true,%
linktoc = all,%
}}%
\apptocmd{\UrlBreaks}{\do\f\do\m}{}{}
\setcounter{biburllcpenalty}{9000}%
\setcounter{biburlucpenalty}{9000}%
\RequirePackage[nopostdot,nonumberlist,toc]{glossaries}
\setlength{\glspagelistwidth}{\linewidth}
\RequirePackage{glossary-list}
\setglossarystyle{list}
\makenoidxglossaries
%%% \renewcommand{\glsnamefont}[1]{\bfseries #1}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
%%%\AtBeginDocument{\addto\extrasenglish{\def\figureautorefname{Abb.}}
%%%\addto\extrasenglish{\def\tableautorefname{table}}}
%%%\renewcaptionname{english}{\figureautorefname}{figure}
%%%\renewcaptionname{english}{\tableautorefname}{tab}
\newcommand*{\@Applicant}{}
\newcommand*{\@DrugProduct}{}
\newcommand*{\@PharmRepTitle}{}
\newcommand*{\@eCTDno}{}
\newcommand*{\@BibFileName}{}
\newcommand*{\Applicant}[1]{\renewcommand*{\@Applicant}{#1}}
\newcommand*{\DrugProduct}[1]{\renewcommand*{\@DrugProduct}{#1}}
\newcommand*{\PharmRepTitle}[1]{\renewcommand*{\@PharmRepTitle}{#1}}
\newcommand*{\eCTDno}[1]{\renewcommand*{\@eCTDno}{#1}}
\newcommand*{\BibFileName}[1]{\renewcommand*{\@BibFileName}{#1}}
\AtBeginDocument{%
\listoftodos%
\clearpage%
\pdfbookmark[1]{\@PharmRepTitle}{Sec:Title}%
\section*{\@PharmRepTitle}%
\bigskip%
\tableofcontents%
\clearpage%
\ifnum\totvalue{table}>0%
\listoftables%
\clearpage%
\fi%
\ifnum\totvalue{figure}>0%
\listoffigures%
\clearpage%
\fi%
\cleardoubleemptypage%
}%