In my first question I covered the definition of the Bibliography driver, and now I'm almost done with the definition, thanks to the help of this forum.
GutNicolas, Die unbezifferte Forderungsklage nach der Schweizerischen Zivil-prozessordnung, These, Bâle , 2014 (cité :Gut , These ).
I'd need to get this kind of bibliography :
Gut Nicolas, Die unbezifferte Forderungsklage nach der Schweizerischen Zivil-prozessordnung, thèse, Bâle 2014 (cité :Gut-These ).
This means :
- Change the delimiter in the cited as part
- Change the delimiter in case of multiple location to " / "
- Allows multiple location (builtin ?)
- Remove the punctuation (,) in between the type, location and year part.
- Change the use of "printfield{label}" to "printfield{type}"
Question :
Which kind of parameter should I investigate ?
Edit 1 - MWE instead of Extracts
Following the remark from @moewe, I edit this post to include a MWE.
Main.Tex
% MweBiblatex Swiss Legal
\documentclass{article}
% Needed by Biblatex
\usepackage{polyglossia}
\setmainlanguage{french}
\usepackage{csquotes}
\usepackage[style=biblatex-xawi, language=french, bibencoding=UTF8, backend=biber]{biblatex}
\addbibresource{main.bib}
\begin{document}
\section{Test de la bibliographie}
\printbibliography
\section{Tests de citation}
\nocite{*}
\subsection{Thèse}
\cite{gut}
\end{document}
Main.bib
@thesis{gut,
author = {Gut, Nicolas},
title = {Die unbezifferte Forderungsklage nach der Schweizerischen Zivilprozessordnung},
date = {2014},
location = {Bâle},
label = {These}
}
@thesishabilitation{gut2,
author = {Gut, Nicolas},
title = {Die unbezifferte Forderungsklage nach der Schweizerischen Zivilprozessordnung},
date = {2017},
location = {Berne},
label = {Forderungsklage}
}
@thesis{other,
author = {Other, Nicolas},
title = {A title for a thesis},
date = {2017},
location = {Berne}
}
biblatex-xawi.cbx
% PREAMBULE / REGLES GENERALES
\ProvidesFile{biblatex-xawi.cbx}[2018/04/13 v1.0 alpha]
\RequireCitationStyle{authortitle}
% --- --- Formatage général des citations --- --- %
\DeclareFieldFormat*{citetitle}{#1}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- Formatage de la citation spécifique dans les citations --- %
% Definition de la partie "Labeltitle"
\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{\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
biblatex-xawi.bbx
\ProvidesFile{biblatex-xawi.bbx}[2018/04/13 v1.1 alpha)]
% Depencances
\RequireBiber[2]
\RequireBibliographyStyle{authortitle}
% Localisation
\NewBibliographyString{
thesis,
habilthesis
}
\DefineBibliographyStrings{french}{
citedas = {cité},
thesis = {Thèse}
habilthesis = {Thèse d'habilitation}
}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- --- Setting default options --- --- %
\ExecuteBibliographyOptions{%
maxbibnames=99, % nombre max. de noms pour les entrées
maxcitenames=4, % nombre max. de noms pour les citations
mincrossrefs=1, % nombre min pour les références croisées
bibwarn=false, % avertissement uniques pour les entrés bibliographiques
dashed=false, % Nom entier même si répétition
singletitle=true,
uniquename=full,
uniquelist=true
}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- --- Formatage général des citations & bibliogryphies --- --- %
% Formatage global :
\DeclareFieldFormat{title}{\mkbibemph{#1}}
% Format des séparateurs entre les noms: des slash
% \DeclareDelimFormat{multinamedelim}{\slash}
% \DeclareDelimFormat[bib,biblist]{multinamedelim}{\addnbspace\slash\addspace}
% \DeclareDelimAlias{finalnamedelim}{multinamedelim}%
% Dans les citations, pas d'espaces entre les slash (contrairement à la bibliographie)
\renewcommand*{\multinamedelim}{\ifcitation{\slash}{\addnbspace\slash\addspace}}
\renewcommand*{\finalnamedelim}{\multinamedelim}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\revsdnamepunct}{}
\DeclareNameAlias{sortname}{family-given}
% Remove all possible shorthand
% https://tex.stackexchange.com/questions/244714/how-to-disable-the-use-of-shorthands-in-biblatex
\DeclareFieldInputHandler{shorthand}{\def\NewValue{}}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- --- Pilote de bibliographie pour Thèse et Thèse d'habilitation --- --- %
% Formatage du style par défaut
\DeclareFieldFormat[thesis]{title}{#1}
\DeclareFieldFormat[thesis]{location}{#1}
\DeclareBibliographyDriver{thesis}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
\newunit\newblock
\printfield{label}%
\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}}
%
\DeclareStyleSourcemap{
\maps{
\map{
\pertype{thesis}
\step[fieldset=type, fieldvalue=thesis]
}
\map{
\step[typesource=thesehabilitation, typetarget=thesis, final]
\step[fieldset=type, fieldvalue=habilthesis]
}
}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---%
% --- Formatage de la citation spécifique dans la bibliographie --- %
% format : (cité : Auteur-label)
% Voir aussi partie "CBX" pour la partie "citation"
\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}
}
}
}
\endinput % seulement à la fin
.bbx
and.cbx
files so we know what we are talking about. It would also help if you could add a short.tex
document with an example.bib
entry of a@thesis
that uses your custom styles. – moewe Apr 25 '18 at 12:53