%% --------------------------------------------------------------- %% biblatex-ieee --- A biblatex implementation of the IEEE %% 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{ieee.cbx}[2012/12/17 v1.1f biblatex citation style] \RequireCitationStyle{numeric-comp} \ExecuteBibliographyOptions{ maxcitenames = 3, minnames = 3, sorting = none } % Putting brackets around each citation number is a two-part % operation. First, remove them from around the whole citation by % redeclaring here. \DeclareCiteCommand{\cite}% {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}% \usebibmacro{postnote}} % The second part if more awkward. To add brackets, we cannot use labelnumber % as the biblatex kernel does not do a great job on the difference between it % and labelnumberwidth! So instead we tackle the issue here, but that means % a bit of copy-paste work. \renewbibmacro*{cite:comp:comp}{% \ifboolexpr{ ( test {\iffieldundef{prefixnumber}} and test {\ifundef\cbx@lastprefix} ) or test {\iffieldequals{prefixnumber}{\cbx@lastprefix}} } {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}} {\savefield{entrykey}{\cbx@lastkey}% \savefield{labelnumber}{\cbx@lastnumber}% \addtocounter{cbx@tempcnta}{1}} {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}-1} {} {\usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[brackets]{\printtext[bibhyperref]{% \printfield{prefixnumber}% \printfield{labelnumber}}}}}} {\usebibmacro{cite:comp:end}}% \setcounter{cbx@tempcntb}{\thefield{labelnumber}}% \savefield{prefixnumber}{\cbx@lastprefix}} \renewbibmacro*{cite:comp:end}{% \usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[brackets]{\printtext[bibhyperref]{% \printfield{prefixnumber}% \printfield{labelnumber}}}} \renewbibmacro*{cite:comp:inset}{% \usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[brackets]{\printtext[bibhyperref]{% \printfield{prefixnumber}% \printfield{labelnumber}% \printfield{entrysetcount}}}% \setcounter{cbx@tempcntb}{-1}} \renewbibmacro*{cite:dump}{% \ifnumgreater{\value{cbx@tempcnta}}{0} {\ifnumgreater{\value{cbx@tempcnta}}{1} {\bibrangedash} {\multicitedelim}% \bibhyperref[\cbx@lastkey]{% \ifdef\cbx@lastprefix {\printtext[prefixnumber]{\cbx@lastprefix}} {}% \printtext[brackets]{\cbx@lastnumber}}} {}% \setcounter{cbx@tempcnta}{0}% \global\undef\cbx@lastprefix} % More fun, this time with \textcite, which has brackets hard-coded in % the original \renewbibmacro*{textcite}{% \iffieldequals{namehash}{\cbx@lasthash} {\usebibmacro{cite:comp}} {\usebibmacro{cite:dump}\cbx@tempa \usebibmacro{cite:init}% \ifnameundef{labelname} {\printfield[citetitle]{labeltitle}} {\printnames{labelname}}% \addspace \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \usebibmacro{cite:comp}}% \savefield{namehash}{\cbx@lasthash}% \gdef\cbx@tempa{\multicitedelim}} \DeclareCiteCommand{\textcite} {\usebibmacro{cite:init}} {\usebibmacro{citeindex}% \usebibmacro{textcite}} {} {\usebibmacro{postnote}} %% %% Copyright (C) 2011,2012 by %% Joseph Wright %% %% 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 files biblatex-ieee.bib, %% biblatex-ieee.tex, %% ieee.bbx, %% ieee.cbx, %% ieee-alphabetic.bbx and %% ieee-alphabetic.cbx, %% and the derived files biblatex-ieee.pdf and %% biblatex-ieee-alphabetic.pdf. %% %% %% End of file `ieee.cbx'.