1

I am new to biblatex, and need to make a bibliography entry for reports that is a modified version of harvard. I have been able to meet the requirements so far as shown below.

World Economic Forum (2020) The Future of Jobs Report 2020. [pdf]. Geneva: World Economic Forum. Available at: http://www3.weforum.org/docs/WEF_Future_of_Jobs_2020.pdf [Accessed 19 December 2020].

However, I need still need to remove the fullstop after "[pdf]" in order for the style to be correct and am unsure how to do so.

main-bib.bib

@report{WEF:2020,
author = {{World Economic Forum}},
title = {The Future of Jobs Report 2020},
type = {pdf},
institution = {World Economic Forum},
year = {2020},
location = {Geneva},
url = {http://www3.weforum.org/docs/WEF_Future_of_Jobs_2020.pdf},
urldate = {2020-12-19},
}

Main file:

\documentclass[a4]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[
    style=ext-authoryear,
    uniquename=init,
    articlein=false,
    dateabbrev=false,
    maxcitenames=1,
    maxbibnames=99,
    giveninits,
    backend=biber
    ]{biblatex}
    
%formats report type into square brackets
\DeclareFieldFormat[report]{type}{\mkbibbrackets{#1}}
    
\addbibresource{main-bib.bib}
\begin{document}
Citing: \cite{WEF:2020}
\printbibliography
\end{document}

Result: enter image description here

1 Answer 1

0

It can be done with two changes in the \DeclareBibliographyDriver{report},

From

\printfield{type}%
\setunit*{\addspace}%

to

\printfield[brackets]{type}% changed <<<<<<<<<<<<
\printunit*{\addspace}% changed <<<<<<<<<<<<<<<<<

Try this code

\documentclass[a4]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[
    style=ext-authoryear,
    uniquename=init,
    articlein=false,
    dateabbrev=false,
    maxcitenames=1,
    maxbibnames=99,
    giveninits,
    backend=biber
    ]{biblatex}
    
%formats report type into square brackets
%\DeclareFieldFormat[report]{type}{\mkbibbrackets{#1}}


\DeclareBibliographyDriver{report}{%
    \usebibmacro{bibindex}%
    \usebibmacro{begentry}%
    \usebibmacro{author}%
    \setunit{\printdelim{nametitledelim}}\newblock
    \usebibmacro{title}%
    \newunit
    \printlist{language}%
    \newunit\newblock
    \usebibmacro{byauthor}%
    \newunit\newblock
    \printfield[brackets]{type}% changed <<<<<<<<<<<<
    \printunit*{\addspace}% changed <<<<<<<<<<<<<<<<
    \printfield{number}%
    \newunit\newblock
    \printfield{version}%
    \newunit
    \printfield{note}%
    \newunit\newblock
    \usebibmacro{institution+location+date}%
    \newunit\newblock
    \usebibmacro{chapter+pages}%
    \newunit
    \printfield{pagetotal}%
    \newunit\newblock
    \iftoggle{bbx:isbn}
    {\printfield{isrn}}
    {}%
    \newunit\newblock
    \usebibmacro{doi+eprint+url}%
    \newunit\newblock
    \usebibmacro{addendum+pubstate}%
    \setunit{\bibpagerefpunct}\newblock
    \usebibmacro{pageref}%
    \newunit\newblock
    \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
        \usebibmacro{related}}
    {}%
    \usebibmacro{finentry}}
    
\addbibresource{main-bib.bib}
\begin{document}
Citing: \cite{WEF:2020}
\printbibliography
\end{document}

dot

You already had figured out the first, but I thought it was better to put the two together.

This is the explanation of the second part, from biblatex manual sec 4.7.1

\setunit{⟨punctuation⟩} \setunit*{⟨punctuation⟩}

The \setunit command is similar to \newunit except that it uses ⟨punctuation⟩ instead of \newunitpunct. The starred variant differs from the regular version in that it checks if the last \printtext, \printfield, \printlist, \printnames, or \bibstring command did actually print anything. If not, it does nothing.

\printunit{⟨ punctuation⟩ } \printunit*{⟨ punctuation⟩ }

The \printunit command is similar to \setunit except that ⟨punctuation⟩ persists in the buffer.

This ensures that ⟨punctuation⟩ is inserted before the next non-empty field printed by the \printtext, \printfield, \printlist, \printnames, or \bibstring commands—regardless of any intermediate calls to \newunit or \setunit.

Recommend The punctuation tracker: https://tex.stackexchange.com/a/435164/161015

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .