0

I'm trying to change the bibliography style of the template linked below. Such that the citings are in numerical order instead of alphabetical.

https://www.overleaf.com/latex/templates/tu-delft-unofficial-report-template-v1-dot-3-1/yxmgyfvwrykz

The template uses biblatex, so I can't use the following command.

\bibliographystyle{ieeetr}

However, I was expecting the following line to work when added to the report.tex file. But this still clashes with biblatex.

\usepackage[style=ieee]{biblatex}

Making it more specific: Main file:

\documentclass{layout/test}
\usepackage{pdfpages} % Insert .pdf directly as pages
\renewcommand{\deg}{\si{\degree}\xspace}
\begin{document}
\input{chapter-2}
\printbibliography[title=References]
\addcontentsline{toc}{chapter}{References}
\end{document}

And using test.cls as:

\NeedsTeXFormat{LaTeX2e}
\LoadClass[10pt,oneside]{book}
\RequirePackage[hidelinks]{hyperref} % Improved referencing/links
\RequirePackage{biblatex}   % Manages bibliography

%% Commands to define the title, author, etc
\renewcommand{\title}[1]{%
    \def\@title{#1}%
    \hypersetup{pdftitle=#1}} % Adds it to metadata

\renewcommand*\author[1]{%
    \def\@author{#1}%
    \hypersetup{pdfauthor=#1}} % Adds it to metadata

\newcommand*\subtitle[1]{\def\@subtitle{#1}}
\newcommand*\coverimage[1]{\def\@cover@image{#1}}
\newcommand\subject[1]{\def\@subject{#1}}

%% Setting up \autoref to use uppercase
\def\sectionautorefname{Section}
\def\chapterautorefname{Chapter}
\let\subsectionautorefname\sectionautorefname
\let\subsubsectionautorefname\sectionautorefname

%% Adding bibliography file and adjusting spacing
\addbibresource{report.bib} % Specifying the .bib file
5
  • Welcome to TeX SX! There is a biblatex-ieee package, so your [style=ieee] should work fine, provided the corresponding package is installed.
    – Bernard
    Commented Apr 16, 2021 at 13:15
  • Thanks, that's what I thought after I tried it. However, when I add this line to the report.text file it says: "LaTeX Error: Option clash for package biblatex." Together with: "Adding the global options: ,style=ieee to your \documentclass declaration may fix this." So I tried to do this by calling: \documentclass{layout/tudelft-report,style=ieee} However, this gives more errors. Any further help would be appreciated!
    – K. Hans
    Commented Apr 16, 2021 at 13:28
  • 1
    Could you post a small yet complete code reproducing your problem?
    – Bernard
    Commented Apr 16, 2021 at 13:38
  • I should have done this in the first place, apologies. I modified my initial post to reproduce this.
    – K. Hans
    Commented Apr 16, 2021 at 14:09
  • You can try passing the option via the \documentclass or, if it doesn't work, add to your preamble \PassOptionsToPackage{style=ieee}{biblatex}.
    – Bernard
    Commented Apr 16, 2021 at 14:17

2 Answers 2

1

Would've rather made a comment, but sadly I can't.

I am the author of this template and I am glad the problem got resolved. I completely agree with moewe that the implementation of this is flawed. I had come to that realisation a while ago, and tried to address it in the documentation. I have now fixed this (as of v1.4.1) and moved all bibliography commands to the main file. As such, the report.tex file now contains:

%% Setting up the bibliography
\usepackage{biblatex}
\addbibresource{report.bib}

A document created by clicking the 'Open in Overleaf' button in the documentation or from the Github files will include this change immediately. I have also published the changes to the Overleaf gallery, which awaits publication.

You mentioned in a comment that 'hopefully someone else is able to break it down further' in regard to the template. I completely understand that comment, but I am also hoping you will contact me if you do encounter anything else. I have never created a template for a bigger audience before. I definitely can't do everything right the first time, and I hope you understand :-)

0

Your template's class file has it's biblatex style hard coded in. layout/tudelft-report.cls just loads biblatex without any other options

\RequirePackage{biblatex}   % Manages bibliography

so you will end up with the default numeric style.

According to the documentation of your template (https://dzwaneveld.github.io/report/faq.html) the idea is that users should modify their layout/tudelft-report.cls and change the style there. You could for example replace the \RequirePackage{biblatex} with

\RequirePackage[style=ieee]{biblatex}   % Manages bibliography

I don't think this is the best interface for a template because it does not clearly separate user-definable parts (like the bibliography style) and internal implementation of the layout and macros. This is true even more so for the \addbibresource{report.bib} call in the .cls file.

1
  • Thank you! This solved my problem. The original template was even more complex so hopefully someone else is able to break it down further.
    – K. Hans
    Commented Apr 16, 2021 at 15:36

You must log in to answer this question.

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