# overleaf custom biblatex style

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?

• I'm not clear what you mean by a custom .bst file here: biblatex uses on a single .bst Mar 7, 2017 at 21:07
• @JosephWright Why does it use a .bst at all? Is this only for backend=bibtex?
– cfr
Mar 7, 2017 at 23:52
• This might be due to a biblatex version mismatch and the style files you're trying to use; Overleaf currently runs the packages in TeX Live 2016 that ships with Ubuntu 16.10 "Yakkety Yak" (overleaf.com/blog/435-tex-live-upgrade-november-2016). If you want, you can contact support@overleaf.com with your project's URL, someone will be able to take a look for you. Mar 8, 2017 at 2:19
• @cfr Yes, used by the BibTeX back end to extract data from the .bib. Mar 8, 2017 at 6:47
• You should be able to upload the .bbx, .cbx (and other files such as .lbx and .dbx) to Overleaf. I'm not sure if you can upload the .dtx and compile that, but that you can do once on your machine and then use the resulting files. If the style files are compatible with the version of biblatex that Overleaf is running, everything should work out fine. biblatex uses only one .bst file and that is unlikely to need change, so don't interfere with the .bst. Mar 8, 2017 at 8:23

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}

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


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.
• If you use the field eventdate in some reference Overleaf will also complain about the command \dateeraprintpre. Adding \newcommand*{\dateeraprintpre}{} will compile, but the result will have errors in the bibliography. Sep 5, 2017 at 16:09