summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/papercdcase/interactive.tex
blob: 11c93418aff37b491ccb95e9326655db1d174e67 (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
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
\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{papercdcase}
\usepackage[margin=0pt]{geometry}
\usepackage{mdwlist}

\pagestyle{empty}
\setlength{\parindent}{0pt}

\def\maxilatchtext#1{\setcdlatchmatter{\textsf{\textbf{\Large #1}}}}
\def\maxispinetext#1{\setcdspinematter{\textsf{\textbf{\large #1}}}}
\def\maxibacktext#1#2{\setcdbackmatter{\textsf{\textbf{\Large #1}\small #2}}}

\def\latchtext#1{\setcdlatchmatter{\textsf{\textbf{\LARGE #1}}}}
\def\spinetext#1{\setcdspinematter{\textsf{\textbf{\Large #1}}}}
\def\backtext#1#2{\setcdbackmatter{\textsf{\textbf{\LARGE #1}#2}}}

\def\empty{}
\def\yes{yes}

\toksdef\ta=0%
\toksdef\tb=2%
\long\def\rightappenditem#1\to#2{\ta={#1}\tb=\expandafter{#2}\edef#2{\the\tb\the\ta}}
\long\def\erightappenditem#1\to#2{\tb=\expandafter{#2}\xdef#2{\the\tb\noexpand{#1}}}

\def\msg{****************************************************************************}

\begin{document}

\typeout{}
\typeout{\msg}
\typeout{* Please enter "yes" if you'd like to create a case for a maxi (80mm) CD,}
\typeout{* just hit enter if not!}
\typein[\cdmaxi]{\msg}

\typeout{}
\typeout{\msg}
\typeout{* Please enter the artist, if any!}
\typein[\cdartist]{\msg}

\typeout{}
\typeout{\msg}
\typeout{* Please enter the CD title, if any!}
\typein[\cdtitle]{\msg}

\newif\iftrackgiven
\def\tracks{}
\typeout{}
\typeout{\msg}
\typeout{* Please enter the tracks (to finish, just enter a blank line)!}
\loop
\def\nexttrack{}
\typein[\nexttrack]{\msg}
\ifx\nexttrack\empty%
\trackgivenfalse%
\else%
\rightappenditem\item\to\tracks%
\erightappenditem\nexttrack\to\tracks%
\trackgiventrue%
\fi%
\iftrackgiven%
\def\msg{}%
\repeat

\ifx\cdmaxi\yes%
\ifx\cdtitle\empty%
\maxilatchtext{\cdartist}%
\maxispinetexi{\cdartist}%
\ifx\tracks\empty%
\maxibacktext{\cdartist}{}%
\else%
\maxibacktext{\cdartist}{\begin{enumerate*}\tracks\end{enumerate*}}%
\fi\else\ifx\cdartist\empty%
\maxilatchtext{\cdtitle}%
\maxispinetext{\cdtitle}%
\ifx\tracks\empty%
\maxibacktext{\cdtitle}{}%
\else%
\maxibacktexi{\cdtitle}{\begin{enumerate*}\tracks\end{enumerate*}}%
\fi\else%
\maxilatchtext{\cdartist\\[0.25\baselineskip]\cdtitle}%
\maxispinetext{\cdartist/\cdtitle}%
\ifx\tracks\empty%
\maxibacktext{\cdartist\\[0.25\baselineskip]\cdtitle}{}%
\else%
\maxibacktext{\cdartist\\[0.25\baselineskip]\cdtitle}{\begin{enumerate*}\tracks\end{enumerate*}}%
\fi\fi\fi
\centering\papercdcase[80]
\else
\ifx\cdtitle\empty%
\latchtext{\cdartist}%
\spinetexi{\cdartist}%
\ifx\tracks\empty%
\backtext{\cdartist}{}%
\else%
\backtext{\cdartist}{\begin{enumerate*}\tracks\end{enumerate*}}%
\fi\else\ifx\cdartist\empty%
\latchtext{\cdtitle}%
\spinetext{\cdtitle}%
\ifx\tracks\empty%
\backtext{\cdtitle}{}%
\else%
\backtexi{\cdtitle}{\begin{enumerate*}\tracks\end{enumerate*}}%
\fi\else%
\latchtext{\cdartist\\[0.4\baselineskip]\cdtitle}%
\spinetext{\cdartist/\cdtitle}%
\ifx\tracks\empty%
\backtext{\cdartist\\[0.4\baselineskip]\cdtitle}{}%
\else%
\backtext{\cdartist\\[0.4\baselineskip]\cdtitle}{\begin{enumerate*}\tracks\end{enumerate*}}%
\fi\fi\fi
\centering\papercdcase
\fi

\end{document}