diff options
author | Karl Berry <karl@freefriends.org> | 2007-02-28 01:31:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-02-28 01:31:43 +0000 |
commit | 6fc4926b8b360e85e414b3cce37ca44b76d582c3 (patch) | |
tree | 410fa70a4a13f7c42cb7d66f830fd27623d862f6 /Master/texmf-dist/tex/latex/dvdcoll/dvdcoll.cls | |
parent | e296cc104495839488dd298c8fb0a569cf62309f (diff) |
dvdcoll update (26feb07)
git-svn-id: svn://tug.org/texlive/trunk@3995 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/dvdcoll/dvdcoll.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/dvdcoll/dvdcoll.cls | 248 |
1 files changed, 224 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/dvdcoll/dvdcoll.cls b/Master/texmf-dist/tex/latex/dvdcoll/dvdcoll.cls index 81e46fcb1e7..f3a33c601c6 100644 --- a/Master/texmf-dist/tex/latex/dvdcoll/dvdcoll.cls +++ b/Master/texmf-dist/tex/latex/dvdcoll/dvdcoll.cls @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2006 by: +%% Copyright (C) 2006-2007 by: %% Josef Kleber %% <josef.kleber@gmx.net> %% @@ -22,12 +22,13 @@ % \NeedsTeXFormat{LaTeX2e}% % -\ProvidesClass{dvdcoll}[2006/10/06 dvdcoll.cls v0.6a - Josef Kleber (C) 2006]% +\ProvidesClass{dvdcoll}[2007/02/23 dvdcoll.cls v1.0 - Josef Kleber (C) 2006-2007]% % \RequirePackage{xkeyval}% \RequirePackage{ifthen}% % % +% define class option language for setting a language \define@key{dvdcoll.cls}{language}[babel]% {% \ifthenelse{\NOT\equal{#1}{babel}}% @@ -88,6 +89,7 @@ }% }% % +% define class option dvdlabel for horizontal positioning of the label \define@choicekey*{dvdcoll.cls}{dvdlabel}[\valuedvdcoll\nr]{wide,narrow}[wide]% {% \ifcase\nr\relax% @@ -97,6 +99,7 @@ \fi% }% % +% define class option dvdskip for vertical space after Dvd \define@choicekey*{dvdcoll.cls}{dvdskip}[\valuedvdskip\nr]{small,medium,big}[medium]% {% \ifcase\nr\relax% @@ -108,6 +111,7 @@ \fi% }% % +% define class option pagenumbers (yes,no) \define@choicekey*{dvdcoll.cls}{pagenumbers}[\valuepagenumbers\nr]{yes,no}[yes]% {% \ifcase\nr\relax% @@ -121,6 +125,7 @@ \fi% }% % +% define class option heading for numbered or unnumbered headings \define@choicekey*{dvdcoll.cls}{heading}[\valueheading\nr]{number,nonumber}[nonumber]% {% \ifcase\nr\relax% @@ -128,7 +133,7 @@ \AtBeginDocument% {% \setcounter{secnumdepth}{4}% - \SetTOCSecIndent{1em}% + \SetTOCSecIndent{2.2em}% \SetLFRSecNumwidth{4.5em}% }% }% @@ -137,21 +142,25 @@ \AtBeginDocument% {% \setcounter{secnumdepth}{-2}% - \SetTOCSecIndent{1em}% + \SetTOCSecIndent{0em}% \SetLFRSecNumwidth{0em}% }% \fi% }% % +% define command option (DvdSeries) dvdnumbering for dvd numbering style \define@choicekey*{DvdSeries}{dvdnumbering}[\valuedvdnumbering\nr]{normal,season}[normal]% {% \ifcase\nr\relax% \renewcommand{\dc@option@dvdnumbering}{normal}% + \renewcommand*\toclevel@dcdvd{1}% \or% \renewcommand{\dc@option@dvdnumbering}{season}% + \renewcommand*\toclevel@dcdvd{2}% \fi% }% % +% define command option (DvdSeries) titlenumbering for dvd title numbering style \define@choicekey*{DvdSeries}{titlenumbering}[\valuetitlenumbering\nr]{normal,season}[normal]% {% \ifcase\nr\relax% @@ -161,6 +170,36 @@ \fi% }% % +% define command option (DvdSeries) labelbase for setting a base counter in automatic labeling +\define@key{DvdSeries}{labelbase}[-1]% +{% + \renewcommand*\dc@option@labelbase{#1}% + \setcounter{labelcount}{#1}% + \addtocounter{labelcount}{-1}% +}% +% +% define command option (DvdSeries) labelbase for setting a prefix of the base counter in automatic labeling +\define@key{DvdSeries}{labelbaseprefix}[]% +{% + \renewcommand*\dc@option@labelbaseprefix{#1}% +}% +% +% define command option (DvdSeries) labelbase for setting a suffix of the base counter in automatic labeling +\define@key{DvdSeries}{labelbasesuffix}[]% +{% + \renewcommand*\dc@option@labelbasesuffix{#1}% +}% +% +% define command option (DvdSeries) labelbase for setting the length of the base counter in automatic labeling +\define@key{DvdSeries}{labelbaselength}[4]% +{% + \ifnum#1<1% + \ClassError{dvdcoll}{labelbaselength < 1}{labelbaselength < 1 makes no sense\MessageBreak% + please increase labelbaselength}% + \fi% + \renewcommand*\dc@option@labelbaselength{#1}% +}% +% % \ExecuteOptionsX{dvdlabel,dvdskip,pagenumbers,heading,language}% % @@ -171,11 +210,14 @@ \RequirePackage{tabularx}% \RequirePackage{booktabs}% \RequirePackage{array}% +\RequirePackage{multicol}% +\RequirePackage{ragged2e}% \RequirePackage{pdfnotiz}% +\RequirePackage{dcwrtbib}% \RequirePackage[naturalnames=true,hypertexnames=false]{hyperref}% %--- naturalnames=true,hypertexnames=false --- verhindert das mehrfache Anlegen von hyperref-Ankern % (bedingt durch das Rücksetzen des Zahlers chapter) -% und beseitigt die Warnungen (ext4) von hyperref +% und beseitigt die Warnungen (ext4) von hyperref % % %--- Package adjustments --- @@ -191,6 +233,13 @@ \newcounter{season}% \newcounter{seasontitlecount}% \newcounter{seasondvd}% +% for generation of labelbase +\newcounter{labelcount}% +% to produce a unique hyperref destination for season bookmark +\newcounter{bookmarkcount}% +\setcounter{bookmarkcount}{0}% +%to prevent several bookmarks for the same season +\newcounter{bookmarkseason}% % % %--- Variables --- @@ -204,6 +253,8 @@ % \def\dc@third{min}% \def\dc@addhspace@title@count{0.7em}% +% used hspace in the BibTeX file +\def\DvdBibSpace{\string\hspace{0.7em}}% % % \***skip aus source2e; etwas vergrößert \def\dc@smallskip{\vspace{6pt plus 2pt minus 2pt}}% @@ -218,10 +269,17 @@ \newcommand*\dc@miss{}% \newcommand*\dc@lfrname{}% \newcommand*\dc@pdf@subject{}% +\newcommand*\dc@dvdlist{}% +\newcommand*\dc@season{}% +\newcommand*\dc@pdftitle{}% % % \newcommand*\dc@option@titlenumbering{}% \newcommand*\dc@option@dvdnumbering{}% +\newcommand*\dc@option@labelbase{}% +\newcommand*\dc@option@labelbaseprefix{}% +\newcommand*\dc@option@labelbasesuffix{}% +\newcommand*\dc@option@labelbaselength{}% % % \newcommand*\dc@pcwlz[1]% PrintCounterWithLeadingZero @@ -264,6 +322,64 @@ }% }% % +% all \leadzeros provided by Heiko Oberdiek in d.c.t.t, Msg-Id: <eqrquu$f52$1@news.BelWue.DE> +\newcommand*{\leadzero}[2]{% + \ifnum#2<0 % + -% + \expandafter\@leadzero\expandafter{% + \romannumeral\number#1000\expandafter + }\expandafter{% + \number-#2% + }% + \expandafter\@firstofone\expandafter{\number-#2}% + \else + \expandafter\@leadzero\expandafter{% + \romannumeral\number#1000\expandafter + }\expandafter{% + \number#2% + }% + \expandafter\@firstofone\expandafter{\number#2}% + \fi +} +\def\@leadzero#1#2{% + \ifx\\#2\\% + \@@leadzero#1\@nil + \else + \ifx\\#1\\% + \else + \expandafter\@@@leadzero\expandafter{\@gobble#2}{#1}% + \fi + \fi +} +\def\@@leadzero#1\@nil#2\fi\fi{% + \fi + \ifx\\#1\\% + \else + 0% + \expandafter\@@leadzero\@gobble#1\@nil + \iftrue\fi + \fi +} +\def\@@@leadzero#1#2\fi\fi{% + \fi + \fi + \expandafter\@leadzero\expandafter{\@gobble#2}{#1}% +} +% +\renewcommand*{\thelabelcount}{% + \leadzero{\dc@option@labelbaselength}{\value{labelcount}}% +}% +% +% create new toc type with same definition as section +\let\l@dcdvd\l@section +% +% define a bookmark level (section) for dcdvd toc-entry +\newcommand*\toclevel@dcdvd{1}% +\newcommand*\toclevel@lfrsec{1}% +% +\hypersetup{pdfkeywords={LaTeX,dvdcoll.cls,DVD,Archiv,archives}}% +\AtEndOfClass{\AtBeginDocument{\hypersetup{pdfcreator={LaTeX with dvdcoll.cls},pdftitle={\dc@pdftitle}}}}% +% % %--- Commands --- % @@ -313,7 +429,20 @@ {% \setcounter{season}{#2}% \ifthenelse{#1 = 1}% - {\setcounter{seasondvd}{0}}% just reset if #1 equal 1 + {% + \setcounter{seasondvd}{0}% just reset if #1 = 1 + }% + {}% if dvdnumbering=season + \ifthenelse{\equal{\dc@option@dvdnumbering}{season}}% + {% and bookmark is to be set for the first time + \ifthenelse{\thebookmarkseason = #2}% + {}% + {% create season bookmark + \pdfbookmark[1]{\dc@season{} \theseason}{seasonbookmark*.\thebookmarkcount.\theseason}% + % store season in bookmarkseason to prevent several bookmarks of the same season + \setcounter{bookmarkseason}{#2}% + }% + }% {}% \setcounter{seasontitlecount}{#1}% \addtocounter{seasontitlecount}{-1}% @@ -328,13 +457,32 @@ }% % % -\newcommand*\DvdSeries[2][titlenumbering=normal,dvdnumbering=normal]% +\newcommand*\DvdSeries[2][titlenumbering=normal,dvdnumbering=normal,labelbase=-1,labelbaseprefix={},labelbasesuffix={},labelbaselength=4]% {%default - default setting of xkeyval seem not to work??? all or nothing??? \renewcommand*\dc@option@dvdnumbering{normal}% \renewcommand*\dc@option@titlenumbering{normal}% + \renewcommand*\dc@option@labelbase{-1}% + \renewcommand*\dc@option@labelbaseprefix{}% + \renewcommand*\dc@option@labelbasesuffix{}% + \renewcommand*\dc@option@labelbaselength{4}% % \setkeys{DvdSeries}{#1}% - \SetSeason{1}% + %reset season bookmark indicator + \setcounter{bookmarkseason}{-1}% + % create unique hyperref destination for season bookmark + \stepcounter{bookmarkcount}% + \ifthenelse{\equal{\dc@option@dvdnumbering}{season}}% + {%adjust toclevel for season bookmark + \renewcommand*\toclevel@dcdvd{2}% + }% + {% + \renewcommand*\toclevel@dcdvd{1}% + }% + %\SetSeason{1}% + %would produce double season bookmark entries, therefore + \setcounter{season}{1}% + \setcounter{seasondvd}{0}% + \setcounter{seasontitlecount}{0}% \chapter{#2}% \def\dc@series{#2}% \setcounter{season}{-1}% @@ -342,9 +490,8 @@ {% \setcounter{dvdcount}{0}% }% - % durch heading=nonumber (secnumdepth=-2) funktioniert das automatische - % Zurücksetzen von dvdcount nicht mehr, da chapter offensichtlich nicht - % mehr zurückgesetzt wird! + % setting heading=nonumber (secnumdepth=-2) means no automatic reset + % of dvdcount because chapter get not reset {}% }% % @@ -355,10 +502,11 @@ \ifthenelse{\equal{\dc@option@titlenumbering}{season}}% {\refstepcounter{seasontitlecount}}% {\refstepcounter{titlecount}}% + %if marker F is set \ifthenelse{\equal{\dc@miss}{#2}}% {% - %Eintrag in lfr unbedingt vor Tabelleneintrag, ansonsten Fehler in der Tabelle - don't no why! - %Eintrag in lfr bei heading=nonumber OHNE Nummern + %lfr entry absolutly before tabular line, otherwise error in the table - don't no why! + %lfr entry without numbers if heading=nonumber \ifthenelse{\equal{\valueheading}{nonumber}}% {% \addcontentsline{lfr}{lfrsec}{\protect\numberline{} \dc@series\ - #1}% @@ -371,14 +519,15 @@ {%normal \addcontentsline{lfr}{lfrsec}{\protect\numberline{\thepart.\thechapter.\thedvdcount.\thetitlecount} \dc@series\ - #1}% }% - }% + }% + %construct table \dc@print@counter & #1\strut & \hfill\dc@miss \tabularnewline% }% {% \ifthenelse{\equal{}{#2}}% - % keine Minutenangabe + % no min {\dc@print@counter & #1\strut & \tabularnewline}% - % mit Minutenangabe + % with min {\dc@print@counter & #1\strut & \hfill{}#2~\dc@third \tabularnewline}% }% }% @@ -390,10 +539,11 @@ \ifthenelse{\equal{\dc@option@titlenumbering}{season}}% {\refstepcounter{seasontitlecount}}% {\refstepcounter{titlecount}}% + % if marker F is set \ifthenelse{\equal{\dc@miss}{#2}}% {% - %Eintrag in lfr unbedingt vor Tabelleneintrag, ansonsten Fehler in der Tabelle - don't no why! - %Eintrag in lfr bei heading=nonumber OHNE Nummern + %lfr entry absolutly before tabular line, otherwise error in the table - don't no why! + %lfr entry without numbers if heading=nonumber \ifthenelse{\equal{\valueheading}{nonumber}}% {% \addcontentsline{lfr}{lfrsec}{\protect\numberline{} \dc@series\ - #1}% @@ -411,14 +561,39 @@ }% {% \ifthenelse{\equal{}{#2}}% - % keine Minutenangabe + % no min {\dc@print@counter & \makebox[0pt]{}\pdfnote{#1\strut} & \tabularnewline}% - % mit Minutenangabe + % with min {\dc@print@counter & \makebox[0pt]{}\pdfnote{#1\strut} & \hfill{}#2~\dc@third \tabularnewline}% }% }% % % +\setlength\columnseprule{0.5pt} +\addtolength\columnsep{5pt} +%no automatic heading -> clash with multicols +\renewcommand*\bib@heading{\@mkboth{\refname}{\refname}} +%labels without brackets +\renewcommand\@biblabel[1]{#1} +\newcommand*\dc@bibpreamble{\begin{multicols}{\dc@bib@col}\RaggedRight\small} +\newcommand*\dc@bibend{\end{multicols}}% +\newcommand{\listofdvds}[2][]% +{% + \ifthenelse{\equal{}{#2}}{\def\dc@bib@col{2}}{\def\dc@bib@col{#2}}% + \bibliographystyle{dcbib}% + \nocite{*}% + \ifthenelse{\equal{}{#1}}% + {\renewcommand\refname{\dc@dvdlist}}% + {\renewcommand\refname{#1}}% + \clearpage% + \chapter*{\refname}% + \addcontentsline{toc}{part}{\dc@dvdlist{}}% + \phantomsection% + \dc@bibpreamble% + \bibliography{dc_\jobname}% + \dc@bibend% +}% +% \newcommand{\listoffaultyrecordings}% {% \setboolean{@restonecol}{false}% @@ -435,6 +610,7 @@ \ifthenelse{\boolean{@restonecol}}% {\twocolumn}% {}% + \addcontentsline{toc}{part}{\dc@lfrname{}}% }% % % @@ -449,7 +625,7 @@ % \newcommand\SetTOCSecIndent[1]% {% - \renewcommand*\l@section{\@dottedtocline{1}{#1}{0pt}}% + \renewcommand*\l@dcdvd{\@dottedtocline{1}{#1}{0pt}}% }% % % @@ -514,14 +690,38 @@ }% \refstepcounter{dvdcount}% \refstepcounter für hyperref-Link auf die jeweilige DVD \refstepcounter{seasondvd}% + \stepcounter{labelcount}% \dc@calc@dvdcounter% to have correct counter in "text" form \ifthenelse{\equal{}{#1}}{\def\dc@title{\dc@series\DvdCounter}}{\def\dc@title{#1}}% - \addcontentsline{toc}{section}{\dc@title}% + {%local redefinition for BibTeX export + \renewcommand*\DvdSpace{\DvdBibSpace}% + \ifthenelse{\equal{}{#1}}{\xdef\dc@bib@title{\dc@series\DvdCounter}}{\xdef\dc@bib@title{#1}}% + } + %create label + \ifthenelse{\equal{}{#2}}% + {%#2 empty + \ifthenelse{\equal{\dc@option@labelbase}{-1}}% + {%default + \def\dc@dvd@label{}% + }% + {%labelbase set + \def\dc@dvd@label{\dc@option@labelbaseprefix\thelabelcount\dc@option@labelbasesuffix}% + }% + }% + {%#2 not empty + \def\dc@dvd@label{#2}% + }% + \addcontentsline{toc}{dcdvd}{\dc@title}% \phantomsection% korrigiert fehlerhafte (falsch positionierte) Links auf dvd-Tabellen + \ifthenelse{\equal{}{\dc@dvd@label}}% + {}% + {% + \bibwrite{@misc{\dc@dvd@label ,author={{\dc@bib@title}},year={\dc@dvd@label}}}% + }% \noindent% % verhindert overfull \hbox Errors wegen \tabularx{\linewidth}... - \tabularx{\linewidth}{>{\dc@size@table@cells}l>{\dc@size@table@cells}X>{\dc@size@table@cells}r}% - \multicolumn{3}{l}{\dc@size@table@title\dc@title\dc@option@dvdlabel\dc@print@dvdlabel{#2}}\\% + \tabularx{\linewidth}{>{\dc@size@table@cells}r>{\dc@size@table@cells}X>{\dc@size@table@cells}r}% + \multicolumn{3}{l}{\dc@size@table@title\dc@title\dc@option@dvdlabel\dc@print@dvdlabel{\dc@dvd@label}}\\% \midrule% }% {% |