diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-nejm/nejm.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-nejm/nejm.bbx | 228 |
1 files changed, 60 insertions, 168 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-nejm/nejm.bbx b/Master/texmf-dist/tex/latex/biblatex-nejm/nejm.bbx index 00af201f37a..43630319e41 100644 --- a/Master/texmf-dist/tex/latex/biblatex-nejm/nejm.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-nejm/nejm.bbx @@ -1,144 +1,78 @@ -%% Copyright (C) 2011 by Marco Daniel -%% +%% Copyright (C) 2011, 2018 by Marco Daniel +%% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in -%% +%% %% http://www.latex-project.org/lppl.txt -%% +%% %% and version 1.3c or later is part of all distributions of LaTeX %% version 2008/05/04 or later. -%% +%% %% This work has the LPPL maintenance status `maintained'. -%% +%% %% The Current Maintainer of this work is Marco Daniel. -%% +%% %% This work consists of the files nejm.bbx, nejm.cbx, biblatex-nejm.tex %% and biblatex-nejm.pdf -%%$Id: nejm.bbx 28 2011-09-09 17:17:01Z marco $ -%%$Rev: 28 $ +%%$Id: nejm.bbx 30 2018-07-28 11:01:00Z marco $ +%%$Rev: 30 $ %%$Author: marco $ -%%$Date: 2011-09-09 19:17:01 +0200 (Fr, 09. Sep 2011) $ -\def\biblatexnejmversionbbx{v0.4} +%%$Date: 2018-07-28 13:01:00Z +0200 (Sa, 28. Jul 2018) $ +\def\biblatexnejmversionbbx{v0.5} \def\biblatexnejmpackagenamebbx{nejm.bbx} \def\biblatexnejmsvnbbx$#1: #2 #3 #4-#5-#6 #7 #8${#4/#5/#6\space } -\ProvidesFile{nejm.bbx}[\biblatexnejmsvnbbx$Id: nejm.bbx 28 2011-09-09 17:17:01Z marco $ \biblatexnejmversionbbx: \biblatexnejmpackagenamebbx] +\ProvidesFile{nejm.bbx}[\biblatexnejmsvnbbx$Id: nejm.bbx 30 2018-07-28 11:01:00Z marco $ \biblatexnejmversionbbx: \biblatexnejmpackagenamebbx] %use numeric.cbx as base %Warning if backend isn't biber \RequireBiber[2] %need style: -\RequireBibliographyStyle{standard} - -%set options to biblatex -\ExecuteBibliographyOptions - { - isbn = false , - labelnumber = true , - minnames = 3 , - maxnames = 6 , - firstinits = true , - terseinits = true , - sorting = none , - % language = nejm , - } - - -%provide original option -\providebool{bbx:subentry} -\DeclareBibliographyOption{subentry}[true]{% - \setbool{bbx:subentry}{#1}} +\RequireBibliographyStyle{numeric} \providetoggle{bbx:articledoi} -\DeclareBibliographyOption{articledoi}[false]{% +\DeclareBibliographyOption[boolean]{articledoi}[true]{% \settoggle{bbx:articledoi}{#1}} \providetoggle{bbx:articlein} -\DeclareBibliographyOption{articlein}[false]{% +\DeclareBibliographyOption[boolean]{articlein}[true]{% \settoggle{bbx:articlein}{#1}} \providetoggle{bbx:printlang} -\DeclareBibliographyOption{printlang}[false]{% +\DeclareBibliographyOption[boolean]{printlang}[true]{% \settoggle{bbx:printlang}{#1}} +%set options to biblatex +\ExecuteBibliographyOptions + { + isbn = false , + labelnumber = true , + minnames = 3 , + maxnames = 6 , + giveninits = true , + terseinits = true , + sorting = none , + date = year , + articledoi = false, + articlein = false, + printlang = false, + } -%specify language -\DeclareListFormat{language}{% - \iftoggle{bbx:printlang}{% - \usebibmacro{list:delim}{% - \ifbibstring{#1}% - {\bibxstring{#1}}% - {\ifbibstring{lang#1}% - {\bibxstring{lang#1}}% - {#1}}}% - \ifbibstring{#1}% - {\bibstring{#1}}% - {\ifbibstring{lang#1}% - {\bibstring{lang#1}}% - {#1}}% - \usebibmacro{list:andothers}% - }{}% -} -%format date -- only year printed -\@ifpackageloaded{babel}{% - \edef\blx@tempa{\bbl@main@language}% - }{% - \edef\blx@tempa{\blx@languagename}% -} -\DefineBibliographyExtras{\blx@tempa}{% -%<year><month><day> - \protected\def\mkbibdatelong#1#2#3{% - \stripzeros{\thefield{#1}}% - }% - \protected\def\mkbibdateshort#1#2#3{% - \mkdatezeros{\thefield{#1}}% - }% +\AtBeginDocument{% + \iftoggle{bbx:printlang} + {} + {\DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \step[fieldset=language, null] + } + } + }}% } -%Set environment -\defbibenvironment{bibliography} - {\list - {\printtext[labelnumberwidth]{% - \printfield{prefixnumber}% - \printfield{labelnumber}}} - {\setlength{\labelwidth}{\labelnumberwidth}% - \setlength{\leftmargin}{\labelwidth}% - \setlength{\labelsep}{\biblabelsep}% - \addtolength{\leftmargin}{\labelsep}% - \setlength{\itemsep}{\bibitemsep}% - \setlength{\parsep}{\bibparsep}}% - \renewcommand*{\makelabel}[1]{\hss##1}} - {\endlist} - {\item} - -\defbibenvironment{shorthands} - {\list - {\printfield[shorthandwidth]{shorthand}} - {\setlength{\labelwidth}{\shorthandwidth}% - \setlength{\leftmargin}{\labelwidth}% - \setlength{\labelsep}{\biblabelsep}% - \addtolength{\leftmargin}{\labelsep}% - \setlength{\itemsep}{\bibitemsep}% - \setlength{\parsep}{\bibparsep}% - \renewcommand*{\makelabel}[1]{\hss##1}}} - {\endlist} - {\item} - -%% -\DeclareBibliographyDriver{set}{% - \entryset - {\ifbool{bbx:subentry} - {\printfield[bibentrysetcount]{entrysetcount}% - \setunit*{\addnbspace}} - {}} - {}% - \newunit\newblock - \usebibmacro{setpageref}% - \finentry} - %remove punctuation and space after initials -- require biber \renewrobustcmd*{\bibinitperiod}{} %separator printed before the pages field @@ -146,7 +80,7 @@ %no bracktes in thebibliography and add dot \DeclareFieldFormat{labelnumberwidth}{#1\adddot} %not formating pages -\DeclareFieldFormat*{pages}{#1} +\DeclareFieldFormat*{pages}{\mkcomprange{#1}} %not formated journaltitle \DeclareFieldFormat*{journaltitle}{#1} %not formated title @@ -154,62 +88,25 @@ %Set name format -\DeclareNameAlias{default}{last-first} -\DeclareNameAlias{sortname}{last-first} -%Not needed?? -\DeclareNameAlias{author}{last-first} -\DeclareNameAlias{editor}{last-first} -\DeclareNameAlias{translator}{last-first} - -%remove comma between familyname and firstname -\renewbibmacro*{name:last-first}[4]{% - \ifuseprefix - {\usebibmacro{name:delim}{#3#1}% - \usebibmacro{name:hook}{#3#1}% - \ifblank{#3}{}{% - \ifcapital - {\mkbibnameprefix{\MakeCapital{#3}}\isdot} - {\mkbibnameprefix{#3}\isdot}% - \ifpunctmark{'}{}{\bibnamedelimc}}% - \mkbibnamelast{#1}\isdot - \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}% - \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}}%remove \addcomma - {\usebibmacro{name:delim}{#1}% - \usebibmacro{name:hook}{#1}% - \mkbibnamelast{#1}\isdot - \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}% -% \ifblank{#2#3}{}{\addcomma}%%commented - \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}% - \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}}} +\DeclareNameAlias{default}{family-given} +\DeclareNameAlias{sortname}{family-given} + +%remove comma between family name and given name +\renewcommand*{\revsdnamepunct}{} %option articledoi -- no doi / eprint / url in article -\newbibmacro*{doi+eprint+url-use}{% - \iftoggle{bbx:doi}% - {\printfield{doi}}% - {}% - \newunit\newblock - \iftoggle{bbx:eprint}% - {\usebibmacro{eprint}}% - {}% - \newunit\newblock - \iftoggle{bbx:url}% - {\usebibmacro{url+urldate}}% - {}% -} +\letbibmacro{doi+eprint+url-use}{doi+eprint+url} \renewbibmacro*{doi+eprint+url}{% - \ifentrytype{article}% - {% - \iftoggle{bbx:articledoi}% - {\usebibmacro{doi+eprint+url-use}}{}% - }{\usebibmacro{doi+eprint+url-use} - }% + \ifboolexpr{test {\ifentrytype{article}} and not togl {bbx:articledoi}} + {} + {\usebibmacro{doi+eprint+url-use}}% } %no bibstring in in article: \renewbibmacro*{in:}{% -\ifentrytype{article}% - {\iftoggle{bbx:articlein}{\printtext{\bibstring{in}\intitlepunct}}{}}% + \ifboolexpr{test {\ifentrytype{article}} and not togl {bbx:articlein}} + {} {\printtext{\bibstring{in}\intitlepunct}}% } @@ -223,26 +120,21 @@ %Order year;volume:page \renewbibmacro*{issue+date}{% - \printtext{% - \iffieldundef{issue} - {\usebibmacro{date}} - {\printfield{issue}% - \setunit*{\addspace}% - \usebibmacro{date}}}% + \printfield{issue}% + \setunit*{\addspace}% + \usebibmacro{date}% \newunit} \renewbibmacro*{journal+issuetitle}{% \usebibmacro{journal}% - \setunit*{\addspace}% - \usebibmacro{issue+date}% - \setunit*{\addsemicolon} \iffieldundef{series} {} {\newunit - \printfield{series}% - \setunit{\addspace}}% + \printfield{series}}% + \setunit*{\addspace}% + \usebibmacro{issue+date}% + \setunit*{\addsemicolon} \usebibmacro{volume+number+eid}% - \setunit{\addspace}% \setunit{\addcomma\space}% \usebibmacro{issue}% \newunit} |