diff options
author | Karl Berry <karl@freefriends.org> | 2013-03-17 21:52:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-03-17 21:52:06 +0000 |
commit | e6826e3bb3139f2329f722784dfa24c5cbb824dc (patch) | |
tree | e770a052734db40bf9e6b77d167444b5ff6c4634 /Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx | |
parent | f6ebf7e69e4c372ab549c769ce5058a8f864336d (diff) |
biblatex-philosophy
git-svn-id: svn://tug.org/texlive/trunk@29411 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.cbx | 323 |
1 files changed, 232 insertions, 91 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 a2ce4572079..5a64962dae1 100644 --- a/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-classic.cbx @@ -1,11 +1,19 @@ -% $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.8b 2012/05/06 valbusa beta$] +%% +%% This is file `philosophy-classic.cbx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% biblatex-philosophy.dtx (with options: `classic-cbx') +%% ______________________________________________________ +%% The biblatex-philosophy package +%% Copyright (C) 2009-2013 Ivan Valbusa +%% All rights reserved +%% +%% License information appended +%% +\ProvidesFile{philosophy-classic.cbx} + [2013/03/15 v0.8c valbusa beta] \RequireCitationStyle{authoryear-comp} @@ -17,23 +25,17 @@ \settoggle{cbx:shorthandintro}{#1}} \ExecuteBibliographyOptions{% -scauthorscite = false, -citetracker = true, -shorthandintro = true} + scauthorscite = false, + citetracker = true, + shorthandintro = true +} -% AT EVERY CITE -%************************************************************* \AtEveryCite{% \iftoggle{cbx:scauthorscite}% - {\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}% - \renewcommand*{\mkbibnamefirst}[1]{\textsc{#1}}% - \renewcommand*{\mkbibnameprefix}[1]{\textsc{#1}}}% - {}% -} - -%****************************** -% hyperlink for names -%***************************** + {\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}% +\renewcommand*{\mkbibnamefirst}[1]{\textsc{#1}}% +\renewcommand*{\mkbibnameprefix}[1]{\textsc{#1}}}% +{}} \DeclareNameFormat{labelname}{% \bibhyperref{% \ifcase\value{uniquename}% @@ -46,33 +48,107 @@ shorthandintro = true} \usebibmacro{name:first-last}{#1}{#3}{#5}{#7}% \fi \usebibmacro{name:andothers}}} +%%%% -% ''shorthand intro'' implementation -%--------------------- +\newcommand{\switchclass}[2]{% + \iffieldequalstr{entrysubtype}{classical}% + {\usebibmacro{#1}}% + {\usebibmacro{#2}}} +\newbibmacro*{cite:init:AT}{% + \ifnumless{\value{multicitecount}}{2} + {\global\boolfalse{cbx:parens}% + \global\undef\cbx@lasthash} + {\iffieldundef{prenote} + {} + {\global\undef\cbx@lasthash}}} -\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}}} +\newbibmacro*{cite:reinit:AT}{% + \global\undef\cbx@lasthash} + +\newbibmacro*{cite:AT}{% + \iffieldundef{shorthand} + {\iffieldequals{namehash}{\cbx@lasthash} + {\setunit{\compcitedelim}} + {\ifnameundef{labelname} + {} {\printnames{labelname}% - \setunit{\nameyeardelim}% - \usebibmacro{cite:labelyear+extrayear}% - \savefield{namehash}{\cbx@lasthash}% - \savefield{labelyear}{\cbx@lastyear}}}} - -\renewbibmacro*{cite}{% + \setunit{\nametitledelim}}% + \savefield{namehash}{\cbx@lasthash}}% + \usebibmacro{cite:title:AT}} + {\usebibmacro{cite:shorthand}% + \usebibmacro{cite:reinit:AT}}% + \setunit{\multicitedelim}} + +\newbibmacro*{citetitle:AT}{% \iffieldundef{shorthand} - {\usebibmacro{cite:noshorthand}} + {\usebibmacro{cite:title:AT}} + {\usebibmacro{cite:shorthand}}% + \setunit{\multicitedelim}} + +\newbibmacro*{textcite:AT}{% + \iffieldequals{namehash}{\cbx@lasthash} + {\setunit{\compcitedelim}} + {\ifnameundef{labelname} + {} + {\printnames{labelname}% + \setunit{% + \global\booltrue{cbx:parens}% + \addspace\bibopenparen}}% + \savefield{namehash}{\cbx@lasthash}}% + \ifnumequal{\value{citecount}}{1} + {\usebibmacro{prenote}} + {}% + \iffieldundef{shorthand} + {\usebibmacro{cite:title:AT}}% + {\iftoggle{cbx:shorthandintro}{% + \ifciteseen{% + \usebibmacro{cite:shorthand}}% + {\usebibmacro{shorthandintro}}}% + {\usebibmacro{cite:shorthand}}}% + \setunit{% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}% + \multicitedelim}} + +\newbibmacro*{cite:title:AT}{% + \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}} + +\newbibmacro*{textcite:postnote:AT}{% + \ifnameundef{labelname} + {\setunit{% + \global\booltrue{cbx:parens}% + \addspace\bibopenparen}} + {\setunit{\postnotedelim}}% + \printfield{postnote}% + \ifthenelse{\value{multicitecount}=\value{multicitetotal}} + {\setunit{}% + \printtext{% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}}} + {\setunit{% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}% + \multicitedelim}}} +\newbibmacro*{cite:init:AY}{% + \ifnumless{\value{multicitecount}}{2} + {\global\boolfalse{cbx:parens}% + \global\undef\cbx@lasthash + \global\undef\cbx@lastyear} + {\iffieldundef{prenote} + {} + {\global\undef\cbx@lasthash +\global\undef\cbx@lastyear}}} + +\newbibmacro*{cite:reinit:AY}{% + \global\undef\cbx@lasthash + \global\undef\cbx@lastyear} + +\newbibmacro*{cite:AY}{% + \iffieldundef{shorthand}% + {\usebibmacro{cite:noshorthand}}% {\iftoggle{cbx:shorthandintro}% {% \ifciteseen{\usebibmacro{cite:shorthand}}% @@ -80,10 +156,10 @@ shorthandintro = true} \usebibmacro{shorthandintro}}% }% {\usebibmacro{cite:shorthand}}% - \usebibmacro{cite:reinit}}% + \usebibmacro{cite:reinit:AY}}% \setunit{\multicitedelim}} -\renewbibmacro*{textcite}{% +\newbibmacro*{textcite:AY}{% \iffieldequals{namehash}{\cbx@lasthash}% {\iffieldundef{shorthand}%noshorthand {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND @@ -110,33 +186,33 @@ shorthandintro = true} {\ifnameundef{labelname}% {\iffieldundef{shorthand}%shorthand {\usebibmacro{cite:label}% - \setunit{% - \global\booltrue{cbx:parens}% - \addspace\bibopenparen}% - \ifnumequal{\value{citecount}}{1}% - {\usebibmacro{prenote}}% - {\usebibmacro{cite:shorthand}}% - \usebibmacro{cite:labelyear+extrayear}}% + \setunit{% + \global\booltrue{cbx:parens}% + \addspace\bibopenparen}% + \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}}}% + \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}}% - {}% +\setunit{% + \global\booltrue{cbx:parens}% + \addspace\bibopenparen}% +\ifnumequal{\value{citecount}}{1}% + {\usebibmacro{prenote}}% + {}% \iffieldundef{shorthand}%noshorthand {\iffieldundef{labelyear}% {\usebibmacro{cite:label}}% @@ -159,12 +235,67 @@ shorthandintro = true} {}% \multicitedelim}}% +\newbibmacro*{textcite:postnote:AY}{% + \usebibmacro{postnote}% + \ifthenelse{\value{multicitecount}=\value{multicitetotal}} + {\setunit{}% + \printtext{% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}}} + {\setunit{% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}% + \multicitedelim}}} \renewbibmacro*{cite:shorthand}{% \printtext[bibhyperref]{\printfield{shorthand}}} +\renewbibmacro*{cite:init}{% + \switchclass{cite:init:AT}{cite:init:AY}} +\renewbibmacro*{cite:reinit}{% + \switchclass{cite:reinit:AT}{cite:reinit:AY}} +\renewbibmacro*{cite}{% + \switchclass{cite:AT}{cite:AY}} +\renewbibmacro*{textcite}{% + \switchclass{textcite:AT}{textcite:AY}} +\renewbibmacro*{textcite:postnote}{% + \switchclass{textcite:postnote:AT}{textcite:postnote:AY}} -%******************************************************************** -% hyperlinks for \citetitle and \citeyear commands -%******************************************************************* +\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}}}} +\DeclareCiteCommand*{\cite} + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \switchclass{citetitle:AT}{citeyear}}% + {} + {\usebibmacro{postnote}} + +\DeclareCiteCommand*{\parencite}[\mkbibparens] + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \switchclass{citetitle:AT}{citeyear}} + {} + {\usebibmacro{postnote}} \DeclareCiteCommand{\citetitle} {\boolfalse{citetracker}% @@ -182,34 +313,44 @@ shorthandintro = true} {\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}} + {\usebibmacro{postnote}} -\DeclareCiteCommand{\sdcite} +\DeclareCiteCommand{\citeyear} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} - {\indexnames{labelname}% - \printtext[bibhyperref]{\printnames{labelname}}% - \setunit{\addcomma\space}% - \indexfield{indextitle}% - \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}} + {\printtext[bibhyperref]{\printfield{year}}} {\multicitedelim} {\usebibmacro{postnote}} -\DeclareCiteCommand{\footcitet}[\mkbibfootnote] +\DeclareCiteCommand{\footcitet}[\mkbibfootnote] {\usebibmacro{cite:init}} {\usebibmacro{citeindex}% \usebibmacro{textcite}} {}% {\usebibmacro{textcite:postnote}} - - -\endinput +\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}} +%% +%% Copyright 2009-2013 by Ivan Valbusa +%% +%% This program is provided under the terms of the +%% LaTeX Project Public License distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt. +%% +%% Author: Ivan Valbusa +%% ivan dot valbusa at univr dot it +%% +%% This work has the LPPL maintenance status "author-maintained". +%% +%% +%% End of file `philosophy-classic.cbx'. |