You need to remove
refsection=chapter
Otherwise, Biblatex assumes you will use a separate bibliography for each chapter. You can still have an outer bibliography, but it will only include things cited not in any chapter (before the first \chapter
command, basically). The idea is that you then use \printbibliography
inside each chapter, to print the chapter-specific sources.
In addition, you want to load hyperref
as the last package, unless you know something should be loaded later. The notable case is cleveref
, which must be loaded after hyperref
. That's the only common exception to the hyperref
-last policy I'm aware of.
But note that it would be much better to use Biblatex's facilities to define your custom citation commands. I'm not sure about the compatibility of breakcites
, either (I've never used it).
You should not have to select German at the start of the document as you've specified it as the default.
@book
In general you don't want to change \newblockpunct
you need to change \newunitpunct
The parser recognises the names correctly, you want
\DeclareNameAlias{sortname}{family-given}
You need
\renewcommand*{\revsdnamepunct}{}
See below
@thesis
Your main problem was that you had an \endinput
after the driver for @book
. That line caused biblatex
to ignore everything after it, so the @thesis
driver was never read.
With
\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
you get all titles in italics without quotation marks.
Language not detected
Your MWE detected the French language just fine for me without language=french
. If you use really ancient versions of biblatex
or polyglossia
that could be problematic, but with a fairly modern version, you should be fine.
The citation style
The label
field is only added if there are two works by the same authors. And only then you get to see 'cité' in the bibliography.
The styles are already equipped to do that for us, we only need
\DeclareLabeltitle{%
\field{label}
\field{shorttitle}
\field{title}
\field{maintitle}
}
and two macros to print the 'cité' information in the bibliography
Test document
\listfiles
\documentclass{article}
% Needed by Biblatex
\usepackage{polyglossia}
\setmainlanguage{french}
\usepackage{csquotes}
\usepackage[style=biblatex-xawi, backend=biber, bibencoding=UTF8]{biblatex}
% \usepackage[style=authortitle-terse, backend=biber, bibencoding=UTF8]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{DrueyComte,
author = {Druey, Jean-Nicolas and Comte, Alfred Leopold},
title = {Grundriss des Erbrechts},
edition = 6,
date = {2016},
location = {Berne},
}
@book{Druey,
author = {Druey, Jean-Nicolas},
title = {Titre au hasard},
date = {2016},
edition = 2,
location = {Berne},
label = {Druey-Test},
}
@thesis{gut,
author = {Gut, Nicolas},
title = {Die unbezifferte Forderungsklage nach der Schweizerischen Zivilprozessordnung},
date = {2014},
location = {Bâle},
label = {thèse},
}
@book{gut2,
author = {Gut, Nicolas},
title = {Ein Buch},
date = {2015},
location = {Berne},
label = {Buch},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\section{expectation}
My goal as a real citation in the reference table as :\\
\textsc{Druey} Jean-Nicolas/\textsc{Comte} Alfred Leopold, \textit{Grundriss des Erbrechts, 6e ed}, Berne 2016\\
Output of the cite command should be like "\textsc{Druey/Comte}".
\section{test}
En matière de successions, le CC offre aux héritiers plusieurs façons de procéder (test 1) \cite{DrueyComte}, (test 2) \cite{Druey}.
Finalement, on cite la thèse de N. Gut ici : \cite{gut}.
\cite{gut2}
\printbibliography
\end{document}
.bbx
\ProvidesFile{biblatex-xawi.bbx}[2018/04/18 v1.1 alpha]
\RequireBiber[2]
\RequireBibliographyStyle{authortitle}
\ExecuteBibliographyOptions{dashed=false}
% Formatage de la table
\setlength{\bibhang}{0pt}
\setlength{\bibitemsep}{1.5\baselineskip}
\DeclareDelimFormat{multinamedelim}{\slash}
\DeclareDelimFormat[bib,biblist]{multinamedelim}{\addnbspace\slash\addspace}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}%
\renewcommand*{\newunitpunct}{\addcomma\space}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\revsdnamepunct}{}
\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
\DefineBibliographyStrings{french}{citedas = {cit\'e}}
\newbibmacro{citedas:cite}{%
\begingroup
\delimcontext{cite}%
\DeclareFieldFormat{bibhyperref}{##1}%
\csuse{blx@hook@cite}%
\csuse{blx@hook@citekey}%
\undef\cbx@lasthash
\undef\cbx@lastyear
\citetrackerfalse\pagetrackerfalse\backtrackerfalse
\defcounter{maxnames}{\blx@maxcitenames}%
\usebibmacro{cite}%
\endgroup
}
\newbibmacro{citedas}{%
\ifsingletitle
{}
{\printtext[parens]{%
\bibstring{citedas}%
\addcolon\space
\usebibmacro{citedas:cite}}}}
\renewbibmacro*{location+date}{%
\printlist{location}%
\setunit*{\addspace}%
\usebibmacro{date}%
\newunit}
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{maintitle+title}%
\newunit\newblock
\printfield{edition}%
\newunit\newblock
\usebibmacro{location+date}%
\setunit{\addspace}%
\usebibmacro{citedas}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{thesis}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
\newunit\newblock
\printfield{label}%
\newunit\newblock
% \setunit{\addspace}% <--- do you really want that?
\usebibmacro{location+date}%
\setunit{\addspace}%
\usebibmacro{citedas}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\endinput % <- only at the very end!
.cbx
\ProvidesFile{biblatex-xawi.cbx}[2018/04/18 v1.1]
\RequireCitationStyle{authortitle}
\ExecuteBibliographyOptions{singletitle,uniquename,uniquelist,autocite=inline}
\DeclareDelimFormat{nametitledelim}{\textendash}
\DeclareLabeltitle{%
\field{label}
\field{shorttitle}
\field{title}
\field{maintitle}
}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifnameundef{labelname}
{\usebibmacro{cite:title}}
{\ifsingletitle
{\printtext[bibhyperref]{\printnames{labelname}}}
{\printnames{labelname}%
\setunit{\printdelim{nametitledelim}}%
\usebibmacro{cite:title}}}}%
{\usebibmacro{cite:shorthand}}}
\renewbibmacro*{textcite}{%
\ifnameundef{labelname}
{\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\usebibmacro{cite:title}}%
{\usebibmacro{cite:shorthand}}}
{\ifthenelse{\ifsingletitle\AND
\(\iffieldundef{prenote}\OR\value{citecount}>1\)}
{\printtext[bibhyperref]{\printnames{labelname}}}
{\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\usebibmacro{cite:title}}%
{\usebibmacro{cite:shorthand}}}}}
\endinput
Best Answer
This is a problem with an outdated
biblatex
version on Overleaf. Currently Overleaf reportsbiblatex 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 loadingbiblatex
As in
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 bybath.bbx
,bath.cbx
.