1 % Copyright (c) 2020 Agnibho Mondal
4 % This file is part of BibLaTex Vancouver.
6 % BibLaTex Vancouver is free software: you can redistribute it and/or modify it
7 % under the terms of the GNU General Public License as published by the Free
8 % Software Foundation, either version 3 of the License, or (at your option) any
11 % BibLaTex Vancouver is distributed in the hope that it will be useful, but
12 % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 % FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 % You should have received a copy of the GNU General Public License along with
17 % BibLaTex Vancouver. If not, see <http://www.gnu.org/licenses/>.
23 \ProvidesFile{vancouver.bbx}[2020/05/20 v0.1 biblatex vancouver]
26 \RequireBibliographyStyle{numeric}
28 \RequirePackage{ifthen}
30 % Set default bibliography options
31 \ExecuteBibliographyOptions{
39 % Remove unwanted punctuations
40 \renewcommand*{\revsdnamepunct}{}
41 \renewcommand*{\finentrypunct}{}
42 \renewcommand*{\bibpagespunct}{}
47 % Provide three letter month names
48 \newcommand*{\shortmonth}[1]{
49 \ifthenelse{\NOT\equal{#1}{}}{
68 \DeclareNameAlias{default}{family-given}
70 % Remove unwanted formatting
71 \DeclareFieldFormat*{title}{#1}
72 \DeclareFieldFormat*{journaltitle}{#1}
73 \DeclareFieldFormat*{labelnumberwidth}{#1\adddot}
74 \DeclareFieldFormat*{pages}{:\mkcomprange{#1}}
75 \DeclareFieldFormat*{url}{Available from: \url{#1}}
76 \DeclareFieldFormat*[article]{issue}{(#1)}
77 \DeclareFieldFormat*{date}{
79 \shortmonth{\thefield{month}}\addspace
82 \DeclareFieldFormat*{urldate}{
85 \shortmonth{\thefield{urlmonth}}\addspace
89 % Some string replacements
91 \maps[datatype=bibtex]{
93 \step[fieldsource=journaltitle, match=\regexp{(\.)}, replace={}]
94 \step[fieldsource=journaltitle, match=\regexp{($)}, replace={.}]
99 % Code adapted from biblatex-nejm package
101 \renewbibmacro*{volume+number+eid}{
107 %Order year;volume:page
108 \renewbibmacro*{issue+date}{
109 \setunit*{\addspace}%
114 \renewbibmacro*{journal+issuetitle}{
115 \usebibmacro{journal}%
116 \iffieldundef{series}
119 \printfield{series}}%
120 \setunit*{\addspace}%
121 \usebibmacro{issue+date}%
122 \setunit*{\addsemicolon\addspace}%
123 \usebibmacro{volume+number+eid}%