Debian Codegraph @

texmf-dist/source/latex/deutschesmuseum/deutschesmuseum.dtx

raw
1 % \iffalse
2 %
3 % Copyright 2025, Boris Veytsman
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either
6 % version 1.3 of this license or (at your option) any
7 % later version.
8 % The latest version of the license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3 or later is part of all distributions of
11 % LaTeX version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status `maintained'.
14 %
15 % The Current Maintainer of this work is Boris Veytsman,
16 % <[email protected]>
17 %
18 % This work consists of the file deutschesmuseum.dtx and the
19 % derived file deutschesmuseum.cls
20 %
21 % \fi
22 % \CheckSum{0}
23 %
24 %
25 %% \CharacterTable
26 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
27 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
28 %% Digits \0\1\2\3\4\5\6\7\8\9
29 %% Exclamation \! Double quote \" Hash (number) \#
30 %% Dollar \$ Percent \% Ampersand \&
31 %% Acute accent \' Left paren \( Right paren \)
32 %% Asterisk \* Plus \+ Comma \,
33 %% Minus \- Point \. Solidus \/
34 %% Colon \: Semicolon \; Less than \<
35 %% Equals \= Greater than \> Question mark \?
36 %% Commercial at \@ Left bracket \[ Backslash \\
37 %% Right bracket \] Circumflex \^ Underscore \_
38 %% Grave accent \` Left brace \{ Vertical bar \|
39 %% Right brace \} Tilde \~}
40 %
41 %\iffalse
42 % Taken from xkeyval.dtx
43 %\fi
44 %\makeatletter
45 %\def\DescribeOption#1{\leavevmode\@bsphack
46 % \marginpar{\raggedleft\PrintDescribeOption{#1}}%
47 % \SpecialOptionIndex{#1}\@esphack\ignorespaces}
48 %\def\PrintDescribeOption#1{\strut\emph{option}\\\MacroFont #1\ }
49 %\def\SpecialOptionIndex#1{\@bsphack
50 % \index{#1\actualchar{\protect\ttfamily#1}
51 % (option)\encapchar usage}%
52 % \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar
53 % usage}\@esphack}
54 %\def\DescribeOptions#1{\leavevmode\@bsphack
55 % \marginpar{\raggedleft\strut\emph{options}%
56 % \@for\@tempa:=#1\do{%
57 % \\\strut\MacroFont\@tempa\SpecialOptionIndex\@tempa
58 % }}\@esphack\ignorespaces}
59 %\makeatother
60 %
61 % \MakeShortVerb{|}
62 % \GetFileInfo{deutschesmuseum.dtx}
63 % \newcommand{\progname}[1]{\textsf{#1}}
64 % \title{\LaTeX{} Style For \emph{Deutsches Museum}
65 % \thanks{\copyright 2025, Boris Veytsman. This work has been
66 % commissioned by Wayne Shahnke}}
67 % \author{Boris Veytsman\thanks{%
68 % \href{mailto:[email protected]}{\texttt{[email protected]}},
69 % \href{mailto:[email protected]}{\texttt{[email protected]}}}}
70 % \date{\filedate, \fileversion}
71 % \maketitle
72 % \begin{abstract}
73 % This package provides class for typesetting books for Deutsches
74 % Museum, \url{https://www.deutsches-museum.de}
75 % \end{abstract}
76 % \tableofcontents
77 %
78 % \clearpage
79 %
80 %
81 %\section{Introduction}
82 %\label{sec:intro}
83 %
84 % Deutsches museum regularly publishes studies. This package provides
85 % the way to the authors to format the contributions in \LaTeX.
86 %
87 %
88 %\section{Options}
89 %\label{sec:ug_options}
90 %
91 % \DescribeOptions{cfonts,nocfonts}%
92 % The contributions to Deutsches Museum should use their fonts:
93 % Garamond Berthold BQ and Futura PT. You probably want to buy them
94 % and install. If you do not have them, use the options |nocfonts| to
95 % substitute them for free fonts available in standard \TeX\
96 % distriutions. The option |cfonts| (the default) uses commercial
97 % fonts.
98 %
99 % In both cases the package uses fonts in OTF formats, so you need to
100 % use Lua\TeX\ or Xe\TeX\ for the compilation.
101 %
102 % If you use commercial fonts, the package expects the file names
103 % listed in Table~\ref{tab:fonts}.
104 %
105 % \begin{table}
106 % \centering
107 % \begin{tabularx}{\textwidth}{>{\raggedright}Xl}
108 % \toprule
109 % Font & File\\
110 % \midrule
111 % Garamond BQ Regular & |GaramondBQ-Regular.otf|\\
112 % Garamond BQ Italic & |GaramondBQ-Italic.otf| \\
113 % Garamond BQ Bold & |GaramondBQ-Bold.otf|\\
114 % Garamond BQ Medium Italic & |GaramondBQ-MediumItalic.otf|\\
115 % Futura PT Light & |futura-pt_light.otf|\\
116 % Futura PT Light Oblique & |futura-pt_light-oblique.otf|\\
117 % Futura PT Medium & |futura-pt_medium.otf|\\
118 % Futura PT Medium Oblique & |futura-pt_medium-oblique.otf|\\
119 % Futura PT Condensed Medium & |futura-pt_cond-medium.otf|\\
120 % Futura PT Condensed Medium Oblique & |futura-pt_cond-medium-oblique.otf|\\
121 % \bottomrule
122 % \end{tabularx}
123 % \caption{Commerical fonts (if the option \texttt{cfonts} is used)}
124 % \label{tab:fonts}
125 % \end{table}
126 %
127 % \DescribeOption{garamondmath,nogaramondmath}%
128 % By default the class uses \textsl{unicode-math} with Garamond math
129 % package. The option |nogaramondmath| disables this behavior, so you
130 % can experiment with other math styles.
131 %
132 % Internally the class uses \textsl{amsart}, so all its options are
133 % supported.
134 %
135 % \DescribeOption{folios,nofolios}%
136 % Deutsches Museum prefers to put running titles and page numbers in
137 % the post production,
138 % so we omit them by default. The option |folios| restores them,
139 % while the option |nofolios| (default) suppresses them.
140 %
141 %
142 %\section{Floats}
143 %\label{sec:ug_floats}
144 %
145 % We put captions \emph{before} tables and \emph{after} figures.
146 %
147 %\section{Front matter}
148 %\label{sec:ug_frontmatter}
149 %
150 % \DescribeMacro{\title}%
151 % As in \textsl{amsart} package, the \cs{title} command has an
152 % optional argument, that defines \cs{shortitle} macro, used for
153 % running heads.
154 %
155 % \DescribeMacro{\subtitle}%
156 % Deutsches Museum contributions, along with the title, have
157 % |\subtitle|. The running heads pick either short title, or
158 % subtitle, whichever is defined last. You can override this choice
159 % by redefining |\shortitle|. Examples
160 %
161 % \DescribeMacro{abstract}%
162 % Abstract, if present, should follow \cs{maketitle}
163 %
164 %\section{Bibliography}
165 %\label{sec:ug_biblio}
166 %
167 % The package uses bibliography in footnotes and |natbib| for
168 % formatting the bibliography list. The command \cs{cite} produces
169 % footnote citations.
170 %
171 %
172 % \StopEventually{%
173 % \clearpage}
174 %
175 % \clearpage
176 %
177 %
178 %\section{Implementation}
179 %\label{sec:impl}
180 %
181 %\subsection{Identification}
182 %\label{sec:ident}
183 %
184 % We start with the declaration who we are. Most |.dtx| files put
185 % driver code in a separate driver file |.drv|. We roll this code into the
186 % main file, and use the pseudo-guard |<gobble>| for it.
187 % \begin{macrocode}
188 %<class>\NeedsTeXFormat{LaTeX2e}
189 %<*gobble>
190 \ProvidesFile{deutschesmuseum.dtx}
191 %</gobble>
192 %<class>\ProvidesClass{deutschesmuseum}
193 [2026/02/04 v1.7 Typesetting books for Deutsches Museum]
194 % \end{macrocode}
195 %
196 % And the driver code:
197 % \begin{macrocode}
198 %<*gobble>
199 \documentclass{ltxdoc}
200 \usepackage{booktabs,tabularx}
201 \usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,
202 pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
203 \PageIndex
204 \CodelineIndex
205 \RecordChanges
206 \EnableCrossrefs
207 \begin{document}
208 \DocInput{deutschesmuseum.dtx}
209 \end{document}
210 %</gobble>
211 %<*class>
212 % \end{macrocode}
213 %
214 %
215 %\subsection{Options}
216 %\label{sec:options}
217 %
218 %\begin{macro}{\ifdeutschesmuseum@cfonts}
219 % First, let us decide whether we have non-free fonts:
220 % \begin{macrocode}
221 \newif\ifdeutschesmuseum@cfonts
222 \deutschesmuseum@cfontstrue
223 \DeclareOption{cfonts}{\deutschesmuseum@cfontstrue}
224 \DeclareOption{nocfonts}{\deutschesmuseum@cfontsfalse}
225 % \end{macrocode}
226 % \end{macro}
227 %
228 % \begin{macro}{\ifdeutschesmuseum@garamondmath}
229 % \changes{1.1}{2025/09/11}{Added option}
230 % Whether we are using Garamond math
231 % \begin{macrocode}
232 \newif\ifdeutschesmuseum@garamondmath
233 \deutschesmuseum@garamondmathtrue
234 \DeclareOption{garamondmath}{\deutschesmuseum@garamondmathtrue}
235 \DeclareOption{nogaramondmath}{\deutschesmuseum@garamondmathfalse}
236 % \end{macrocode}
237 % \end{macro}
238 %
239 % \begin{macro}{\ifdeutschesmuseum@folios}
240 % \changes{1.2}{2025/09/13}{Added option}
241 % \changes{1.3}{2025/09/25}{Nofolios option now suppresses running
242 % title as well}
243 % Whether we are using folios
244 % \begin{macrocode}
245 \newif\ifdeutschesmuseum@folios
246 \deutschesmuseum@foliosfalse
247 \DeclareOption{folios}{\deutschesmuseum@foliostrue}
248 \DeclareOption{nofolios}{\deutschesmuseum@foliosfalse}
249 % \end{macrocode}
250 % \end{macro}
251 %
252 %
253 % The size-changing options produce a warning:
254 % \begin{macrocode}
255 \long\def\deutschesmuseum@size@warning#1{%
256 \ClassWarning{deutschesmuseum}{Size-changing option #1 will not be
257 honored}}%
258 \DeclareOption{8pt}{\deutschesmuseum@size@warning{\CurrentOption}}%
259 \DeclareOption{9pt}{\deutschesmuseum@size@warning{\CurrentOption}}%
260 \DeclareOption{10pt}{\deutschesmuseum@size@warning{\CurrentOption}}%
261 \DeclareOption{11pt}{\deutschesmuseum@size@warning{\CurrentOption}}%
262 \DeclareOption{12pt}{\deutschesmuseum@size@warning{\CurrentOption}}%
263 % \end{macrocode}
264 %
265 %
266 % All other options are passed to \progname{amsart}:
267 % \begin{macrocode}
268 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{amsart}}
269 \ProcessOptions\relax
270 % \end{macrocode}
271 %
272 %\subsection{Loading Class and Packages}
273 %\label{sec:loading}
274 %
275 % We start with the base class
276 % \begin{macrocode}
277 \LoadClass{amsart}
278 \RequirePackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,
279 pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
280 \RequirePackage{multicol}
281 % \end{macrocode}
282 %
283 %
284 %\subsection{Fonts}
285 %\label{sec:fonts}
286 %
287 % \begin{macrocode}
288 \usepackage{fontspec}
289 \ifdeutschesmuseum@cfonts
290 \setmainfont{GaramondBQ}[
291 Extension = .otf,
292 UprightFont = *-Regular,
293 BoldFont = *-Bold,
294 ItalicFont = *-Italic,
295 BoldItalicFont = *-MediumItalic]
296 \newfontfamily\FuturaPTLight{futura-pt_light}[
297 Extension = .otf,
298 UprightFont = *,
299 ItalicFont = *-oblique,
300 BoldFont = futura-pt_medium,
301 BoldItalicFont = futura-pt_medium-oblique]
302 \newfontfamily\FuturaPTMedium{futura-pt_medium}[
303 Extension = .otf,
304 UprightFont = *,
305 ItalicFont = *-oblique]
306 \newfontfamily\FuturaPTCondMedium{futura-pt_cond-medium}[
307 Extension = .otf,
308 UprightFont = *,
309 ItalicFont = *-oblique]
310 \newcommand{\foliofont}{\FuturaPTLight\fontsize{9pt}{11pt}\selectfont}
311 \newcommand{\hIfont}{\FuturaPTCondMedium\fontsize{14pt}{16pt}\selectfont}
312 \newcommand{\hIIfont}{\FuturaPTCondMedium\fontsize{12.5pt}{12pt}\selectfont}
313 \newcommand{\hIIIfont}{\FuturaPTCondMedium\fontsize{12.5pt}{12pt}\selectfont}
314 \newcommand{\hIVfont}{\FuturaPTCondMedium\fontsize{11pt}{12pt}\selectfont}
315 \newcommand{\fnmarkfont}{\FuturaPTMedium\fontsize{10pt}{11pt}\selectfont}
316 \newcommand{\fnmarktextfont}{\FuturaPTMedium\fontsize{8pt}{10pt}\selectfont}
317 \newcommand{\fnfont}{\FuturaPTLight\fontsize{8pt}{10pt}\selectfont}
318 \else
319 \setmainfont{EBGaramond}[
320 Extension = .otf,
321 UprightFont = *-Regular,
322 BoldFont = *-Bold,
323 ItalicFont = *-Italic,
324 BoldItalicFont = *-BoldItalic]
325 \newfontfamily\LatoLight{Lato-Light}[
326 Extension = .ttf,
327 UprightFont = *,
328 ItalicFont = *Italic,
329 BoldFont = Lato-Medium,
330 BoldItalicFont = Lato-MediumItalic]
331 \newfontfamily\LatoMedium{Lato-Medium}[
332 Extension = .ttf,
333 UprightFont = *,
334 ItalicFont = *Italic]
335 \newcommand{\foliofont}{\LatoLight\fontsize{9pt}{11pt}\selectfont}
336 \newcommand{\hIfont}{\LatoMedium\fontsize{14pt}{16pt}\selectfont}
337 \newcommand{\hIIfont}{\LatoMedium\fontsize{12.5pt}{12pt}\selectfont}
338 \newcommand{\hIIIfont}{\LatoMedium\fontsize{11pt}{12pt}\selectfont}
339 \newcommand{\hIVfont}{\LatoMedium\fontsize{10pt}{12pt}\selectfont}
340 \newcommand{\fnmarkfont}{\LatoMedium\fontsize{10pt}{11pt}\selectfont}
341 \newcommand{\fnmarktextfont}{\LatoMedium\fontsize{8pt}{10pt}\selectfont}
342 \newcommand{\fnfont}{\LatoLight\fontsize{8pt}{10pt}\selectfont}
343 \fi
344 \let\bibfont\fnfont
345 \ifdeutschesmuseum@garamondmath
346 \RequirePackage[math-style=ISO, bold-style=ISO]{unicode-math}
347 \setmathfont{Garamond-Math.otf}[StylisticSet={7,9}]
348 \else
349 \RequirePackage{amssymb}
350 \fi
351 % \end{macrocode}
352 %
353 % Font sizes. We redefine |amsart| ones
354 % \begin{macrocode}
355 \def\@typesizes{%
356 \or{5}{6}\or{5}{6}\or{6}{7}\or{7}{8}\or{8}{10}%
357 \or{9.25}{11}% normalsize
358 \or{10}{12}\or{\@xipt}{13}\or{\@xiipt}{14}%
359 \or{\@xivpt}{17}\or{\@xviipt}{20}}%
360 \normalsize \linespacing=\baselineskip
361 % \end{macrocode}
362 %
363 %
364 %\section{Page dimensions and paragraphing}
365 %\label{dimensions}
366 %
367 % \begin{macrocode}
368 \usepackage[paperwidth=155mm, paperheight=220mm, includeheadfoot,
369 headheight=15pt, headsep=0.35in,
370 inner=20mm, outer=17mm, top=8.3mm, bottom=14.1mm]{geometry}
371 \setlength\parskip{0pt}
372 \setlength\parindent{5mm}
373 \renewcommand{\arraystretch}{0.9}
374 \renewenvironment{quotation}{\list{}{%
375 \leftmargin5mm \listparindent\normalparindent
376 \itemindent\z@
377 \rightmargin\leftmargin \parsep\z@ \@plus\p@}%
378 \item[]%
379 }{%
380 \vspace\baselineskip
381 \endlist
382 }
383 \let\endquotation=\endlist % for efficiency
384 \renewenvironment{quote}{%
385 \list{}{\rightmargin5mm\leftmargin\rightmargin}\item[]%
386 }{%
387 \vspace\baselineskip
388 \endlist
389 }
390 % \end{macrocode}
391 %
392 %\section{Colors}
393 %\label{sec:colors}
394 %
395 % We use DeutscheMuseumRed color
396 % \begin{macrocode}
397 \RequirePackage{xcolor}
398 \definecolor{DeutschesMuseumRed}{cmyk}{0.36,0.87,0.61,0.33}
399 % \end{macrocode}
400 %
401 %\section{Front matter}
402 %\label{sec:front_matter}
403 %
404 % \begin{macro}{\subtitle}
405 % The subtitle
406 % \begin{macrocode}
407 \newcommand\subtitle[1]{\def\@subtitle{#1}\def\shorttitle{#1}}
408 \subtitle{}
409 % \end{macrocode}
410 % \end{macro}
411 %
412 % \begin{macro}{\maketitle}
413 % And |maketitle| command
414 % \begin{macrocode}
415 \renewcommand\maketitle{%
416 \@afterindentfalse
417 \ifx\@empty\shortauthors \let\shortauthors\shorttitle
418 \else \andify\shortauthors
419 \fi
420 \par
421 \@topnum\z@ % this prevents figures from falling at the top of page
422 \thispagestyle{firstpage}%
423 \ifx\@title\@empty
424 \else{\noindent\color{DeutschesMuseumRed}\hIfont\@title\par}\fi
425 \ifx\@subtitle\@empty\else
426 {\vspace\baselineskip\noindent\hIIfont\@subtitle\par}%
427 \fi
428 {\noindent\author@andify\authors\normalsize\normalfont\itshape\authors\vspace\baselineskip\par}%
429 \@afterheading
430 }
431 % \end{macrocode}
432 % \end{macro}
433 %
434 % \begin{macro}{\abstract}
435 % \changes{1.1}{2025/09/04}{Added abstract handling}
436 % \changes{1.3}{2025/09/25}{Abstract is now a normal unnumbered
437 % section}
438 % \changes{1.6}{2026/01/13}{Deleted space between abstract and the
439 % body}
440 % \changes{1.6}{2026/01/13}{Added space before abstract}
441 % Abstract is an unnumbered section divided from the body
442 % \begin{macrocode}
443 \renewenvironment{abstract}{\par\vspace{2.5ex}\section*{\abstractname}}{}
444 % \end{macrocode}
445 % \end{macro}
446 %
447 %\subsection{Sectioning}
448 %\label{sec:sectioning}
449 %
450 % \begin{macro}{\section}
451 % The standard sectioning
452 % \begin{macrocode}
453 \renewcommand\section{%
454 \@startsection{section}{1}{\z@}{-2\baselineskip}{\baselineskip}{\hIIIfont}}
455 % \end{macrocode}
456 % \end{macro}
457 % \begin{macro}{\subsection}
458 % The standard subsectioning
459 % \begin{macrocode}
460 \renewcommand\subsection{%
461 \@startsection{subsection}{2}{\z@}{-\baselineskip}{1sp}{\hIVfont}}
462 % \end{macrocode}
463 % \end{macro}
464 %
465 %
466 %\section{Footnotes}
467 %\label{sec:footnotes}
468 %
469 % \begin{macro}{\footnoterule}
470 % We do not wnat rules
471 % \begin{macrocode}
472 \def\footnoterule{}
473 % \end{macrocode}
474 % \end{macro}
475 %
476 % \begin{macro}{\@makefnmark}
477 % The footnote marker in the text
478 % \begin{macrocode}
479 \def\@makefnmark{\textsuperscript{{\color{DeutschesMuseumRed}\fnmarktextfont\@thefnmark}}}
480 % \end{macrocode}
481 % \end{macro}
482 %
483 % \begin{macro}{\@makefntext}
484 % The text of a footnote
485 % \begin{macrocode}
486 \def\@makefntext{{\color{DeutschesMuseumRed}\fnmarktextfont\@thefnmark}\quad
487 \fnfont}
488 % \end{macrocode}
489 % \end{macro}
490 %
491 %
492 %\section{Page styles}
493 %\label{sec:page_styles}
494 %
495 % \begin{macrocode}
496 \RequirePackage{fancyhdr}
497 % \end{macrocode}
498 %
499 % Standard headers
500 % \begin{macrocode}
501 \renewcommand{\headrulewidth}{0pt}
502 \renewcommand{\footrulewidth}{0pt}
503 % \end{macrocode}
504 %
505 % First page style
506 % \begin{macrocode}
507 \fancypagestyle{firstpage}{\fancyhf{}%
508 \fancyhead[RO]{\ifdeutschesmuseum@folios\foliofont\thepage\fi}%
509 \fancyhead[LE]{\ifdeutschesmuseum@folios\foliofont\thepage\fi}%
510 }
511 % \end{macrocode}
512 %
513 % And the standard page style
514 % \begin{macrocode}
515 \fancypagestyle{standard}{%
516 \fancyhf{}%
517 \fancyhead[RO]{\ifdeutschesmuseum@folios\foliofont\shorttitle\quad\thepage\fi}%
518 \fancyhead[LE]{\ifdeutschesmuseum@folios\foliofont\thepage\quad\shortauthors\fi}%
519 }
520 % \end{macrocode}
521 %
522 %
523 %\section{Floats}
524 %\label{sec:floats}
525 %
526 % \changes{1.6}{2026/01/13}{Remade captions}
527 % \changes{1.7}{2026/01/14}{singleline check for captions}
528 % \begin{macrocode}
529 \RequirePackage{caption}
530 \DeclareCaptionFont{capfont}{\foliofont}
531 \captionsetup{font=capfont, textfont=capfont,
532 labelfont={capfont,bf}, labelsep=quad, justification=centering}
533 \captionsetup[figure]{name=Fig.}
534 \captionsetup[table]{name=Table, position=top}
535 % \end{macrocode}
536 %
537 %\section{Bibliography}
538 %\label{sec:biblio}
539 %
540 % We use natbib
541 % \begin{macrocode}
542 \RequirePackage{natbib}
543 % \end{macrocode}
544 %
545 % \begin{macro}{\cite}
546 % Our citations are footnotes
547 % \begin{macrocode}
548 \RenewDocumentCommand{\cite}{O{}O{}m}{\footnote{\citealt[#1][#2]{#3}}}
549 % \end{macrocode}
550 % \end{macro}
551 %
552 % And some redefinitions
553 % \begin{macrocode}
554 \renewcommand\bibsection{}
555 \renewcommand\refname{Bibliography}
556 \def\bibpreamble{\setlength\multicolsep{\z@}\begin{multicols}{2}[\section*{\refname}]}
557 \def\bibcleanup{\vskip-\lastskip\end{multicols}}%
558 % \end{macrocode}
559 %
560 %\subsection{End of Class}
561 %\label{end}
562 %
563 %
564 % \begin{macrocode}
565 \pagestyle{standard}
566 \normalsize
567 \normalfont
568 %</class>
569 % \end{macrocode}
570 %
571 %
572 %\Finale
573 %\clearpage
574 %
575 %\PrintChanges
576 %\clearpage
577 %\PrintIndex
578 %
579 \endinput