Following my question here on the deprecated style biblatex-swiss-legal, I've decided to go for a simple new style. As a first step, I'll work with these requirements :
- Limitated to "book" at the moment
- Separator between author is slash
- Authors in Small cap
- Bibliography as "Author1 / Author2, title, location year." i.e. slash with space
- Citation as "Author1/Author2", i.e. slash, no space
I'm blocked on the steps 2-4. I've found some interesting questions here, like "Biblatex 3.3 name formatting" or "Guidelines for customizing biblatex styles", but I'm not sure how to further proceed after my first draft below.
But it doesn't produce anything else than a neat "! Package biblatex Error: Command '\cite' undefined." What am I missing ? I'd appreciate some guidance or boilerplate example.
Test Files
Main.tex
% MweBiblatex Swiss Legal
\documentclass{article}
% Needed by Biblatex
\usepackage{polyglossia}
\setmainlanguage{french}
\usepackage{csquotes}
\usepackage[style=biblatex-xawi, backend=biber, bibencoding=UTF8]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
{
@book{druey,
author = {Druey, Jean-Nicolas and Comte, Alfred Leopold},
title = {Grundriss des Erbrechts, 6e ed.},
date = {2016},
location = {Berne},
}
}
\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 \cite{druey}.
\printbibliography
\end{document}
biblatex-xawi.cbx
\ProvidesFile{biblatex-xawi.cbx}[2018/04/13 v1.0 alpha]
\endinput
biblatex-xawi.bbx
\ProvidesFile{biblatex-xawi.bbx}[2018/04/13 v1.1 alpha)]
\RequireBiber[2]
% Format des séparateurs entre les noms: des slash
\renewcommand*{\multinamedelim}{\ifcitation{\slash}{\addnbspace\slash\addspace}}% Dans les citations, pas d'espaces entre les slash (contrairement à la bibliographie)
\renewcommand*{\finalnamedelim}{\multinamedelim}%
\DeclareBibliographyDriver{book}{%
\printnames{author}%
\newunit\newblock
\printfield{title}%
\newunit\newblock
\printlist{location}%
\newunit
\printfield{year}%
\finentry}
\endinput
Follow-Up 1
So after reading the answer from @moewe, I've compared the standard style. The most similar one, using biber would be authoryear. This one already use the author list for citing, hence I'd juste need to update the style to remove the year. But this is only partially filling my requirement. On the good side, the code compile and produce authors separated by "/". But there are still the issues :
- Both the citation and the bibliography shows Small Caps on the name. But I don't have a setting for this and the authoryear do not seems to be having one neither. Why is it working ?
- I cannot remove the year from the citation
- I could remove the "," between the year and the location, but cannot manage to have a space in-between.
Any idea why ?
Here are my new BBX/CBX file.
biblatex-xawi.cbx
\ProvidesFile{biblatex-xawi.cbx}[2018/04/13 v1.0 alpha]
\RequireCitationStyle{authoryear}
\endinput
biblatex-xawi.bbx
\ProvidesFile{biblatex-xawi.bbx}[2018/04/13 v1.1 alpha)]
\RequireBiber[2]
% Format des séparateurs entre les noms: des slash
\renewcommand*{\multinamedelim}{\ifcitation{\slash}{\addnbspace\slash\addspace}}% Dans les citations, pas d'espaces entre les slash (contrairement à la bibliographie)
\renewcommand*{\finalnamedelim}{\multinamedelim}%
\DeclareFieldFormat{title}{\textit{#1}}
\DeclareBibliographyDriver{book}{%
\printnames{author}%
\newunit\newblock
\printfield{title}%
\newunit\newblock
\printlist{location}%
\newblock
\printfield{year}%
\finentry}
\endinput
.cbx
file normally defines\cite
and friends. Yours doesn't define any commands, so there is no\cite
. – moewe Apr 13 '18 at 15:02.cbx
and.bbx
files, as close to your intentions as you can get, and modify from there, using\RequireBibliographyStyle
andRequireCitationStyle
to load the base before you modify it. – Paul Stanley Apr 13 '18 at 15:14biblatex
documentation and examples for each style are found in ctan.org/tex-archive/macros/latex/contrib/biblatex/doc/examples (the ones withstyle
in the name). This is also the advice given in Dominik Waßenhoven's article that I linked in my comment here – moewe Apr 13 '18 at 15:22