% $Id: philosophy-modern.bbx,v 0.7c 2011/05/16 Valbusa$ % Copyright 2009-2011 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-modern.bbx}[philosophy-modern.bbx,v 0.7c 2011/05/16 valbusa beta$] \RequireBibliographyStyle{philosophy-classic} \newtoggle{bbx:yearleft} \DeclareBibliographyOption{yearleft}[true]{% \settoggle{bbx:yearleft}{#1}} \ExecuteBibliographyOptions{% yearleft=false} %% new lengths %%--------------------------------------------------------------------------------------------- \newlength{\yeartitle} \newlength{\postnamesep} \setlength{\yeartitle}{0.8em}% \setlength{\postnamesep}{0.5ex plus 2pt minus 1pt} \setlength{\bibitemsep}{\postnamesep} \setlength{\bibnamesep}{1.5ex plus 2pt minus 1pt} \setlength{\bibhang}{4\parindent} %% new commands %%--------------------------------------------------------------------------------------------- \newcommand{\postsep}{\par\nobreak\vskip\postnamesep\hskip-\bibhang\ignorespaces} \renewcommand{\labelnamepunct}{\unspace} \AtBeginBibliography{ \iftoggle{bbx:yearleft}{% \setlength{\yeartitle}{\fill}} {}% } \AtBeginShorthands{% \renewcommand{\postsep}{}% \renewcommand{\labelnamepunct}{\addcomma\space}} %%--------------------------------------------------------------------------------------------- %% MACROS %%--------------------------------------------------------------------------------------------- \renewbibmacro*{date+extrayear}{% \makebox[\bibhang][r]{% \printtext{% \iffieldundef{year}% {\bibstring{nodate}}% {\printfield{labelyear}\printfield{extrayear}}% \hskip\yeartitle}}} % label for entries without 'editor' and 'author' %%------------------------------------------------------------- \renewbibmacro*{labeltitle}{% \iffieldundef{label}% {\iffieldundef{shorttitle} {\printfield{title}% \clearfield{title}}% {\printfield[title]{shorttitle}}}% {\printtext{\printfield{label}}% \postsep}} % macro 'author' %%--------------------------------------------------- \renewbibmacro*{author}{% \ifboolexpr{ test \ifuseauthor and not test {\ifnameundef{author}} } {\usebibmacro{bbx:dashcheck} {}%MOD {\usebibmacro{bbx:savehash}% \printnames{author}% \iffieldundef{authortype} {}% {\setunit{\addcomma\space}}% \usebibmacro{authorstrg}% \setunit{\addspace} \postsep%ADD }}% {\global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}}% \usebibmacro{date+extrayear}} \renewbibmacro*{bbx:editor}[1]{% \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}} } {\usebibmacro{bbx:dashcheck} {}% removed \bibnamedash {\printnames{editor}% \postsep%ADD \usebibmacro{bbx:savehash}}% \clearname{editor}}% {\global\undef\bbx@lasthash \usebibmacro{labeltitle}}% \usebibmacro{date+extrayear}% \iffieldundef{label} {\usebibmacro{#1}\setunit{\addcomma\space}}{}% } %%--------------------------------------------------------------------------------------------- % BIBLIOGRAPHY DRIVERS %%--------------------------------------------------------------------------------------------- \newbibmacro*{crosslabeltitle}{% \iffieldundef{label}% {\iffieldundef{shorttitle} {\printfield{title}% \clearfield{title}}% {\printfield[title]{shorttitle}}}% {\printtext{\printfield{label}}}} \DeclareCiteCommand{\bbx@crossref} {}% {\ifuseeditor{\ifthenelse{\value{listtotal}=2} {\printnames[][-\value{maxnamesincross}]{labelname}} {\printnames[][-\value{minnamesincross}]{labelname}}} {\usebibmacro{crosslabeltitle}} \setunit*{\addspace}% \printtext{\usebibmacro{crossdate+extrayear}}}% {}% {}% \DeclareBibliographyDriver{periodical}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{editor}% \ifuseeditor{% trick for entry with ``label'' field \setunit{\addcomma\space}} {}\newblock %\setunit{\labelnamepunct}\newblock \usebibmacro{title+issuetitle}% \newunit \printlist{language}% \newunit\newblock \usebibmacro{byeditor}% \newunit\newblock \printfield{note}% \newunit\newblock \iftoggle{bbx:isbn} {\printfield{issn}} {}% \newunit\newblock \usebibmacro{doi+eprint+url}% \newunit\newblock \usebibmacro{addendum+pubstate}% \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \usebibmacro{finentry}} \DeclareBibliographyDriver{collection}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{editor+others}% \ifuseeditor{% trick for entry with ``label'' field \setunit{\addcomma\space}} {}\newblock \usebibmacro{maintitle+title}% \newunit \printlist{language}% \newunit\newblock \usebibmacro{byeditor+others}% \newunit\newblock \printfield{edition}% \newunit \iffieldundef{maintitle} {\printfield{volume}% \printfield{part}} {}% \newunit \printfield{volumes}% \newunit\newblock \usebibmacro{series+number}% \newunit\newblock \printfield{note}% \newunit\newblock \usebibmacro{publisher+location+date}% \newunit\newblock \usebibmacro{chapter+pages}% \newunit \printfield{pagetotal}% \newunit\newblock \iftoggle{bbx:isbn} {\printfield{isbn}} {}% \newunit\newblock \usebibmacro{doi+eprint+url}% \newunit\newblock \usebibmacro{addendum+pubstate}% \newunit\newblock \usebibmacro{pageref}% \usebibmacro{finentry}} \endinput