diff options
author | Karl Berry <karl@freefriends.org> | 2011-03-14 23:49:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-03-14 23:49:28 +0000 |
commit | 810e2293a8714d90ea245654ccab33a7915944c5 (patch) | |
tree | d49d234488744b66851fe7853a454a6177eb5cae /Master/texmf-dist/tex/latex/biblatex-science/science.bbx | |
parent | eb0430d0ead5538462016644096abe9d386760be (diff) |
biblatex-science
git-svn-id: svn://tug.org/texlive/trunk@21721 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-science/science.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-science/science.bbx | 561 |
1 files changed, 561 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-science/science.bbx b/Master/texmf-dist/tex/latex/biblatex-science/science.bbx new file mode 100644 index 00000000000..534d53bb7b1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-science/science.bbx @@ -0,0 +1,561 @@ +%% --------------------------------------------------------------- +%% biblatex-science --- A biblatex implementation of the Science +%% bibliography style +%% Maintained by Joseph Wright +%% E-mail: joseph.wright@morningstar2.co.uk +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% --------------------------------------------------------------- +%% + +\ProvidesFile{science.bbx}[2011/03/13 v1.1 biblatex bibliography style] + +% Load the standard style to avoid copy-pasting unnecessary material +\RequireBibliographyStyle{numeric-comp} + +% Additional options +\newtoggle{bbx:article-title} +\DeclareBibliographyOption{article-title}[true]{% + \settoggle{bbx:article-title}{#1}% +} + +% Alter settings that carry through from biblatex +\ExecuteBibliographyOptions{ + article-title = false , + firstinits , + maxnames = 5 , + maxcitenames = 2 , + useprefix , +} + +% Modify the name format +\DeclareNameFormat{default}{% + \usebibmacro{name:first-last}{#1}{#4}{#5}{#7}% + \usebibmacro{name:andothers}% +} + +\newbibmacro*{name:andothers}{% + \ifboolexpr{ + test {\ifnumequal{\value{listcount}}{\value{liststop}}} + and + test \ifmorenames + } + {% + \ifnumgreater{\value{liststop}}{1} + {\finalandcomma} + {}% + \andothersdelim + \bibstring[\mkbibemph]{andothers}% + } + {}% +} + +% Field formats for the bibliography environment +\DeclareFieldFormat{labelnumberwidth}{#1\adddot} + +% Custom field formats +\DeclareFieldFormat{edition}{% + \ifinteger{#1} + {\bibstring{edition}~#1} + {#1}% +} +\DeclareFieldFormat[inproceedings]{booktitle}{#1} +\DeclareFieldFormat[article]{pages}{#1} +\DeclareFieldFormat[proceedings]{title}{#1} +\DeclareFieldFormat[article]{title}{#1\adddot\space\nopunct} +\DeclareFieldFormat[report]{title}{\mkbibquote{#1}} +\DeclareFieldFormat{url}{\url{#1}} +\DeclareFieldFormat[article,periodical]{volume}{\mkbibbold{#1}} + +% Simple modifications to punctuation, etc. +\let\finalnamedelim\multinamedelim +\renewcommand*\intitlepunct{\addspace} +\renewcommand*\newunitpunct{\addcomma\space} + +% Bibliography strings +\NewBibliographyString{presentedat} + +\DefineBibliographyStrings{english}{ + editor = Ed\adddot , + editors = Eds\adddot , + patentus = US Patent , + presentedat = presented at the\addspace , +} + +% Bibliography macros +\renewbibmacro*{event+venue+date}{% + \printfield{eventtitle}% + \ifboolexpr{ + test {\iffieldundef{venue}} + and + test {\iffieldundef{eventyear}} + } + {} + {% + \printfield{venue}% + \newunit + \iffieldundef{eventyear} + {% + \printdate + \clearfield{year}% + } + {% + \printeventdate + \clearfield{eventyear}% + }% + }% + \newunit +} + +\renewbibmacro*{institution+location+date}{% + \ifboolexpr{ + test {\iflistundef{institution}} + and + test {\iflistundef{location}} + and + test {\iffieldundef{edition}} + and + test {\iffieldundef{date}} + } + {} + {% + \nopunct + \printtext[parens]{% + \printlist{institution}% + \newunit + \printlist{location}% + \newunit + \printfield{edition}% + \newunit + \usebibmacro{date}% + }% + }% +} + +\newbibmacro*{journal+issuetitle}{% + \usebibmacro{journal}% + \setunit*{\addspace}% + \iffieldundef{series} + {} + {% + \newunit + \printfield{series}% + \setunit{\addspace}% + }% + \printfield{volume}% + \newunit + \usebibmacro{issue}% + \newunit +} + +\renewbibmacro*{publisher+location+date}{% + \ifboolexpr{ + test {\iflistundef{publisher}} + and + test {\iflistundef{location}} + and + test {\iffieldundef{edition}} + and + test {\iffieldundef{date}} + } + {} + {% + \nopunct + \printtext[parens]{% + \printlist{publisher}% + \newunit + \printlist{location}% + \newunit + \printfield{edition}% + \newunit + \usebibmacro{date}% + }% + }% +} + +% New bibliography drivers, using the required order of fields. These +% are mainly copied from standard.bbx then modified. +\DeclareBibliographyDriver{article}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% + \setunit{\labelnamepunct}\newblock + \iftoggle{bbx:article-title} + {\usebibmacro{title}} + {}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{bytranslator+others}% + \newunit\newblock + \printfield{version}% + \newunit\newblock + \usebibmacro{journal+issuetitle}% + \newunit + \usebibmacro{byeditor+others}% + \newunit + \usebibmacro{note+pages}% + \newunit + \iftoggle{bbx:isbn} + {\printfield{issn}} + {}% + \newunit\newblock + \iffieldundef{pages} + {\usebibmacro{doi+eprint+url}} + {}% + \setunit{\addspace}\newblock + \iffieldundef{year} + {\printfield{howpublished}} + {\usebibmacro{issue+date}}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{book}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{maintitle+title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{volumes}% + \newunit\newblock + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volume} + \newunit + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \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}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{maintitle+title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{volumes}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volume} + \newunit + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{inbook}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% + \setunit{\labelnamepunct}\newblock + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{in:}% + \usebibmacro{bybookauthor}% + \newunit\newblock + \usebibmacro{maintitle+booktitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{volumes}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volume} + \newunit + \usebibmacro{chapter+pages}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{incollection}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% + \setunit{\labelnamepunct}\newblock + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{in:}% + \usebibmacro{maintitle+booktitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{volumes}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volume} + \newunit + \usebibmacro{chapter+pages}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{inproceedings}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% + \setunit{\labelnamepunct}\newblock + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \bibstring{presentedat}% + \usebibmacro{maintitle+booktitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \iffieldundef{maintitle} + {\printfield{volume}% + \printfield{part}} + {}% + \newunit + \printfield{volumes}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{event+venue+date}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{online}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \printlist{organization}% + \newunit\newblock + \iftoggle{bbx:eprint} + {\usebibmacro{eprint}} + {}% + \nopunct + \printtext[parens]{% + \iffieldundef{year} + {\printfield{urlyear}} + {\usebibmacro{date}}% + \setunit*{\addsemicolon\space}% + \printfield{url}% + }% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{patent}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% + \setunit{\labelnamepunct}\newblock + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{number}% + \iflistundef{location} + {} + {\setunit*{\addspace}% + \printtext[parens]{% + \printlist[][-\value{listtotal}]{location}}}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit + \nopunct + \printfield[parens]{year}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{periodical}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \printfield{issuetitle}% + \newunit + \usebibmacro{author/editor+others/translator+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{maintitle+title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{volumes}% + \newunit\newblock + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volume} + \newunit + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyDriver{thesis}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% + \setunit{\labelnamepunct}\newblock + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \printfield{type}% + \newunit\newblock + \printlist{institution}% + \newunit + \printdate + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \usebibmacro{finentry}% +} + +%% +%% Copyright (C) 2010,2011 by +%% Joseph Wright <joseph.wright@morningstar2.co.uk> +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Joseph Wright. +%% +%% This work consists of the file biblatex-science.bib, +%% biblatex-science.tex, +%% science.bbx and +%% science.cbx, +%% and the derived file biblatex-science.pdf. +%% +%% +%% End of file `science.bbx'.
\ No newline at end of file |