summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/simplecd/simplecd.dtx
blob: 4b6b3245eaeadef81c4ebf15d9a610758475d70b (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
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732

% \iffalse meta-comment
%
% Copyright (C) 2010 by Daniel Majoros
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.2 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.2 or later is part of all distributions of
% LaTeX version 1999/12/01 or later.
%
% \fi
%
%\iffalse
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{simplecd}
%<package>    [2010/07/01 v1.0 simple cd, dvd covers]
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{simplecd}
\usepackage{fix-cm}
\usepackage{rotating}

\EnableCrossrefs
\CodelineIndex
\RecordChanges
            
\begin{document}
     \DocInput{./simplecd.dtx} 
\end{document}
%</driver>
%\fi
% 
% \CheckSum{451}
%
% \CharacterTable
% {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
%     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
%     Digits \0\1\2\3\4\5\6\7\8\9
%     Exclamation         \!     Double quote    \"     Hash (number)   \#
%     Dollar              \$     Percent         \%     Ampersand       \&
%     Acute accent        \'     Left paren      \(     Right paren     \)
%     Asterisk            \*     Plus            \+     Comma           \,
%     Minus               \-     Point           \.     Solidus         \/
%     Colon               \:     Semicolon       \;     Less than       \<
%     Equals              \=     Greater than    \>     Question mark   \?
%     Commercial at       \@     Left bracket    \[     Backslash       \\
%     Right bracket       \]     Circumflex      \^     Underscore      \_
%     Grave accent        \`     Left brace      \{     Vertical bar    \|
%     Right brace         \}     Tilde           \~}
%
% \changes{v1.0}{2010/07/01}{Initial version}
%
% \DoNotIndex{\newline, \\, \space, \begin, \end, \rule, \cline, \hspace, \vspace, \centering, \DeclareRobustCommand}
% \DoNotIndex{\newcommand, \newlength, \setlength, \parbox, \line, \putline, \resizebox, \unitlength}
% \DoNotIndex{\put, \RequirePackage, \vrule, \DeclareOption, \fontsize, \ProcessOptions, \relax}
% \DoNotIndex{\renewcommand, \selectfont, \multicolumn, \! , !\! , !\ }
%
% \GetFileInfo{simplecd.sty}
%
% \title{The \textsf{simplecd} package\thanks{This document
%  corresponds to \textsf{simplecd}~\fileversion,
%  dated~\filedate.}}
% \author{D\'aniel Majoros}
%
% \maketitle

% \begin{abstract}
%     The simplecd package provides printable cut-outs for various CD, DVD and other disc holders.
%     The name of the package comes form it's implementation and ease of use.
% \end{abstract}
%
% \section{Introduction}
% The \textsf{simplecd} package was created for producing cut-outs for creating covers, inlays(inlets) for 
% optical disc packaging such as jewel cases, keepcases. The covers were aimed for containing only 
% simple text with different font sizes, but since it is only a |\parbox| in a tabular enviroment's cell, it can
% contain anything that a |\parbox| can contain.
%
% There are also macros which can resize ready-to-print images to the appropriate size.
%
% It is worth to decrease the document's margins, so the covers can fit onto
% an A4 sized paper. For this, use the \textsf{geometry} package, like so: \\
% |\usepackage[left=1cm, top=1cm, right=1cm, bottom=1cm]{geometry}|
%
% Since \textsf{simplecd} package uses the \textsf{rotating} package for rotation, one important
% note from the \textsf{rotating} package's documentation must be mentioned here.
% \begin{quotation}
% Note that the package uses rotation facilities from the graphicx package. When
% generating DVI output, users should note that rotation is typically not visible in
% a DVI viewer: conversion to, and viewing, PostScript or PDF is necessary.
% \end{quotation}
%
% \section{Usage}
%
% This section gives a detailed information on macros. Lists their parameters also. The universal macros are
% also detailed, which are behind the simple ones, and can be parmeterised with additional information
% to meet other requirements. 
%
% Do not put too many text inside a cover, or an unwanted resize can happen. Some of the examples in this 
% documentation were rotated, and all of them were shrunk.
%
% \DescribeMacro{\covers}
% The first and foremost macro is for the standard jewel case and it's backsheet with two spines.
% The parameters of the |\covers| macro are as follows:
% |\covers| \oarg{backsheet text} \marg{cover title} \marg{spine text}. The first two can be
% whole paragraphs with different font sized texts. For a new line, you can use |\\|,
% and for a skip, use |\vspace{length to skip}| in the text after a new line. Besides the first text part,
% the other texts after a |\vspace| can be resized with the \textsf{fix-cm} package's |\fontsize| command.
% The spine text will be printed on both spines. The spine
% text should be short enough to fit into the desired space.
%
% Example: \\
% |\covers|\\
%  \indent |[{\Large Backsheet text}]| \\
%  \indent |{{\Huge Jewelcase Title} \\ \vspace{1cm} Subtitle}| \\
%  \indent |{Spine Text}| \\
%
% \resizebox{0.95\textwidth}{!}{\covers[{\Large Backsheet text}]{{\Huge Jewelcase Title} \\ \vspace{1cm} Subtitle}{Spine Text}}
% 
% \vspace*{0.5cm}
%
% \DescribeMacro{\frontcover}
% The |\frontcover|, which is called in the previously mentioned macro, produces the front cover for
% the jewel case. It's mandatory argument is the cover text: |\frontcover| \marg{cover text}.
%
% \DescribeMacro{\backsheet}
% The |\backsheet| macro is also called from the |\covers| macro. It produces the backsheet with two
% identical spines. The usage is |\backsheet| \oarg{backsheet middle text} \marg{spine text}.
%
% \DescribeMacro{\jewelspine}
% The |\jewelspine| macro creates a single spine for the jewelcase. It's usage is |\jewelspine| \marg{spine text}.
%
% \DescribeMacro{\djewel}
% The |\djewel| macro creates a double page jewel case cover. Text can be put on one side, then it should be folded
% in half. The usage is: |\djewel| \marg{first page text} \marg{second page text}.
%
% Example: \\
% |\djewel| \\
%   \indent |{\fontsize{70}{36}\selectfont Big Title}| \\
%   \indent |{Second page}| \\
%
% \begin{sideways}\resizebox{0.48\textwidth}{!}{\djewel{\fontsize{70}{36}\selectfont Big Title}{Second page}}\end{sideways}
%
% \vspace*{0.5cm}
%
% This is also an example of using costum sized fonts with the \textsf{fix-cm} package.
%
% \DescribeMacro{\slimdvd} \DescribeMacro{\dvd}
% The |\slimdvd| and |\dvd| macros creates a slim and a simple DVD keepcase. Text can be put on both 
% sides plus the spine area. \DescribeMacro{\bluray} The |\bluray| macro creates a keepcase for Blu-Ray disks.
% Their usage is: |\dvd| \oarg{backside text} \marg{cover text} \marg{spine text}.
%
% Example: \DescribeMacro{\slimdvd} \\
% |\slimdvd| \\
%  \indent |[{\Large Backsheet text}]| \\                                  
%  \indent |{{\Huge \underline{SlimDVD Title}} \\ \vspace{1cm} Subtitle}|  \\    
%  \indent |{Spine Text}|  \\
%
% \begin{turn}{270}\resizebox{0.65\textwidth}{!}{\slimdvd[{\Large Backsheet text}]%
% {{\Huge \underline{SlimDVD Title}} \\ \vspace{1cm} Subtitle}{Spine Text}} \end{turn}
%
% \vspace*{0.5cm}
%
% \DescribeMacro{\keepcase}
% The above mentioned macros are really similar, thus the introduction of the |\keepcase| macro. With this, one can create
% a costum sized keepcase in the format of cover, spine and a backside. It's usage is: 
% |\keepcase| \oarg{backtext} \marg{cover text} \marg{spinetext} \marg{cover height} \marg{cover width} \marg{spine width}.
% The cover width refers to one side's width without the spine.
%
% \DescribeMacro{\sleeve}
% The |\sleeve| macro creates a disk-sleeve which requires some glue after cutting it out. The upper part 
% can be used to close the sleeve. Text can be put on 
% it's cover. The usage is: |\sleeve| \marg{cover text}.
%
% Example: \\
% |\sleeve| |{{\Huge Sleeve text}}| \\
%
% \resizebox{0.5\textwidth}{!}{\sleeve{{\Huge Sleeve text}}}
%
% \vspace*{0.5cm}
%
% \DescribeMacro{\coverimg} \DescribeMacro{\backsheetimg} \DescribeMacro{\dvdimg} \DescribeMacro{\slimdvdimg}
% \DescribeMacro{\blurayimg}
% The macros width the \emph{img} ending are expecting an image, and resizing this image to the appropriate cover
% size. The macros are |\coverimg|, |\backsheetimg|, |\dvdimg|, |\slimdvdimg|, |\blurayimg|. Their usage is 
% |\coverimg| \parg{picture}. No image macro for 
% the sleeve. These macros does not keep the aspect ratio of the given image, thus it should already be at the 
% correct ratio.
%
% An example without the result: 
% |\dvdimg{includegraphics{coverpic}}| \\
%
% \vspace*{0.5cm}
%
% \DescribeMacro{\dvdinlay} \DescribeMacro{\blurayinlay}
% The |\dvdinlay| and |\blurayinlay| macros create a one sided inlay for the appropriate keepcases.
% Their usage is |\dvdinlay| \marg{text}. \DescribeMacro{\inlay} With the universal |\inlay| macro, one can create
% a costum sized inlay. It's usage is: |\inlay| \marg{text} \marg{inlay width} \marg{inlay height}.
%
% Example: \\
% |\dvdinlay| \\
%   \indent |{{\Large DVD Inlay}| \\
%   \ \\
%   \indent |\vspace{5cm} TextTextText| \\
%   \ \\
%   \indent |\vspace{1cm} {\fontsize{20}{36}\selectfont TextText}}| \\
%
% \resizebox{0.5\textwidth}{!}%
% {\dvdinlay{{\Large DVD Inlay}
%
% \vspace{5cm} TextTextText 
%
% \vspace{1cm} {\fontsize{20}{36}\selectfont TextText}}}
%
% \vspace*{0.5cm}
%
% \section{Package Options}
%
% All of the above presented macros are containing some text alignment lengths. Without them, the texts would be 
% centered vertically in the cells. The |noalign| option zeroes these alignment lengths, so one can align the 
% texts individually with the |\vspace| commands inside the text.
%
% As default, all covers contain folding lines. With the |nofold| option these can be removed. The only exception is 
% the |\sleeve| macro where the areas to be glued are keeping their folding lines.
%
% The |spiner| option rotates all spine texts with $180^\circ$. The \textsf{rotating} package (which is used for 
% rotating) is somewhat incompatible with
% utf8 encoding and/or T1 font type when it comes to upside-down text. So do not use the packages mentioned below
% with this option:
% \begin{quotation}
%   \noindent
%   |\usepackage{t1enc}| \\
%   |\usepackage{ucs}| \\
%   |\usepackage[utf8x]{inputenc}| \\
%   |\usepackage[T1]{fontenc}| \\
% \end{quotation}
% 
% \StopEventually{\PrintChanges\PrintIndex}
%
% \section{Implementation}
%
% Used for rotating text.
%    \begin{macrocode}
\RequirePackage{rotating}
%    \end{macrocode}
%
% Used for setting fix font size for spine texts.
%    \begin{macrocode}
\RequirePackage{fix-cm}
%    \end{macrocode}
%
% Used for the m tabular column
%    \begin{macrocode}
\RequirePackage{array}
%    \end{macrocode}
%
% Used for calculating lengths
%    \begin{macrocode}
\RequirePackage{calc}
%    \end{macrocode}

%    The |noalign| option sets all text aligning lengths to zero.
%    \begin{macrocode}
\DeclareOption{noalign}{
    \setlength{\sc@jfcalign}{0cm}
    \setlength{\sc@jbsalign}{0cm}
    \setlength{\sc@slalign}{0cm}
    \setlength{\sc@kcfalign}{0cm}
    \setlength{\sc@kcbalign}{0cm}
    \setlength{\sc@inalign}{0cm}
    \setlength{\sc@djewsalign}{0cm}
}
%    \end{macrocode}
%
%    The |nofold| option removes the folding lines on the cut-outs.
%    \begin{macrocode}
\DeclareOption{nofold}{
    \renewcommand{\sc@hfoldline}[1]{}
    \setlength{\sc@vfoldline}{0pt}
}
%    \end{macrocode}

% \begin{macro}{\sc@hfoldline}
%    Creates a horizontal folding line. \\
%    Usage: |\sc@hfoldline| \marg{columns} 
%    \begin{macrocode}
\newcommand{\sc@hfoldline}[1]{
    \cline{#1}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\sc@vfoldline}
%    Size of the default vertical folding line.
%    \begin{macrocode}
\newlength{\sc@vfoldline}
\setlength{\sc@vfoldline}{0.4pt}
%    \end{macrocode}
% \end{macro}

%    Redefines rotation degrees to rotate spine text with $180^\circ$.
%    \begin{macrocode}
\DeclareOption{spiner}{
    \renewcommand{\sc@spinerotone}{180}
    \renewcommand{\sc@spinerottwo}{90}
    \renewcommand{\sc@spinerotthree}{270}
}
%    \end{macrocode}

% \begin{macro}{\sc@spinerotone}
%    No rotation by default. \\
%    Usage: |\sc@spinerotone|
%    \begin{macrocode}
\newcommand{\sc@spinerotone}{0}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\sc@spinerottwo}
%    Default rotation degree. \\
%    Usage: |\sc@spinerottwo|
%    \begin{macrocode}
\newcommand{\sc@spinerottwo}{270}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\sc@spinerotthree}
%    Default rotation degree. \\
%    Usage: |\sc@spinerotthree|
%    \begin{macrocode}
\newcommand{\sc@spinerotthree}{90}
%    \end{macrocode}
% \end{macro}

% Dimension names are created as follows: prefixed with |sc@|, then some letters for
% identifying the case, then place, then width or height.
%
%% CD jewelcase dimensions
%    \begin{macrocode}
\newlength{\sc@cdjccoverheight}
\setlength{\sc@cdjccoverheight}{120mm}
\newlength{\sc@cdjccoverwidth}
\setlength{\sc@cdjccoverwidth}{120mm}
\newlength{\sc@cdjcbackheight}
\setlength{\sc@cdjcbackheight}{117.5mm}
\newlength{\sc@cdjcbackwidth}
\setlength{\sc@cdjcbackwidth}{138mm}
\newlength{\sc@cdjcspinewidth}
\setlength{\sc@cdjcspinewidth}{6mm}
%    \end{macrocode}

%% Jewelcase spine fixed text font size
%    \begin{macrocode}
\newcommand{\sc@cdjfontsize}{15}
%    \end{macrocode}

%% Disk sleeve dimensions
%    \begin{macrocode}
\newlength{\sc@dsdim}
\setlength{\sc@dsdim}{125mm}
%    \end{macrocode}

%% Slim DVD keepcase dimensions
%    \begin{macrocode}
\newlength{\sc@sdvdcoverwidth}
\setlength{\sc@sdvdcoverwidth}{128.5mm}
\newlength{\sc@sdvdspinewidth}
\setlength{\sc@sdvdspinewidth}{7mm}
%    \end{macrocode}

%% DVD keepcase dimensions
%    \begin{macrocode}
\newlength{\sc@dvdkcheight}
\setlength{\sc@dvdkcheight}{183mm}
\newlength{\sc@dvdkccoverwidth}
\setlength{\sc@dvdkccoverwidth}{129.5mm}
\newlength{\sc@dvdkcspinewidth}
\setlength{\sc@dvdkcspinewidth}{14mm}
\newlength{\sc@dvdkcinletwidth}
\setlength{\sc@dvdkcinletwidth}{115mm}
\newlength{\sc@dvdkcinletheight}
\setlength{\sc@dvdkcinletheight}{175mm}
%    \end{macrocode}

%% Blu-Ray case dimensions
%    \begin{macrocode}
\newlength{\sc@brcoverwidth}
\setlength{\sc@brcoverwidth}{128mm}
\newlength{\sc@brcoverheight}
\setlength{\sc@brcoverheight}{149mm}
\newlength{\sc@brspinewidth}
\setlength{\sc@brspinewidth}{14mm}
\newlength{\sc@brinletwidth}
\setlength{\sc@brinletwidth}{115mm}
\newlength{\sc@brinletheight}
\setlength{\sc@brinletheight}{140mm}
%    \end{macrocode}

%% Width and correction of the invisible |\rule|'s column 
%    \begin{macrocode}
\newlength{\sc@ircwidth}
\setlength{\sc@ircwidth}{0.1mm}
\newlength{\sc@ircorr}
\setlength{\sc@ircorr}{1mm}
%    \end{macrocode}

% Naming conventions in the aligning lengths: first letters are for the case, then f for front, b for back,
% and the align word.
%
%%Text aligning lengths
% These lengths ensure that the text is not in the vertical center of a cell,
% instead, they are little above of the center. 
%    \begin{macrocode}
\newlength{\sc@jfcalign}
\setlength{\sc@jfcalign}{1.5cm}
\newlength{\sc@jbsalign}
\setlength{\sc@jbsalign}{3cm}
\newlength{\sc@slalign}
\setlength{\sc@slalign}{1.5cm}
\newlength{\sc@kcfalign}
\setlength{\sc@kcfalign}{4cm}
\newlength{\sc@kcbalign}
\setlength{\sc@kcbalign}{3cm}
\newlength{\sc@inalign}
\setlength{\sc@inalign}{3cm}
\newlength{\sc@djewsalign}
\setlength{\sc@djewsalign}{3cm}
%    \end{macrocode}

%    \begin{macrocode}
\ProcessOptions\relax 
%    \end{macrocode}

% The covers are created as simple tabular cells, and in the rightmost cell is an invisible |\rule| that
% ensures the height of the cell regardless of the text inserted into the other cells. The width of the 
% cells are provided by the m column type of the \texttt{array} package.
%
% The space produced with the |\vspace| macros are for aligning purposes. Without them, the texts would be 
% vertically centered in the cell. 

% \begin{macro}{\covers}
%    Creates a jewel case cover with a front and a backsheet. \\
%    Usage: |\covers| \oarg{backsheet text} \marg{cover title} \marg{spine text}
%    \begin{macrocode}
\DeclareRobustCommand{\covers}[3][\ ]{
    \frontcover{#2}
    
    \vspace*{0.5cm}
    \backsheet[#1]{#3}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\frontcover}
%    Creates front cover for a jewel case. \\
%    Usage: |\frontcover| \marg{cover title}
%    \begin{macrocode}
\DeclareRobustCommand{\frontcover}[1]{
    \sc@cell{#1}{\sc@cdjccoverwidth}{\sc@cdjccoverheight}%
    {\vspace{\sc@jfcalign}}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\backsheet}
%    Creates backsheet for a jewel case with 2 spines. \\
%    Usage: |\backsheet| \oarg{backsheet middle text} \marg{spine text}
%    \begin{macrocode}
\DeclareRobustCommand{\backsheet}[2][\ ]{
    \begin{tabular}%
        {|@{\hspace{0.4mm}}m{\sc@cdjcspinewidth-0.4mm}@{}%
            !{\vrule width \sc@vfoldline}%
            @{}m{\sc@cdjcbackwidth}@{}%
            !{\vrule width \sc@vfoldline}@{}%
            m{\sc@cdjcspinewidth-0.4mm}@{\hspace{0.4mm}}%
            |m{\sc@ircwidth}}
        \cline{1-3}
        \centering%
        \begin{turn}{\sc@spinerotthree}%
            {\fontsize{\sc@cdjfontsize}{36}\selectfont #2 }%
        \end{turn} %
        & \parbox[c]{\sc@cdjcbackwidth}{\centering #1 \\ 
        \vspace{\sc@jbsalign}}%
        & \centering %
        \begin{turn}{\sc@spinerottwo}%
            {\fontsize{\sc@cdjfontsize}{36}\selectfont #2}%
        \end{turn} & \rule{0pt}{\sc@cdjcbackheight-\sc@ircorr} \\
        \cline{1-3}
    \end{tabular}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\jewelspine}
%    Creates a single spine for a jewel case. \\
%    Usage: |\jewelspine| \marg{text}
%    \begin{macrocode}
\DeclareRobustCommand{\jewelspine}[1]{
    \begin{tabular}{|@{}m{\sc@cdjcbackheight}@{}|m{\sc@ircwidth}}
        \cline{1-1} %
        \centering %
        {\fontsize{\sc@cdjfontsize}{36}\selectfont #1}& %
        \rule{0pt}{\sc@cdjcspinewidth-0.1cm} \\
        \cline{1-1}
    \end{tabular}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\sleeve}
%    Creates a disk sleeve for cutting out and glueing together. \\
%    Usage: |\sleeve| \marg{middle text}
%    \begin{macrocode}
\DeclareRobustCommand{\sleeve}[1]{
    \begin{tabular}{m{10mm}|@{}m{\sc@dsdim}@{}|m{10mm}m{\sc@ircwidth}}
        \multicolumn{3}{c}{ \setlength{\unitlength}{0.5cm} 
        \begin{picture}(0,0)% 
            \put(-12.5,-0.25){\line(1,1){4}}
            \put(-8.5,3.75){\line(1,0){17}}
            \put(12.5,-0.25){\line(-1,1){4}}
        \end{picture} \rule{0pt}{3cm}} \\
        \cline{2-2}
        \centering \setlength{\unitlength}{0.5cm}
        \begin{picture}(0,0)%
            \put(1.45,-12.38){\line(-1,1){1.5}}% 
            \put(-0.06,-10.9){\line(0,1){22.08}} %
            \put(-0.06,11.18){\line(1,1){1.5}}% 
        \end{picture} & \parbox[c]{\sc@dsdim}%
            {\centering #1 \\ \vspace{\sc@slalign}} &%
        \setlength{\unitlength}{0.5cm} %
        \begin{picture}(0,0)%
            \put(-0.45,-12.38){\line(1,1){1.5}}% 
            \put(1.04,-10.9){\line(0,1){22.08}} %
            \put(1.04,11.18){\line(-1,1){1.5}}% 
        \end{picture} & \rule{0pt}{\sc@dsdim-\sc@ircorr}\\
        \sc@hfoldline{2-2}
        & & & \rule{0pt}{\sc@dsdim-0.1cm} \\
        \cline{2-2}
    \end{tabular}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\keepcase}
%    Universal macro for creating keepcases in various sizes.
%    Usage: |\keepcase| \oarg{backtext} \marg{cover text} \marg{spinetext} \marg{cover height} \marg{cover width} \marg{spine width}
%    \begin{macrocode}
\DeclareRobustCommand{\keepcase}[6][]{
    \begin{tabular}{|@{}m{#4}@{}|m{\sc@ircwidth}}
        \cline{1-1}
        \centering
        \begin{sideways} \parbox[c]{#5}{\centering #2 %
            \\ \vspace{\sc@kcfalign}} %
        \end{sideways} & \rule{0pt}{#5-\sc@ircorr} \\
        \sc@hfoldline{1-1} \centering %
        \begin{turn}{\sc@spinerotone}%
            #3 %
        \end{turn}%
        & \rule{0pt}{#6-\sc@ircorr} \\
        \sc@hfoldline{1-1}%
        \centering %
        \begin{sideways} \parbox[c]{#5}{\centering #1\ \\ %
        \vspace{\sc@kcbalign}} \end{sideways} & %
        \rule{0pt} {#5-\sc@ircorr}\\
        \cline{1-1}
    \end{tabular}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\slimdvd}
%    Creates a slim dvd keepcase cover. \\
%    Usage: |\slimdvd| \oarg{back text} \marg{cover text} \marg{spine text}
%    \begin{macrocode}
\DeclareRobustCommand{\slimdvd}[3][]{
    \keepcase[#1]{#2}{#3}{\sc@dvdkcheight}{\sc@sdvdcoverwidth}%
        {\sc@sdvdspinewidth}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\dvd}
%    Creates a dvd keepcase. \\
%    Usage: |\dvd| \oarg{back text} \marg{cover text} \marg{spine text}
%    \begin{macrocode}
\DeclareRobustCommand{\dvd}[3][]{
    \keepcase[#1]{#2}{#3}{\sc@dvdkcheight}{\sc@dvdkccoverwidth-1.5mm}%
        {\sc@dvdkcspinewidth}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\bluray}
%    Creates a Blu-Ray keepcase.\\
%    Usage: |\bluray| \oarg{backtext} \marg{cover text} \marg{spine text}
%    \begin{macrocode}
\DeclareRobustCommand{\bluray}[3][]{
    \keepcase[#1]{#2}{#3}{\sc@brcoverheight}{\sc@brcoverwidth}%
        {\sc@brspinewidth}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\coverimg}
%    Resizes the image for a jewel case cover. \\
%    Usage: |\coverimg| \parg{picture}
%    \begin{macrocode}
\DeclareRobustCommand{\coverimg}[1]{
    \resizebox{\sc@cdjccoverwidth}{\sc@cdjccoverheight}{#1}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\backsheetimg}
%    Resizes the image for a jewel case backsheet with spines. \\
%    Usage: |\backsheetimg| \parg{picture}
%    \begin{macrocode}
\DeclareRobustCommand{\backsheetimg}[1]{
    \resizebox{\sc@cdjcbackwidth+\sc@cdjcspinewidth*2}%
        {\sc@cdjcbackheight}{#1}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\slimdvdimg}
%    Resizes an image for the slim dvd keepcase. \\
%    Usage: |\slimdvdimg| \parg{picture}
%    \begin{macrocode}
\DeclareRobustCommand{\slimdvdimg}[1]{
    \resizebox{\sc@dvdkcheight}%
        {\sc@sdvdcoverwidth*2+\sc@sdvdspinewidth}{#1}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\dvdimg}
%    Resizes an image for a dvd keepcase. \\
%    Usage: |\dvdimg| \parg{picture}
%    \begin{macrocode}
\DeclareRobustCommand{\dvdimg}[1]{
    \resizebox{\sc@dvdkcheight}%
        {\sc@dvdkccoverwidth*2+\sc@dvdkcspinewidth}{#1}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\blurayimg}
%    Resizes an image for the Blu-Ray keepcase. \\
%    Usage: |\blurayimg| \parg{picture}
%    \begin{macrocode}
\DeclareRobustCommand{\blurayimg}[1]{
    \resizebox{\sc@brcoverheight}%
        {\sc@brcoverwidth*2+\sc@brspinewidth}{#1}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\sc@cell}
%    Creates a single cell for a cover, inlay. \\
%    Usage: |\sc@cell| \marg{text} \marg{width} \marg{height} \marg{aligning space}
%    \begin{macrocode}
\DeclareRobustCommand{\sc@cell}[4]{
    \begin{tabular}{|@{}m{#2}@{}|m{\sc@ircwidth}}
        \cline{1-1}%
        \centering %
        \parbox[c]{#2}{\centering #1 \\ #4} & \rule{0pt}{{#3}-\sc@ircorr}\\
        \cline{1-1}
    \end{tabular}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\inlay}
%    Creates a costum sized inlay.
%    Usage: |\inlay| \marg{text} \marg{width} \marg{height}
%    \begin{macrocode}
\DeclareRobustCommand{\inlay}[3]{
    \sc@cell{#1}{#2}{#3}{\vspace{\sc@inalign}}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\dvdinlay}
%    Creates an inlay card for a dvd/slimdvd keepcase. \\
%    Usage: |\dvdinlay| \marg{text}
%    \begin{macrocode}
\DeclareRobustCommand{\dvdinlay}[1]{
    \inlay{#1}{\sc@dvdkcinletwidth}{\sc@dvdkcinletheight}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\blurayinlay}
%    Creates an inlay for a Blu-Ray keepcase.
%    Usage: |\blurayinlay| \marg{text}
%    \begin{macrocode}
\DeclareRobustCommand{\blurayinlay}[1]{
    \inlay{#1}{\sc@brinletwidth}{\sc@brinletheight}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\djewel}
%    Creates a two-page jewel case cover. \\
%    Usage: |\djewel| \marg{first page text} \marg{second page text}
%    \begin{macrocode}
\DeclareRobustCommand{\djewel}[2]{
    \begin{tabular}{|@{}m{\sc@cdjccoverheight}@{}|m{\sc@ircwidth}}
        \cline{1-1} %
        \centering%
        \begin{turn}{270}%
            \parbox[c]{\sc@cdjccoverwidth-\sc@ircorr}%
            {\centering #2 \\ \vspace{\sc@djewsalign}}%
        \end{turn}& \rule{0pt}{\sc@cdjccoverwidth-\sc@ircorr} \\
        \sc@hfoldline{1-1} %
        \centering%
        \begin{turn}{270}%
            \parbox[c]{\sc@cdjccoverwidth-\sc@ircorr}%
            {\centering #1 \\ \vspace{\sc@jfcalign}}%
        \end{turn} & \rule{0pt}{\sc@cdjccoverwidth-\sc@ircorr} \\
        \cline{1-1}
    \end{tabular}
}
%    \end{macrocode}
% \end{macro}
%
% \Finale
\endinput