summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-05 22:02:18 +0000
committerKarl Berry <karl@freefriends.org>2012-05-05 22:02:18 +0000
commit657c5892770a6a90aa8626c27e61a87586e5565c (patch)
tree03670a95290f09f179812afe300da8a993fa8104 /Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx
parent4c56a7f771b8c9fabb57b8def881a6c6785e5699 (diff)
biblatex-philosophy (5may12)
git-svn-id: svn://tug.org/texlive/trunk@26219 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx163
1 files changed, 115 insertions, 48 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx b/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx
index dc495a44c8b..a2ce4572079 100644
--- a/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx
@@ -1,21 +1,25 @@
-% $Id: philosophy-classic.cbx,v 0.7c 2011/05/16 Valbusa$
-% Copyright 2009-2011 Ivan Valbusa. This package is author-maintained.
+% $Id: philosophy-classic.cbx,v 0.8b 2012/05/06 Valbusa$
+% Copyright 2009-2012 Ivan Valbusa. This package is author-maintained.
% Permission is granted to copy, distribute and/or modify this software under the
% terms of the LaTeX Project Public License, version 1.3c
% http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt.
-\ProvidesFile{philosophy-classic.cbx}[philosophy-classic.cbx,v 0.7c 2011/05/16 valbusa beta$]
+\ProvidesFile{philosophy-classic.cbx}[philosophy-classic.cbx,v 0.8b 2012/05/06 valbusa beta$]
\RequireCitationStyle{authoryear-comp}
\newtoggle{cbx:scauthorscite}
+\newtoggle{cbx:shorthandintro}
\DeclareBibliographyOption{scauthorscite}[true]{%
\settoggle{cbx:scauthorscite}{#1}}
+\DeclareBibliographyOption{shorthandintro}[true]{%
+ \settoggle{cbx:shorthandintro}{#1}}
\ExecuteBibliographyOptions{%
-scauthorscite=false,
-}
+scauthorscite = false,
+citetracker = true,
+shorthandintro = true}
% AT EVERY CITE
%*************************************************************
@@ -26,6 +30,7 @@ scauthorscite=false,
\renewcommand*{\mkbibnameprefix}[1]{\textsc{#1}}}%
{}%
}
+
%******************************
% hyperlink for names
%*****************************
@@ -41,55 +46,126 @@ scauthorscite=false,
\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
\fi
\usebibmacro{name:andothers}}}
-
-\newbibmacro*{textcitet}{%
- \iffieldequals{namehash}{\cbx@lasthash}
- {\iffieldundef{shorthandt}
+
+% ''shorthand intro'' implementation
+%---------------------
+
+\newbibmacro*{cite:noshorthand}{%
+\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
+ {\usebibmacro{cite:label}%
+ \setunit{\addspace}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \usebibmacro{cite:reinit}}
+ {\iffieldequals{namehash}{\cbx@lasthash}
+ {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
+ \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
+ {\setunit{\addcomma}%
+ \usebibmacro{cite:extrayear}}
+ {\setunit{\compcitedelim}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \savefield{labelyear}{\cbx@lastyear}}}
+ {\printnames{labelname}%
+ \setunit{\nameyeardelim}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \savefield{namehash}{\cbx@lasthash}%
+ \savefield{labelyear}{\cbx@lastyear}}}}
+
+\renewbibmacro*{cite}{%
+ \iffieldundef{shorthand}
+ {\usebibmacro{cite:noshorthand}}
+ {\iftoggle{cbx:shorthandintro}%
+ {%
+ \ifciteseen{\usebibmacro{cite:shorthand}}%
+ {\usebibmacro{cite:noshorthand}%
+ \usebibmacro{shorthandintro}}%
+ }%
+ {\usebibmacro{cite:shorthand}}%
+ \usebibmacro{cite:reinit}}%
+ \setunit{\multicitedelim}}
+
+\renewbibmacro*{textcite}{%
+ \iffieldequals{namehash}{\cbx@lasthash}%
+ {\iffieldundef{shorthand}%noshorthand
{\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
- \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
+ \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}%
{\setunit{\addcomma}%
- \usebibmacro{cite:extrayear}}
+ \usebibmacro{cite:extrayear}}%
{\setunit{\compcitedelim}%
\usebibmacro{cite:labelyear+extrayear}%
- \savefield{labelyear}{\cbx@lastyear}}}
- {\setunit{\compcitedelim}%
- \usebibmacro{cite:shorthand}%
- \global\undef\cbx@lastyear}}
- {\ifnameundef{labelname}
- {\iffieldundef{shorthand}
+ \savefield{labelyear}{\cbx@lastyear}}}%
+ {\setunit{\compcitedelim}%shorthand
+ \iftoggle{cbx:shorthandintro}%
+ {\ifciteseen
+ {\usebibmacro{cite:shorthand}}%
+ {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
+ \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}%
+ {\setunit{\addcomma}%
+ \usebibmacro{cite:extrayear}}%
+ {\setunit{\compcitedelim}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \savefield{labelyear}{\cbx@lastyear}}%
+ \usebibmacro{shorthandintro}}}%
+ {\usebibmacro{cite:shorthand}}%
+ \global\undef\cbx@lastyear}}%
+ {\ifnameundef{labelname}%
+ {\iffieldundef{shorthand}%shorthand
{\usebibmacro{cite:label}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}%
- \ifnumequal{\value{citecount}}{1}
- {\usebibmacro{prenote}}
- {}%
- \usebibmacro{cite:labelyear+extrayear}}
- {\usebibmacro{cite:shorthand}}}
+ \ifnumequal{\value{citecount}}{1}%
+ {\usebibmacro{prenote}}%
+ {\usebibmacro{cite:shorthand}}%
+ \usebibmacro{cite:labelyear+extrayear}}%
+ {\iftoggle{cbx:shorthandintro}%
+ {\ifciteseen%shorthand
+ {\usebibmacro{cite:shorthand}}%
+ {\usebibmacro{cite:label}%
+ \setunit{%
+ \global\booltrue{cbx:parens}%
+ \addspace\bibopenparen}%
+ \ifnumequal{\value{citecount}}{1}%
+ {\usebibmacro{prenote}}%
+ {\usebibmacro{cite:shorthand}}%
+ \usebibmacro{cite:labelyear+extrayear}%
+ \usebibmacro{shorthandintro}}}}%
+ {\usebibmacro{cite:shorthand}}}%
{\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}%
- \ifnumequal{\value{citecount}}{1}
- {\usebibmacro{prenote}}
+ \ifnumequal{\value{citecount}}{1}%
+ {\usebibmacro{prenote}}%
{}%
- \iffieldundef{shorthand}
- {\iffieldundef{labelyear}
- {\usebibmacro{cite:label}}
+ \iffieldundef{shorthand}%noshorthand
+ {\iffieldundef{labelyear}%
+ {\usebibmacro{cite:label}}%
{\usebibmacro{cite:labelyear+extrayear}}%
- \savefield{labelyear}{\cbx@lastyear}}
- {\usebibmacro{cite:shorthand}%
+ \savefield{labelyear}{\cbx@lastyear}}%
+ {\iftoggle{cbx:shorthandintro}%
+ {\ifciteseen%
+ {\usebibmacro{cite:shorthand}}%
+ {\iffieldundef{labelyear}%
+ {\usebibmacro{cite:label}}%
+ {\usebibmacro{cite:labelyear+extrayear}}%
+ \savefield{labelyear}{\cbx@lastyear}%
+ \usebibmacro{shorthandintro}}%
\global\undef\cbx@lastyear}%
+ {\usebibmacro{cite:shorthand}}}%
\savefield{namehash}{\cbx@lasthash}}}%
\setunit{%
- \iftoggle{cbx:parens}
- {\bibcloseparen\global\boolfalse{cbx:parens}}
+ \ifbool{cbx:parens}%
+ {\bibcloseparen\global\boolfalse{cbx:parens}}%
{}%
- \multicitedelim}}
+ \multicitedelim}}%
+
+\renewbibmacro*{cite:shorthand}{%
+ \printtext[bibhyperref]{\printfield{shorthand}}}
%********************************************************************
-% hypelink for \citetitle and \citeyear commands
+% hyperlinks for \citetitle and \citeyear commands
%*******************************************************************
+
\DeclareCiteCommand{\citetitle}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
@@ -127,22 +203,13 @@ scauthorscite=false,
\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
{\multicitedelim}
{\usebibmacro{postnote}}
-
+
\DeclareCiteCommand{\footcitet}[\mkbibfootnote]
- {\usebibmacro{cite:init}%
- \usebibmacro{prenote}}
- {\usebibmacro{citeindex}%
- \usebibmacro{textcitet}}
- {}
- {\bibcloseparen\setunit{\postnotedelim}%
- \printfield{postnote}%
- \ifthenelse{\value{multicitecount}=\value{multicitetotal}}
- {\setunit{}}
- {\setunit{%
- \iftoggle{cbx:parens}
- {\bibcloseparen\global\boolfalse{cbx:parens}}
- {}%
- \multicitedelim}}}
+ {\usebibmacro{cite:init}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{textcite}}
+ {}%
+ {\usebibmacro{textcite:postnote}}
\endinput