% $Id: philosophy-classic.cbx,v 0.7b 2010/11/20 Valbusa$ % Copyright 2009-2010 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.7b 2010/11/20 valbusa beta$] \RequireCitationStyle{authoryear-icomp} \newbool{cbx:scauthorscite} \DeclareBibliographyOption{scauthorscite}[true]{% \csuse{bool#1}{cbx:scauthorscite}} \ExecuteBibliographyOptions{% scauthorscite=false, } %*************************************************************************************************** % % AT EVERY CITE % %*************************************************************************************************** \AtEveryCite{% \ifbool{cbx:scauthorscite}% {\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}% \renewcommand*{\mkbibnamefirst}[1]{\textsc{#1}}% \renewcommand*{\mkbibnameprefix}[1]{\textsc{#1}}}% {}% } %****************************** % hyperlink for names %***************************** \DeclareNameFormat{labelname}{% \bibhyperref{% \ifcase\value{uniquename}% \usebibmacro{name:last}{#1}{#3}{#5}{#7}% \or \ifuseprefix {\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}} {\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}% \or \usebibmacro{name:first-last}{#1}{#3}{#5}{#7}% \fi \usebibmacro{name:andothers}}} \newbibmacro*{textcitet}{% \iffieldequals{namehash}{\cbx@lasthash} {\iffieldundef{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}}} {\setunit{\compcitedelim}% \usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}} {\ifnameundef{labelname} {\iffieldundef{shorthand} {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:parens}% \addspace\bibopenparen}% \usebibmacro{cite:labelyear+extrayear}} {\usebibmacro{cite:shorthand}}} {\printnames{labelname}% \setunit{% \global\booltrue{cbx:parens}% \addspace\bibopenparen}% \iffieldundef{shorthand} {\iffieldundef{labelyear} {\usebibmacro{cite:label}} {\usebibmacro{cite:labelyear+extrayear}}% \savefield{labelyear}{\cbx@lastyear}} {\usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}% \savefield{namehash}{\cbx@lasthash}}}% \setunit{% \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}% \multicitedelim}} %******************************************************************** % hypelink for \citetitle and \citeyear commands %******************************************************************* \DeclareCiteCommand{\citetitle} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\indexfield{indextitle}% \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand*{\citetitle} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\indexfield{indextitle}% \printtext[bibhyperref]{\printfield[citetitle]{title}}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand{\citeyear} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\printtext[bibhyperref]{\printfield{year}}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand{\sdcite} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\indexnames{labelname}% \printtext[bibhyperref]{\printnames{labelname}}% \setunit{\addcomma\space}% \indexfield{indextitle}% \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{% \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}% \multicitedelim}}} \endinput