I was wondering whether it's possible to add a biblatex entry type (as I do not wish to use a different biblatex style) to something like "law".
When it comes to law, unfortunately my university's ruleset is not too strict (so I don't know if and where to add fields like "publisher", "location" and such - if you have a neat idea, let me know!) - however there are some requirements when it comes to law texts:
The law bibliography entry should start with the title instead of author/editor/institution/organization and so on.
I have tried to stick to this: example, however, it doesn't work (I tried the exact sample, which worked, however, when I changed configurations in terms of class, bibliography and tried to compile, it already broke. I am also completely lost, why that happens and just tried to still adapt things to my necessities, which obviously didn't work either)
That's my current non-working MWE, which does not even contain any bib formatting, since I already failed many steps earlier.
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@legislation{help,
legaltitle = {Kaisei minp\={o} j\={o}bun},
law = {Saik\={o}-saiban-sho},
date = {1947},
location = {T\={o}ky\={o}},
maintitle = {testmaintitle},
legaltitleaddon = {{\"U}berarbeiteter Gesetzestext des Zivilgesetzbuchs},
doi = {10.11501/1275567},
urldate = {2019-08-01},
legalbook = {5},
legalchapter = {3},
legalarticle = {2}
}
\end{filecontents*}
\begin{filecontents}{legislation.dbx}
\DeclareDatamodelEntrytypes{legislation}
\DeclareDatamodelFields[type=field,datatype=literal]{
court,
legalcode,
law,
legaltitle,
legaltitleaddon
}
\DeclareDatamodelFields[type=field, datatype=verbatim]{
legalbookno,
legalchapterno,
legalarticleno
}
\DeclareDatamodelEntryfields[legislation]{
court,
legalcode,
legaltitle,
legaltitleaddon,
law,
date,
urldate,
legalbookno,
legalchapterno,
legalarticleno,
maintitle,
maintitleaddon,
url,
doi,
location
}
\end{filecontents}
\documentclass[a4paper]{scrartcl}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
\usepackage[datamodel=legislation,backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}
\DeclareLanguageMapping{ngerman}{legislation}
\DeclareFieldFormat[legislation]{legaltitle}{#1\isdot}
\DeclareFieldFormat{titleaddon}{\mkbibbrackets{#1}}
\DeclareFieldAlias{legaltitleaddon}{titleaddon}
\newbibmacro*{bookchaparticle}{%
\bibstring{legalbook}%
\printfield{legalbookno}
\setunit{\addcomma\space}
\bibstring{legalchapter}%
\printfield{legalchapterno}
\setunit{\addcomma\space}
\bibstring{legalarticle}%
\printfield{legalarticleno}
\DeclareBibliographyDriver{legislation}{%
\usebibmacro{bibindex}%
\usebibmacro{bookchaparticle}%
\newunit\newblock
\usebibmacro{finentry}}
\begin{document}
\nocite{*}
\cite{help}
\printbibliography
\end{document}
Thank you!
output before (currently no output due to errors in my code):
required output:
That's what I tried to use as the closest example to this one, however this also doesn't work.
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@stackexchange{se:l3help,
sitetopic = {tex},
title = {What can \textit{I} do to help the \LaTeX3 Project},
askdate = {2012-02-26},
askid = {45838},
askp = {Brent Longorough},
askpid = {344},
ansp = {Frank Mittelbach},
anspid = {10109},
ansdate = {2012-03-01},
ansid = {46427},
}
\end{filecontents*}
\begin{filecontents}{stackexchange.dbx}
\DeclareDatamodelEntrytypes{stackexchange}
\DeclareDatamodelFields[type=field,datatype=literal]{
sitekey,
sitetopic,
}
\DeclareDatamodelFields[type=list,datatype=name]{
askp,
ansp,
}
\DeclareDatamodelFields[type=field, datatype=date, skipout]{
askdate,
ansdate,
askeditdate,
anseditdate}
\DeclareDatamodelFields[type=field, datatype=verbatim]{
askid,
askpid,
anspid,
ansid,
}
\DeclareDatamodelEntryfields[stackexchange]{
sitekey,
sitetopic,
askid,
askp,
askpid,
ansp,
anspid,
ansid,
askyear,
askmonth,
askday,
ansyear,
ansmonth,
ansday,
askedityear,
askeditmonth,
askeditday,
ansedityear,
anseditmonth,
anseditday,
title}
\end{filecontents}
\documentclass[
12pt,
a4paper,
headings=standardclasses,
listof=totoc,
numbers=noenddot
]{scrartcl}
\usepackage{showframe}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
\usepackage[
backend=biber,
style=ext-authoryear,
sorting=nyvt,
datamodel=journaltitleaddon,
maxnames=25,
innamebeforetitle=true,
usetranslator=true,
alldates=terse,
labeldate=year,
dashed=false,
isbn=false
]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}
\begin{filecontents*}{english-stack.lbx}
\ProvidesFile{english-stack.lbx}[2014/05/07 english with additions for stackexchange]
\InheritBibliographyExtras{english}
\NewBibliographyString{asked,answered,edited}
\DeclareBibliographyStrings{%
inherit = {english},
asked = {{asked}{asked}},
answered = {{answered}{answered}},
edited = {{edited}{edited}},
}
\end{filecontents*}
\DeclareLanguageMapping{ngerman}{ngerman}
\DeclareFieldFormat[stackexchange]{title}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat{askpid}{%
\mkbibparens{\ifhyperref
{\href{http://tex.stackexchange.com/users/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}}
\DeclareFieldFormat{anspid}{%
\mkbibparens{\ifhyperref
{\href{http://tex.stackexchange.com/users/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}}
\DeclareFieldFormat{askid}{%
\mkbibparens{\ifhyperref
{\href{http://tex.stackexchange.com/q/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}}
\DeclareFieldFormat{ansid}{%
\mkbibparens{\ifhyperref
{\href{http://tex.stackexchange.com/a/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}}
\newbibmacro*{stackexchangequestion}{%
\printfield{title}%
\setunit{\addspace}%
\printfield{askid}%
}
\newbibmacro*{stackexchangeask}{%
\bibstring{asked}%
\setunit{\addspace}%
\printaskdate%
\iffieldundef{askedityear}%
{}
{\printtext[parens]{%
\bibstring{edited}%
\setunit{\addspace}%
\printaskeditdate}}%
\setunit{\addspace}%
\bibstring{byauthor}%
\setunit{\addspace}%
\printnames{askp}%
\setunit{\addspace}%
\printfield{askpid}%
}
\newbibmacro*{stackexchangeans}{%
\bibstring{answered}%
\setunit{\addspace}%
\printansdate%
\iffieldundef{ansedityear}
{}
{\printtext[parens]{%
\bibstring{edited}%
\setunit{\addspace}%
\printanseditdate}}%
\setunit{\addspace}%
\bibstring{byauthor}%
\setunit{\addspace}%
\printnames{ansp}%
\setunit{\addspace}%
\printfield{anspid}%
}
\newbibmacro*{stackexchangesite}{%
\printfield{sitetopic}}
\DeclareBibliographyDriver{stackexchange}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{stackexchangequestion}%
\newunit\newblock
\usebibmacro{stackexchangeask}%
\newunit\newblock
\usebibmacro{stackexchangeans}%
\newunit\newblock
\usebibmacro{stackexchangesite}%
\newunit\newblock
\usebibmacro{finentry}}
\begin{document}
\nocite{*}
\cite{se:l3help}
\printbibliography
\end{document}
@jurisdiction
,@legislation
and@legal
might be appropriate (check thebiblatex
docs for their intended meaning), but the standard styles all treat them as@misc
. So the types are there, but work is probably needed to get them to look like you want.