summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gamebook/gamebook.sty
blob: 6cdd574b16e66c07be5003180a0feaef3855f7b6 (plain)
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
%%
%% This is file `gamebook.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% gamebook.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2011 by A. Miede, http://www.miede.de
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{gamebook}
    [2011/11/29 v1.0 Style for gamebooks/interactive novels]
\RequirePackage{ifthen}
    \newboolean{@debug}
    \newboolean{@drafting}

\DeclareOption{debug}{\setboolean{@debug}{true}}
\DeclareOption{draft}{\setboolean{@drafting}{true}}
\ProcessOptions\relax
\RequirePackage{fancyhdr}
\RequirePackage{extramarks}
\newcommand{\gbheadtext}{Gamebook}
\newcommand{\gbheader}{%
\pagestyle{fancy}%
\renewcommand{\sectionmark}[1]{\markboth{\thesection}{\thesection}}%
\fancyhead{}% clear all header fields
\fancyhead[LO,RE]{\small\gbheadtext}
\fancyhead[RO,LE]{\small\ifthenelse{\equal{\firstleftmark}%
{\leftmark}}{\leftmark}{\firstleftmark~--~\leftmark}}%
}
\newcommand{\gbdebug}[1]{\protect{\ifthenelse{\boolean{@debug}}%
{~\texttt{\scriptsize(#1)}}{\relax}}}
\newcommand{\gbdebugx}[1]{\protect{\ifthenelse{\boolean{@debug}}%
{\marginpar{\texttt{\scriptsize(#1)}}}{\relax}}}
\RequirePackage{titlesec}
\titleformat{\section}[block]{%
\centering\bfseries}{\fbox{\thesection}}{1em}{\relax}
\newcommand{\gbsection}[1]{\section{\label{#1}}\gbdebugx{#1}}
\newcommand{\gbturntext}{turn~to~}
\newcommand{\gbturn}[1]{\gbturntext{\bfseries\ref{#1}}\gbdebug{#1}}%\fbox
\newenvironment{gbtabbing}
  {\setlength{\topsep}{0pt}%
  \setlength{\tabbingsep}{0pt}%
   \setlength{\partopsep}{0pt}%
   \tabbing}%
  {\endtabbing}

\newcommand{\gbvillain}[5]{%
\hfill\begin{gbtabbing}%
\hspace{\parindent}\= Sehr sehr langer Name %
\= Sehr langer Skill + Wert \= Sehr langer Skill + Wert \kill%
\> \textsc{#1} \> #2~#3 \> #4~#5 \\%
\end{gbtabbing}%
}%
\RequirePackage{enumitem}
\newlist{gbturnoptions}{itemize}{1}
\setlist[gbturnoptions]{%
leftmargin=\parindent,labelindent=\parindent,label=} % noitemsep
\newcommand{\gbitem}[2]{\item #1\hfill\gbturn{#2}}
\ifthenelse{\boolean{@drafting}}{%
    \RequirePackage{draftwatermark}%
     \SetWatermarkLightness{0.9}
\SetWatermarkScale{.5}
\SetWatermarkText{Draft}
\RequirePackage{scrtime} % time access
\PassOptionsToPackage{draft}{prelim2e}
\RequirePackage{prelim2e}
\renewcommand{\PrelimWords}{\relax}
\renewcommand{\PrelimText}%
{\footnotesize[\,\today\ at \thistime\,]}}{\relax}
\endinput
%%
%% End of file `gamebook.sty'.