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
266
267
268
269
270
271
272
273
274
275
276
|
%%
%% This is file `pfarrei.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pfarrei.dtx (with options: `package,tex')
%%
%% Copyright (c) 2013 Markus Kohm
%% komascript at gmx info
%%
%% This file was generated from file(s) of the work `pfarrei'.
%% ------------------------------------------------------------------
%%
%% It may be distributed under the conditions of the
%% LaTeX Project Public License in the version distributed together
%% with the work `pfarrei'. You may however distribute the work
%% `pfarrei' without all such generated files. See also
%% <http://www.latex-project.org/lppl.txt> for additional
%% information.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Markus Kohm.
%%
%% The list of files belonging to the work `pfarrei' is given in
%% the file `pfarrei.dtx'.
%%
\begingroup
\def\revisiondate$#1: #2-#3-#4 #5${%
\gdef\pfarreirevisiondate{#2/#3/#4}%
}\revisiondate$Date: 2013-10-16 20:54:26 +0200 (Mi, 16. Okt 2013) $
\def\revision$#1: #2 #3${%
\gdef\pfarreirevision{#2}%
}\revision$Revision: 36 $
\endgroup
\ProvidesPackage{pfarrei}
[\pfarreirevisiondate\space r\pfarreirevision\space LaTeX2e package
(for pastors)]
\newcommand*{\ifbooklet}{}
\let\ifbooklet\@secondoftwo
\DeclareOption{booklet}{\let\ifbooklet\@firstoftwo}
\DeclareOption{nobooklet}{\let\ifbooklet\@secondoftwo}
\ProcessOptions*
\RequirePackage{ifpdf}
\RequirePackage{pdfpages}
\newcommand*{\AvToAiv}[1][\OriginalFile]{%
\ifpdf\else
\PackageError{pfarrei}{PDF mode needed}{%
a5toa4 needs the direct PDF mode.\MessageBreak
Usually this may be activated using either pdflatex, lualatex or
xelatex.%
}%
\input{x.tex}
\fi
\ifbooklet{%
\includepdf[pages=-,booklet]{#1}%
}{%
\includepdf[pages=-,nup=2x1]{#1}%
}%
}
\newenvironment*{bookletpage}{%
\edef\reserved@a{bookletpage}%
\ifx\@currenvir\reserved@a
\PackageError{pfarrei}{`bookletpage' used as ordinary environment}{%
Please note, that `bookletpage' is a virtual environment
only.\MessageBreak
You should not use it directly as an environment, but use
`\string\bookletpage' at the\MessageBreak
begin code and `\string\endbookletpage' at the end code of a wrapper
environment.\MessageBreak
If you'll continue, expect several additional errors%
}%
\let\bookletpagebox\@tempboxa
\let\bookletpagestyle\@empty
\else
\expandafter\let\expandafter\bookletpagebox
\csname \@currenvir box\endcsname
\expandafter\let\expandafter\bookletpagestyle
\csname \@currenvir style\endcsname
\fi
\edef\reserved@a{%
\noexpand\begin{lrbox}{\bookletpagebox}
\noexpand\begin{minipage}[t][\textheight][t]{\textwidth}%
\begingroup
\def\noexpand\@currenvir{\@currenvir}%
\def\noexpand\@currenvline{\@currenvline}%
\noexpand\parskip=\the\parskip
\noexpand\parindent=\the\parindent
\noexpand\parfillskip=\the\parfillskip
}\reserved@a
}{%
\endbookletpagebox
\printbookletpagebox
}
\def\endbookletpagebox{%
\par
\endgroup
\end{minipage}%
\end{lrbox}%
\global\setbox\bookletpagebox\box\bookletpagebox
}
\newcommand*\printbookletpagebox[1][\@currenvir]{%
\ifbooklet{%
\@ifundefined{bookletpagestyle}{}{%
\ifx\bookletpagestyle\@empty\else\thispagestyle{\bookletpagestyle}\fi%
}%
\clearpage\noindent\usebox\bookletpagebox\clearpage
}{%
\PackageInfo{pfarrei}{`#1' not printed}%
}%
}
\newsavebox\bookletfrontpagebox
\newcommand*{\bookletfrontpagestyle}{empty}
\newenvironment*{bookletfrontpage}{%
\bookletpage
}{%
\endbookletpagebox
\clearpage
\ifbooklet{%
\ifnum\c@page>\@ne
\PackageError{pfarrei}{Booklet front page not first page}{%
The booklet font page should be the first page, but it seems, that it
is\MessageBreak
page no. \the\c@page. \space Maybe you should put it immediately after
`\string\begin{document}.%
Nevertheless, if you'll continue it will be printed here%
}%
\fi
\printbookletpagebox
}{%
\PackageInfo{pfarrei}{Booklet front page ignored}%
}%
}
\newsavebox\bookletemptypagebox
\newcommand*{\bookletemptypagestyle}{empty}
\newenvironment*{bookletemptypage}{%
\bookletpage
}{%
\endbookletpagebox
}
\newsavebox\bookletbackpagebox
\newcommand*{\bookletbackpagestyle}{empty}
\newenvironment*{bookletbackpage}{%
\bookletpage
}{%
\endbookletpagebox
\if@filesw\immediate\write\@mainaux{\string\printbookletbackpage}\fi
}%
\newcommand*{\printbookletbackpage}{}
\newcommand*{\@printbookletbackpage}{%
\ifbooklet{%
\clearpage
\let\bookletpagestyle\bookletemptypagestyle
\ifvoid\bookletemptypagebox
\let\bookletpagebox\strutbox
\else
\let\bookletpagebox\bookletemptypagebox
\fi
\@tempcnta=\c@page
\divide\@tempcnta by 4
\multiply\@tempcnta by 4
\ifnum \@tempcnta=\c@page\else
\advance\@tempcnta by 4
\@whilenum \c@page<\@tempcnta\do{%
\printbookletpagebox
}%
\fi
\let\bookletpagestyle\bookletbackpagestyle
\let\bookletpagebox\bookletbackpagebox
\printbookletpagebox
}{%
\PackageInfo{pfarrei}{Booklet back page ignored}%
}%
}
\AtBeginDocument{\let\printbookletbackpage\@printbookletbackpage}
\newcommand*{\motto}[1]{\gdef\@motto{#1}}
\newcommand*{\@motto}{}
\newcommand*{\titlepicture}[1]{\gdef\@titlepicture{#1}}
\newcommand*{\@titlepicture}{}
\providecommand*{\title}[1]{\gdef\@title{#1}}
\providecommand*{\@title}{}
\newcommand*{\parish}[1]{\gdef\@parish{#1}}
\newcommand*{\@parish}{}
\providecommand*{\date}[1]{\gdef\@date{#1}}
\def\@date{}
\newcommand*{\makebooklettitlepage}{%
\begin{bookletfrontpage}
\parskip.5\baselineskip
\parindent\z@
\parfillskip \z@ \@plus 1fil
\centering
\ifx\@motto\@empty\else{\Huge\@motto\par}\fi
\vfill
\ifx\@titlepicture\@empty\else\@titlepicture\par\fi
\vfill
\parskip\z@
\Huge
\@title\par
\@parish\par
\@date\par
\ifx\@title\@empty\ifx\@parish\@empty\ifx\@date\@empty\null\fi\fi\fi
\end{bookletfrontpage}
}
\let\samedoublepage@save@hbox\hbox
\newenvironment*{samedoublepage}{%
\par
\let\hbox\vbox
\begin{lrbox}{\@tempboxa}%
\let\hbox\samedoublepage@save@hbox
}{%
\end{lrbox}%
\let\hbox\samedoublepage@save@hbox
\@tempdima\ifdim\pagegoal=\maxdimen\textheight
\else\dimexpr\pagegoal-\pagetotal\fi
\ifdim \@tempdima
<\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax
\ifodd\c@page
\newpage
\@tempdima\textheight
\else \typeout{even page}%
\fi
\@whiledim \@tempdima
<\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax\do{%
\splitmaxdepth\dp\strutbox
\splittopskip\topskip
\setbox\z@\vsplit\@tempboxa to \@tempdima
\usebox\z@
\newpage
\@tempdima\textheight
}%
\fi
\ifvoid\@tempboxa\else\usebox\@tempboxa\fi
}
\RequirePackage{keyval}
\define@key{pfarrei.prayer}{response}{\def\prayer@response{#1}}
\define@key{pfarrei.prayer}{responder}{\def\prayer@responder{#1:}}
\define@key{pfarrei.prayer}{leader}{\def\prayer@leader{#1:}}
\newcommand*{\prayer@responder}{}
\newcommand*{\prayer@response}{}
\newcommand*{\prayer@leader}{}
\newcommand*{\setupprayer}{%
\setkeys{pfarrei.prayer}%
}
\newif\ifprayer@firstitem
\newcommand*{\prayer@response@item}{%
\ifprayer@firstitem\else
\ifx\prayer@responder\@empty\else
\ifx\prayer@response\@empty\else
\prayer@save@item[\prayer@responder] \prayer@response
\fi
\fi
\fi
}
\newcommand*{\prayer@item}[1][\prayer@leader]{%
\prayer@response@item
\prayer@firstitemfalse
\prayer@save@item[{#1}]%
}
\newenvironment*{prayer}[1][]{%
\begin{description}
\begingroup
\def\@currenvir{prayer}%
\setupprayer{#1}%
\let\prayer@save@item\item
\let\item\prayer@item
\prayer@firstitemtrue
\let\noresponder\prayer@firstitemtrue
}{%
\prayer@response@item
\endgroup
\end{description}
}
\endinput
%%
%% End of file `pfarrei.sty'.
|