[Tex/LaTex] overleaf custom biblatex style

biblatexoverleaf

I have a custom biblatex style from my department that I compile from a dtx file using TeX. After compiling it I can include it as a style in the same folder locally, and all works fine.

But I can't get it to work in Overleaf. I can't see any way to compile the biblatex style in Overleaf. I've tried uploading all the related files including the bst compiled on my machine and it tells me that there is an error in my .bbx-file:

Package etoolbox Error: \mkdaterangetrunc undefined. See the etoolbox package documentation for explanation. Type H <return> for immediate help. ... l.383 \renewrobustcmd*{\mkdaterangetrunc}

The structure of my Overleaf project, with very little ommitted, is currently as follows. "bath" is the custom biblatex style, "main" is the document and "dissertation_bibliography" is my bibliography:

american-bath.lbx
bath.bbx
bath.bst
bath.cbx
bath.dbx
biblatex-bath.bib
biblatex-bath.dtx
biblatex-bath.ins
british-bath.lbx
dissertation_bibliography.bib
main.tex

Is this possible? Can I compile it on Overleaf somehow, or will moving the bst from my machine work if I do it differently?

Best Answer

This is a problem with an outdated biblatex version on Overleaf. Currently Overleaf reports biblatex 2016/05/14 v3.4 in its logs.

The Bath bibliography files for biblatex from http://www.bath.ac.uk/library/infoskills/referencing-plagiarism/, however use recent date commands that have only been introduced in version 3.5.

Until Overleaf update their system to use a biblatex version newer than 3.5, you can add the following lines before loading biblatex

\newcommand*{\mkdaterangetrunc}{}
\newcommand*{\mkdaterangetruncextra}{}
\newcommand*{\bibdatetimesep}{}
\newcommand*{\bibtimesep}{}
\newcommand*{\printtime}{}

As in

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\newcommand*{\mkdaterangetrunc}{}
\newcommand*{\mkdaterangetruncextra}{}
\newcommand*{\bibdatetimesep}{}
\newcommand*{\bibtimesep}{}
\newcommand*{\printtime}{}

\usepackage[backend=biber, style=bath]{biblatex}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,geer,worman}
\printbibliography
\end{document}

On Overleaf: https://www.overleaf.com/read/zcmphqjfgsgv

Note that you will have to live with a few rough edges and possible deviations from the extended output, because biblatex 3.4 does not support all the commands used by bath.bbx, bath.cbx.

Related Question