% $Id: philosophy-classic.bbx,v 0.7 2010/03/30 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.7 2010/03/30 valbusa beta$] \RequireBibliographyStyle{authoryear} \RequireBibliographyStyle{philosophy-standard} \DeclareLanguageMapping{italian}{italian-philosophy} \DeclareLanguageMapping{english}{english-philosophy} %*********************************************************************************************************** % % 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{\bibleftparen}{\bibleftbracket}% \renewcommand{\bibrightparen}{\bibrightbracket}} {}} %********************************************************************* % 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} {\printtext{% \iffieldundef{issue} {\printfield{month}}% {\printfield{issue}}}}% {\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} {\bibnamedash} {\printnames{editor}% \setunit{\addspace}% \usebibmacro{date+extrayear}% \setunit*{\addspace}% \savefield{fullhash}{\bbx@lasthash}}% \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}% {}% {\unspace\printtext[parens]{\printdateextra}}} \DeclareCiteCommand{\bbx@crossref} {}% {\ifsingletitle% {\printtext{\ifthenelse{\value{listtotal}=2} {\printnames[][-\value{maxnamesincross}]{labelname}} {\printnames[][-\value{minnamesincross}]{labelname}}}}% {\ifthenelse{\value{listtotal}=2} {\printnames[][-\value{maxnamesincross}]{labelname}} {\printnames[][-\value{minnamesincross}]{labelname}} \setunit{\addspace}% \printtext{\usebibmacro{crossdate+extrayear}}}}% {\unspace}% {\unspace} \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 \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 \usebibmacro{inbookaddendum+pubstate}% \newunit\newblock \usebibmacro{pageref}% \usebibmacro{finentry}}} \endinput