% $Id: philosophy-classic.bbx,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.bbx}[philosophy-classic.bbx,v 0.7b 2010/11/20 valbusa beta$] \RequireBibliographyStyle{authoryear} \RequireBibliographyStyle{philosophy-standard} % DECLARE AND EXECUTE BIBLIOGRAPHY OPTIONS %********************************************************************* \newbool{bbx:square} \DeclareBibliographyOption{square}[true]{% \csuse{bool#1}{bbx:square}} \ExecuteBibliographyOptions{% uniquename=false, pagetracker, singletitle=false, square=false} %$$$$$$ \newcounter{maxnamesincross} \newcounter{minnamesincross} % AT BEGIN SHORTHANDS %***************************************** \AtBeginShorthands{% \boolfalse{bbx:annotation} \renewcommand{\labelnamepunct}{\addcomma\space} \renewbibmacro*{publocyear}{% \iflistundef{publisher}{} {\printlist{publisher}} \setunit*{\addcomma\space}% \printlist{location}% \setunit*{\space}% \printtext{\printfield{labelyear}}% \newunit} \renewbibmacro*{loccolonpub}{% \printlist{location}% \iflistundef{publisher} {\setunit*{\addspace}} {\setunit*{\addcolon\space}}% \printlist{publisher}% \setunit*{\addcomma\space}% \printtext{\printfield{labelyear}}% \newunit} \renewbibmacro*{locpubyear}{% \printlist{location}% \iflistundef{publisher} {\setunit*{\addspace}} {\setunit*{\addcomma\space}}% \printlist{publisher}% \setunit*{\addcomma\space}% \printtext{\printfield{labelyear}}% \newunit} \renewbibmacro*{date+extrayear}{}} % AT BEGIN DOCUMENT %************************************************** \AtBeginDocument{% \setcounter{maxnamesincross}{\value{maxnames}} \setcounter{minnamesincross}{\value{minnames}} \ifbool{bbx:square} {\renewcommand{\bibopenparen}{\bibopenbracket}% \renewcommand{\bibcloseparen}{\bibclosebracket}} {}} %********************************************************************* % NUOVE MACRO %********************************************************************* % per eliminare il mese nelle etichette delle voci article \renewbibmacro*{date+extrayear}{% \iffieldundef{year} {}% {\printtext[parens]{\printfield{labelyear}\printfield{extrayear}}}} \renewbibmacro*{issue+date}{% \ifdefstring{\bbx@volnumformat}{volnumparens} {\ifthenelse{\iffieldundef{issue}\AND\iffieldundef{month}}{}{\printtext{% \iffieldundef{issue} {\printfield{month}}% {\printfield{issue}}}}}% {\ifthenelse{\iffieldundef{issue}\AND\iffieldundef{month}}{}{\printtext[parens]{% \iffieldundef{issue} {\printfield{month}}% {\printfield{issue}}}}}% \newunit} % changed \renewbibmacro*{bbx:editor}[1]{% \ifthenelse{\ifuseeditor\AND\NOT\ifnameundef{editor}} {\ifthenelse{\iffieldequals{fullhash}{\bbx@lasthash}\AND \NOT\iffirstonpage\AND \(\NOT\boolean{bbx@inset}\OR \iffieldequalstr{entrysetcount}{1}\)} {\bibnamedash} {\printnames{editor}% \setunit{\addspace}% \usebibmacro{bbx:savehash}}% \usebibmacro{#1}% \clearname{editor}% \setunit{\addspace}}% {\global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}}% \usebibmacro{date+extrayear}} % Macro per la forma ``Publisher, Location Year''. %**************************************************************** \newbibmacro*{publocyear}{% \iflistundef{publisher}% {} {\printlist{publisher}} \setunit*{\addcomma\space}% \printlist{location}% \newunit} \newbibmacro*{inpublocyear}{% \iflistundef{institution}% {} {\printlist{institution}} \setunit*{\addcomma\space}% \printlist{location}% \newunit} \newbibmacro*{orgpublocyear}{% \iflistundef{organization}% {} {\printlist{organization}} \setunit*{\addcomma\space}% \printlist{location}% \newunit} % Macro per la forma ``Location: Publisher, Year'' %**************************************************************** \newbibmacro*{loccolonpub}{% \printlist{location}% \iflistundef{publisher}% {\setunit*{\addspace}} {\setunit*{\addcolon\space}}% \printlist{publisher}% \newunit} \newbibmacro*{inloccolonpub}{% \printlist{location}% \iflistundef{institution}% {\setunit*{\addspace}} {\setunit*{\addcolon\space}}% \printlist{institution}% \newunit} \newbibmacro*{orgloccolonpub}{% \printlist{location}% \iflistundef{organization}% {\setunit*{\addspace}} {\setunit*{\addcolon\space}}% \printlist{organization}% \newunit} % Macro per la forma ``Location, Publisher, Year'' %************************************************************** \newbibmacro*{locpubyear}{% \printlist{location}% \iflistundef{publisher}% {\setunit*{\addspace}} {\setunit*{\addcomma\space}}% \printlist{publisher}% \newunit} \newbibmacro*{inlocpubyear}{% \printlist{location}% \iflistundef{institution}% {\setunit*{\addspace}} {\setunit*{\addcomma\space}}% \printlist{institution}% \newunit} \newbibmacro*{orglocpubyear}{% \printlist{location}% \iflistundef{organization}% {\setunit*{\addspace}} {\setunit*{\addcomma\space}}% \printlist{organization}% \newunit} %********************************************************************* %% BIBLIOGRAPHY DRIVERS %********************************************************************* \newbibmacro*{crossdate+extrayear}{% \iffieldundef{year}% {}% {\printtext[parens]{\printdateextra}}} \DeclareCiteCommand{\bbx@crossref} {}% {\ifuseeditor{%\ifthenelse{\value{listtotal}=2} %{\printnames[][-\value{maxnamesincross}]{labelname}} %{\printnames[][-\value{minnamesincross}]{labelname}} \printnames{labelname}} {\usebibmacro{labeltitle}} \setunit*{\addspace}% \printtext{\usebibmacro{crossdate+extrayear}}}% {}% {}% \DeclareBibliographyDriver{incollection}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{author/translator+others}% \setunit{\labelnamepunct}\newblock \usebibmacro{title}% \newunit \printlist{language}% \newunit\newblock \usebibmacro{byauthor}% \newunit\newblock \usebibmacro{in:}% \iffieldundef{crossref}% {\usebibmacro{incollection:full}}% {\printtext{\setunit{\unspace}}% Thanks to Sander Gliboff \bbx@crossref{\thefield{crossref}}% \newunit\newblock \printfield{userd}% \newunit\newblock \usebibmacro{chapter+pages}% \newunit\newblock \iftoggle{bbx:isbn} {\printfield{isbn}} {}% \newunit\newblock \usebibmacro{doi+eprint+url}% \newunit\newblock \usebibmacro{incolladdendum+pubstate}% \newunit\newblock \usebibmacro{pageref}% \usebibmacro{finentry}}} \DeclareBibliographyDriver{inbook}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{author/translator+others}% \setunit{\labelnamepunct}\newblock \usebibmacro{title}% \newunit \printlist{language}% \newunit\newblock \usebibmacro{byauthor}% \newunit\newblock \usebibmacro{in:}% \iffieldundef{crossref}% {\usebibmacro{inbook:full}}% {%\printtext{\setunit{\unspace}}% Thanks to Sander Gliboff \bbx@crossref{\thefield{crossref}}% \newunit\newblock \printfield{userd}% \newunit\newblock \usebibmacro{chapter+pages}% \newunit\newblock \iftoggle{bbx:isbn} {\printfield{isbn}} {}% \newunit\newblock \usebibmacro{doi+eprint+url}% \newunit\newblock \usebibmacro{inbookaddendum+pubstate}% \newunit\newblock \usebibmacro{pageref}% \usebibmacro{finentry}}} \endinput