1

I'm currently using biblatex-bath and need to change one word and the position of another in the outputted Bibliography as below.

This is the .bib reference

@article{anyone,
title = {Test document for bibliography},
volume = {20},
url = {http://web.ebscohost.com},
pages = {331--353},
number = {3},
journaltitle = {Bulletin for Research},
shortjournal = {Bulletin for Research},
author = {{Anyone}, Bob},
urldate = {2019-02-22},
date = {2010},
keywords = {Peer reviewed},

It currently looks like this

enter image description here

I need [Online] in every instance to appear before the Available from text and also 'from' changing to 'at', so it looks like the below.

enter image description here

My MWE is

\documentclass[a4paper, british, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[UKenglish]{babel}
\usepackage{csquotes}
\usepackage[style=bath, backend=biber]{biblatex}
\DeclareDelimFormat[bib]{nameyeardelim}{\addspace}
\DeclareFieldFormat{datelabel}{\mkbibparens{#1}}
\bibliography{zotero.bib}
\begin{document}
\textcite{anyone}
\printbibliography[title=Bibliography]
\end{document}

Thanks for any help

  • You can mark up code by indenting it with four spaces or by clicking the {} button. Please don't include HTML markup (<br>) in the source code. Please also include the relevant entry of your .bib file (anyone) in your question. – moewe Feb 24 '19 at 13:55
  • The braces around Anyone in author = {{Anyone}, Bob}, are superfluous and can be removed, author = {Anyone, Bob}, is much better. No biblatex style that I know of applies sentence casing to names (and it would be a very bad idea to do that), so there is no point in adding those braces. Indeed, they could even lead to issues once https://tex.stackexchange.com/q/414685/35864 – moewe Feb 24 '19 at 14:09

1 Answers1

3

biblatex-bath uses a macro called isonline that is inserted into all kinds of macros to typeset the "[Online]" bit. So the first step is to redefine that macro to print nothing. The second step is to print the "[Online]" in the desired location. Here it seemed easiest to do that in the url field format.

The "available at" can be changed by redefining the bibstring urlfrom.

\documentclass[a4paper, british, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=bath, backend=biber]{biblatex}

\DeclareDelimFormat[bib]{nameyeardelim}{\addspace}
\DeclareFieldFormat{datelabel}{\mkbibparens{#1}}

\renewbibmacro*{isonline}{}

\DefineBibliographyStrings{english}{
  urlfrom = {available at},
}

\DeclareFieldFormat{url}{%
  \bibsentence\bibstring[\mkbibbrackets]{online}%
  \addspace
  \bibsentence\bibstring{urlfrom}%
  \addcolon\space
  \url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}

\bibliography{biblatex-examples.bib}

\begin{document}
\textcite{ctan}
\printbibliography[title=\bibname]
\end{document}

CTAN, (2006). Ctan: the Comprehensive TeX Archive Network. [Online] Available at: http://www.ctan.org [Accessed 1 October 2006].

As mentioned in your other question, it might be viable to start from a standard style instead of a custom style like biblatex-bath if you expect more changes.

moewe
  • 175,683