summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dk-bib
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:54:16 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:54:16 +0000
commit0c39edc237703bb4d0eaa1b52b4b0f5f7ab081a0 (patch)
treecd060735581235311f32fe2d6c80373a05070fda /Master/texmf-dist/tex/latex/dk-bib
parent5b833d056e2e4ed1e49fb09b7df7dfc54c0abf22 (diff)
dk-bib
git-svn-id: svn://tug.org/texlive/trunk@829 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/dk-bib')
-rw-r--r--Master/texmf-dist/tex/latex/dk-bib/dk-bib.sty203
1 files changed, 203 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/dk-bib/dk-bib.sty b/Master/texmf-dist/tex/latex/dk-bib/dk-bib.sty
new file mode 100644
index 00000000000..edc6583abfa
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/dk-bib/dk-bib.sty
@@ -0,0 +1,203 @@
+% Copyright 2004, 2005 Arne Jorgensen
+
+% This file is free software; you can redistribute it and/or modify it
+% under the terms of the GNU General Public License as published by
+% the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+
+% This file is distributed in the hope that it will be useful, but
+% WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+
+% You should have received a copy of the GNU General Public License
+% along with GNU Emacs; see the file COPYING. If not, write to the
+% Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+% Boston, MA 02110-1301, USA.
+
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+
+% subversion date and revision
+\def\dkbib@svn $#1 #2 #3 #4-#5-#6 #7 #8 ${%
+ \def\dkbib@sty@revision{#3}
+ \def\dkbib@sty@date{#4/#5/#6}
+}
+\dkbib@svn $Id: dk-bib.sty 82 2005-10-02 16:26:11Z arne $
+\def\dkbib@version{0.5}
+
+\ProvidesPackage{dk-bib}[\dkbib@sty@date\space v\dkbib@version\space(r\dkbib@sty@revision) Danish variants of the standard BibTeX styles]
+
+\RequirePackage{xkeyval}
+
+\newif\ifdkbib@url
+\dkbib@urlfalse
+\DeclareOptionX{url}[true]{%
+ \csname dkbib@url#1\endcsname}
+
+\newif\ifdkbib@isbn
+\dkbib@isbnfalse
+\DeclareOptionX{isbn}[true]{%
+ \csname dkbib@isbn#1\endcsname}
+
+\newif\ifdkbib@issn
+\dkbib@issnfalse
+\DeclareOptionX{issn}[true]{%
+ \csname dkbib@issn#1\endcsname}
+
+\newif\ifdkbib@annote
+\dkbib@annotefalse
+\DeclareOptionX{annote}[true]{%
+ \csname dkbib@annote#1\endcsname}
+
+\newif\ifdkbib@printing
+\dkbib@printingfalse
+\DeclareOptionX{printing}[true]{%
+ \csname dkbib@printing#1\endcsname}
+
+\newif\ifdkbib@apalike
+\dkbib@apalikefalse
+\DeclareOptionX{apalike}[true]{%
+ \csname dkbib@apalike#1\endcsname}
+
+\newif\ifdkbib@fixcitedash
+\dkbib@fixcitedashtrue
+\DeclareOptionX{fixcitedash}[true]{%
+ \csname dkbib@fixcitedash#1\endcsname}
+
+\newcount\dkbib@maxordinaldepth
+\dkbib@maxordinaldepth0
+\newcommand*\dkbib@DeclareOrdinalWord[2]{
+ \ifnum#1>\dkbib@maxordinaldepth
+ \dkbib@maxordinaldepth#1
+ \fi
+ \@namedef{dkbib@word#1}{#2}%
+}
+\dkbib@DeclareOrdinalWord{1}{f\o rste}
+\dkbib@DeclareOrdinalWord{2}{anden}
+\dkbib@DeclareOrdinalWord{3}{tredje}
+\dkbib@DeclareOrdinalWord{4}{fjerde}
+\dkbib@DeclareOrdinalWord{5}{femte}
+\dkbib@DeclareOrdinalWord{6}{sjette}
+\dkbib@DeclareOrdinalWord{7}{syvende}
+\dkbib@DeclareOrdinalWord{8}{ottende}
+\dkbib@DeclareOrdinalWord{9}{niende}
+\dkbib@DeclareOrdinalWord{10}{tiende}
+\dkbib@DeclareOrdinalWord{11}{elvte}
+\dkbib@DeclareOrdinalWord{12}{tolvte}
+\dkbib@DeclareOrdinalWord{13}{trettende}
+\dkbib@DeclareOrdinalWord{14}{fjortende}
+\dkbib@DeclareOrdinalWord{15}{femtende}
+\dkbib@DeclareOrdinalWord{16}{sekstende}
+\dkbib@DeclareOrdinalWord{17}{syttende}
+\dkbib@DeclareOrdinalWord{18}{attende}
+\dkbib@DeclareOrdinalWord{19}{nittende}
+\dkbib@DeclareOrdinalWord{20}{tyvende}
+
+\newcount\dkbib@ordinaldepth
+\dkbib@ordinaldepth\dkbib@maxordinaldepth
+\DeclareOptionX{ordinaldepth}{%
+ \dkbib@ordinaldepth#1}
+
+\ifnum\dkbib@ordinaldepth>\dkbib@maxordinaldepth
+ \PackageWarningNoLine{dk-bib}{Ordinal depth set to
+ \the\dkbib@ordinaldepth, but maximum is \the\dkbib@maxordinaldepth}
+\fi
+
+\newif\ifdkbib@ordinalstoword
+\dkbib@ordinalstowordfalse
+\DeclareOptionX{ordinals2word}[true]{%
+ \csname dkbib@ordinalstoword#1\endcsname}
+
+\ProcessOptionsX
+
+% Work around a wrong implementation of \MakeUppercase (according to
+% Morten H\o gholm who also provided this implementation)
+\DeclareRobustCommand\dkbib@MakeUppercase[1]{%
+ \begingroup
+ \def\i{I}\def\j{J}%
+ \def\dkbib@reserved@a##1##2{\let##1##2\dkbib@reserved@a}%
+ \expandafter\dkbib@reserved@a\@uclclist\dkbib@reserved@b{\dkbib@reserved@b\@gobble}%
+ \protected@edef\dkbib@reserved@a{\endgroup\uppercase{#1}}%
+ \dkbib@reserved@a
+}
+\protected@edef\dkbib@MakeUppercase#1{\dkbib@MakeUppercase{#1}}
+
+\AtBeginDocument{%
+ %%% fixcitedash
+ \@ifpackageloaded{cite}%
+ {\ifdkbib@fixcitedash%
+ \providecommand{\dkbibdash}{\hbox{-}\penalty\@m}%
+ \renewcommand{\citedash}{\dkbibdash}%
+ \fi}%
+ {\relax}%
+ %%% apalike
+ \ifdkbib@apalike%
+ \RequirePackage{apalike}%
+ \fi%
+ %%% url
+ \ifdkbib@url%
+ \RequirePackage{url}%
+ \providecommand{\dkbiburl}[1]{URL \url{#1}}%
+ \else%
+ \def\dkbiburl#1{\unskip\@gobble}%
+ \fi%
+ %%% isbn
+ \ifdkbib@isbn%
+ \providecommand{\dkbibisbn}[1]{ISBN #1}%
+ \else%
+ \def\dkbibisbn#1{\unskip\@gobble}%
+ \fi%
+ %%% issn
+ \ifdkbib@issn%
+ \providecommand{\dkbibissn}[1]{ISSN #1}%
+ \else%
+ \def\dkbibissn#1{\unskip\@gobble}%
+ \fi%
+ %%% annote
+ \ifdkbib@annote%
+ \providecommand{\dkbibannote}[2]{%
+ \begin{quotation}\noindent
+ \dkbib@MakeUppercase #2
+ \end{quotation}
+ }%
+ \else%
+ \def\dkbibannote#1#2{\unskip}%
+ \fi%
+ %%% edition/printing
+ \DeclareRobustCommand{\dkbibedition}[2]{%
+ \ifx\@empty#1\@empty\else%
+ \ifdkbib@ordinalstoword%
+ \@ifundefined{dkbib@word#1}%
+ {#1\dkbib@addperiod~udgave}%
+ {\ifnum#1>\dkbib@ordinaldepth
+ #1\dkbib@addperiod~udgave%
+ \else
+ \@nameuse{dkbib@word#1}~udgave%
+ \fi}%
+ \else
+ #1\dkbib@addperiod~udgave%
+ \fi
+ \ifdkbib@printing
+ \ifx\@empty#2\@empty\else, \fi
+ \fi
+ \fi
+ \ifdkbib@printing
+ \ifx\@empty#2\@empty\else
+ \ifdkbib@ordinalstoword%
+ \@ifundefined{dkbib@word#2}%
+ {#2\dkbib@addperiod~oplag}%
+ {\ifnum#2>\dkbib@ordinaldepth
+ #2\dkbib@addperiod~oplag%
+ \else
+ \@nameuse{dkbib@word#2}~oplag%
+ \fi}%
+ \else
+ #2\dkbib@addperiod~oplag%
+ \fi
+ \fi
+ \fi
+ }
+ \DeclareRobustCommand\dkbibEdition[2]{%
+ \protected@edef\reserved@a{\csname dkbibedition \endcsname{#1}{#2}}%
+ \expandafter\dkbib@MakeUppercase\reserved@a}
+}