3

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?

  • 2
    I'm not clear what you mean by a custom .bst file here: biblatex uses on a single .bst – Joseph Wright Mar 7 '17 at 21:07
  • 1
    @JosephWright Why does it use a .bst at all? Is this only for backend=bibtex? – cfr Mar 7 '17 at 23:52
  • 2
    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. – LianTze Lim Mar 8 '17 at 2:19
  • 1
    @cfr Yes, used by the BibTeX back end to extract data from the .bib. – Joseph Wright Mar 8 '17 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. – moewe Mar 8 '17 at 8:23
4

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.

  • Perfect, thanks so much moewe. I really appreciate it. – Jansky Mar 9 '17 at 8:56
  • 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. – jdehesa Sep 5 '17 at 16:09
  • @jdehesa Yes, defining the missing macros to be empty will only get you so far. You need to wait for Overleaf to update their distribution. – moewe Sep 5 '17 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.