-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
If you want to split your bibliography into two sections with different citation styles (e.g., numeric style for datasheets/reference manuals, and alphabetic or author-year style for academic papers), you can achieve this in your thesis using biblatex with the following approach:
1. Use biblatex with advanced options
In your preamble, load biblatex with the labelnumber and defernumbers options:
% BibLaTeX % style=authoryear-icomp
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[
hyperref=auto,
mincrossrefs=999,
backend=biber,
style=alphabetic,
labelnumber,
defernumbers
]{biblatex}
\addbibresource{allpapers.bib}
\addbibresource{datasheets.bib}
% Custom citation format in the text
\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{prefixnumber}%
\ifkeyword{datasheet} # same as the Tag entries
{\printfield{labelnumber}}
{\printfield{labelalpha}\printfield{extraalpha}}}}
Be sure change the run.py as
given_settings = {
'mainfile': 'thesis.tex',
'chaptersdir': 'chapters',
'makebibliography': True,
'makeindex': True,
'makeglossary': True,
'makenomenclature': True,
'usebiblatex': True, # change it to True
'biblatexbackend': 'biber', # alternative: bibtex2. Tag entries by type
Add a keyword to your datasheet or special entries in your datasheets.bib file:
@manual{mydatasheet,
title = {My Special Device Datasheet},
year = {2024},
keyword = {datasheet}
}
3. Custom bibliography list style for datasheets and Print bibliographies by group
\defbibenvironment{numblist}
{\list
{\mkbibbrackets{\printfield{labelnumber}}}
{\setlength{\labelwidth}{2em}
\setlength{\leftmargin}{2.5em} # distance between the number to leftmargin
\setlength{\labelsep}{1em} # distance between the number to right words
\setlength{\itemsep}{\bibitemsep}
\setlength{\parsep}{\bibparsep}}}
{\endlist}
{\item}
%Print bibliographies by group
\begin{refcontext}[sorting=nty]
\printbibliography[
title={Datasheets and Reference Manuals},
keyword={datasheet},
resetnumbers=true,
env=numblist
]
\end{refcontext}
\begin{refcontext}[sorting=nty]
\printbibliography[
title={Bibliography},
notkeyword={datasheet}
]
\end{refcontext}3. Complie
python run.py
Metadata
Metadata
Assignees
Labels
No labels

