1

With the great help of @moewe, i was able to set up a custom biblatex style and since I'll have to create some more, I thought I'd give it a try while I still remember what to do :D

So my main challenge now is to get name datatype to be printed. I am not sure why, however the printing of my custom fields producer and director are omitted, while it works perfectly fine to print the predefined organization.

The second challenge is setting up a condition. If there is no maintitle, I would like the volume to be printed differently (instead of between the maintitle and title, after the title).

So instead of this: enter image description here

the first part should then look like this: enter image description here

This is my current MWE:

% arara: lualatex: { shell: true, synctex: true }
% arara: biber
% arara: lualatex: { shell: true, synctex: true }
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@video{help,
  maintitle       = {Terasu Hausu},
  date           = {2012-02-26},
  year           = {2012},
  maintitleaddon  = {Terrace House},
  titleaddon = {Boys and Girls In The City},
  title    = {Boisu},
  volume = {2},
  seriesseason = {3},
  episode = {12},
  duration = {54 Minuten},
  director = {Maeda, Masato},
  producer = {Matsumoto, Ayaka and Peters, Greg},
  format = {Video On Demand},
  type = {TV-Mini-Series},
  fsk = {12},
  urldate        = {2019-07-21},
  url            = {https://www.netflix.com/title/80212301},
  organization   = {Netflix}
}

@video{helpshort,
  date           = {2012-02-26},
  year           = {2012},
  titleaddon = {Boys and Girls In The City},
  title    = {Boisu},
  volume = {2},
  seriesseason = {3},
  episode = {12},
  duration = {54 Minuten},
  director = {Maeda, Masato},
  producer = {Matsumoto, Ayaka and Peters, Greg},
  format = {Video On Demand},
  type = {TV-Mini-Series},
  fsk = {12},
  urldate        = {2019-07-21},
  url            = {https://www.netflix.com/title/80212301},
  organization   = {Netflix}
}
\end{filecontents*}
\begin{filecontents}{customstyles.dbx}
\DeclareDatamodelEntrytypes{video}
\DeclareDatamodelFields[type=field,datatype=literal]{
  duration,
  format,
  type,
}
\DeclareDatamodelFields[type=list,datatype=name]{
  director,
  producer,
}
\DeclareDatamodelFields[type=field, datatype=verbatim]{
  fsk,
  seriesseason,
  episode,
}
\DeclareDatamodelEntryfields[video]{
  duration,
  director,
  episode,
  format,
  fsk,
  producer,
  seriesseason,
  type,
}
\end{filecontents}
\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\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=customstyles,
  maxnames=25,
  innamebeforetitle=true,
  usetranslator=true,
  alldates=terse,
  labeldate=year,
  dashed=false,
  isbn=false
]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}

  \DeclareLabeltitle[video]{%
  \field{maintitle}
  \field{shorttitle}
  \field{title}
 } 

\begin{filecontents*}{custombibstring-ngerman.lbx}
\ProvidesFile{custombibstring-ngerman.lbx}[2019/07/26]
\InheritBibliographyExtras{ngerman}
\DeclareBibliographyStrings{%
  inherit      = {ngerman},
  andothers    = {{et al\adddot}{et al\adddot}},
  byeditor     = {{herausgegeben von}{hg\adddotspace von}},
  editor       = {{Herausgeber}{Hg\adddot}},
  editors      = {{Herausgeber}{Hg\adddot}},
  urlseen      = {{letzter Abruf}{letzter Abruf}},
  duration = {{Spieldauer}{Spieldauer}},
  seriesseason = {{Staffel}{Staffel}},
  episode = {{Episode}{Episode}},
  director = {{unter der Regie von}{unter der Regie von}},
  producer = {{produziert von}{produziert von}},
  fsk = {{FSK}{FSK}},
  volume = {{Vol\adddot}{Vol\adddot}}
}
\end{filecontents*}

\NewBibliographyString{director,duration,episode,format,fsk,producer,seriesseason}
\DeclareLanguageMapping{ngerman}{custombibstring-ngerman}

\renewcommand*{\titleaddonpunct}{\addspace}
\DeclareFieldFormat{titleaddon}{\mkbibbrackets{#1}}
\DeclareFieldAlias{booktitleaddon}{titleaddon}
\DeclareFieldAlias{maintitleaddon}{titleaddon}
\DeclareFieldAlias{subtitleaddon}{titleaddon}

\DeclareFieldFormat[video]{title}{\textit{#1}\isdot}
\DeclareFieldFormat[video]{subtitle}{\textit{#1}\isdot}
\DeclareFieldFormat[video]{date}{\mkbibparens{#1}}
\DeclareFieldFormat[video]{volume}{\bibstring{volume}~#1}
\DeclareFieldFormat[video]{duration}{\bibstring{duration}~#1}
\DeclareFieldFormat[video]{format}{\mkbibparens{#1}}
\DeclareFieldFormat[video]{fsk}{\bibstring{fsk}~#1}
\DeclareFieldFormat[video]{seriesseason}{{#1}\adddot~\bibstring{seriesseason}}
\DeclareFieldFormat[video]{episode}{{#1}\adddot~\bibstring{episode}}
\DeclareListWrapperFormat[video]{organization}{\textsc{#1}}
\DeclareListWrapperFormat[video]{director}{\bibstring{director}\addcolon{\textsc{#1}}}
\DeclareListWrapperFormat[video]{producer}{\bibstring{producer}\addcolon{\textsc{#1}}}

\newbibmacro*{titles}{%
  \printfield{maintitle}%
   \setunit*{\titleaddonpunct}%
  \printfield{maintitleaddon}
  \newunit{\addspace}%
   \printfield{volume}%
  \setunit*{\addcolon\addspace} 
  \printfield{title}%
  \setunit*{\titleaddonpunct}%
  \printfield{titleaddon}
  \setunit{\addspace}%
  \printdate
}  

\newbibmacro*{format}{%  
  \printlist{organization}%
  \setunit*{\addcolon\addspace}%
  \printfield{type}%
  \setunit*{\titleaddonpunct}
   \printfield{format}%
}


\newbibmacro*{series}{%
  \printfield{seriesseason}%
  \setunit*{\addcomma\addspace}%
  \printfield{episode}%
  \setunit*{\addcolon\addspace}%
  \printlist{producer}%
  \setunit*{\adddot\addspace}%
  \printlist{director}%
  \setunit*{\addcolon\addspace}%
  \printfield{duration}%
  \setunit*{\addcomma\addspace}%
  \printfield{fsk}%
  \setunit*{\titleaddonpunct}
}

\urlstyle{same}%
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\addcolon\space#1}}


\DeclareBibliographyDriver{video}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{titles}%
  \newunit\newblock
  \usebibmacro{format}%
  \newunit\newblock
  \usebibmacro{series}%
  \newunit\newblock
  \usebibmacro{url+urldate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}
\begin{document}
\nocite{*}
\cite{help}

\cite{helpshort}
\printbibliography
\end{document}

Thank you!

1
  • For future questions it might be more appropriate to ask about the two challenges separately. Ideally each question should only be about one specific issue.
    – moewe
    Jul 27, 2019 at 15:49

1 Answer 1

1

Name lists are printed with the command \printnames (instead of \printlist or \printfield). So you need something like

\newbibmacro*{tvseries}{%
  \printfield{seriesseason}%
  \setunit*{\addcomma\addspace}%
  \printfield{episode}%
  \setunit*{\addcolon\addspace}%
  \printnames{producer}%
  \setunit*{\addperiod\addspace}%
  \printnames{director}%
  \setunit*{\addcolon\addspace}%
  \printfield{duration}%
  \setunit*{\addcomma\addspace}%
  \printfield{fsk}%
  \setunit*{\titleaddonpunct}%
}

For the second issue you'll want to use \iffieldundef.

\newbibmacro*{titles}{%
  \iffieldundef{maintitle}
    {}
    {\printfield{maintitle}%
     \setunit*{\titleaddonpunct}%
     \printfield{maintitleaddon}
     \newunit{\addspace}%
     \printfield{volume}%
     \setunit*{\addcolon\addspace}}%
  \printfield{title}%
  \setunit*{\titleaddonpunct}%
  \printfield{titleaddon}
  \iffieldundef{maintitle}
    {\setunit{\addspace}%
     \printfield{volume}}
    {}%
  \setunit{\addspace}%
  \printdate
}  

Note that there is a difference between \adddot (a dot for abbrevations) and \addperiod (a sentence-ending period, full stop).

In total

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@video{help,
  maintitle      = {Terasu Hausu},
  date           = {2012-02-26},
  year           = {2012},
  maintitleaddon = {Terrace House},
  titleaddon     = {Boys and Girls In The City},
  title          = {Boisu},
  volume         = {2},
  seriesseason   = {3},
  episode        = {12},
  duration       = {54 Minuten},
  director       = {Maeda, Masato},
  producer       = {Matsumoto, Ayaka and Peters, Greg},
  format         = {Video On Demand},
  type           = {TV-Mini-Series},
  fsk            = {12},
  urldate        = {2019-07-21},
  url            = {https://www.netflix.com/title/80212301},
  organization   = {Netflix},
}
@video{helpshort,
  date           = {2012-02-26},
  year           = {2012},
  titleaddon     = {Boys and Girls In The City},
  title          = {Boisu},
  volume         = {2},
  seriesseason   = {3},
  episode        = {12},
  duration       = {54 Minuten},
  director       = {Maeda, Masato},
  producer       = {Matsumoto, Ayaka and Peters, Greg},
  format         = {Video On Demand},
  type           = {TV-Mini-Series},
  fsk            = {12},
  urldate        = {2019-07-21},
  url            = {https://www.netflix.com/title/80212301},
  organization   = {Netflix},
}
\end{filecontents*}
\begin{filecontents}{customstyles.dbx}
\DeclareDatamodelEntrytypes{video}
\DeclareDatamodelFields[type=field,datatype=literal]{
  duration,
  format,
  type,
}
\DeclareDatamodelFields[type=list,datatype=name]{
  director,
  producer,
}
\DeclareDatamodelFields[type=field, datatype=verbatim]{
  fsk,
  seriesseason,
  episode,
}
\DeclareDatamodelEntryfields[video]{
  duration,
  director,
  episode,
  format,
  fsk,
  producer,
  seriesseason,
  type,
}
\end{filecontents}
\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\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=customstyles,
  maxnames=25,
  innamebeforetitle=true,
  usetranslator=true,
  alldates=terse,
  labeldate=year,
  dashed=false,
  isbn=false
]{biblatex}
\usepackage{hyperref}


  \DeclareLabeltitle[video]{%
  \field{maintitle}
  \field{shorttitle}
  \field{title}
 } 

\begin{filecontents*}{custombibstring-ngerman.lbx}
\ProvidesFile{custombibstring-ngerman.lbx}[2019/07/26]
\InheritBibliographyExtras{ngerman}
\DeclareBibliographyStrings{%
  inherit      = {ngerman},
  andothers    = {{et al\adddot}{et al\adddot}},
  byeditor     = {{herausgegeben von}{hg\adddotspace von}},
  editor       = {{Herausgeber}{Hg\adddot}},
  editors      = {{Herausgeber}{Hg\adddot}},
  urlseen      = {{letzter Abruf}{letzter Abruf}},
  duration     = {{Spieldauer}{Spieldauer}},
  seriesseason = {{Staffel}{Staffel}},
  episode      = {{Episode}{Episode}},
  bydirector   = {{unter der Regie von}{unter der Regie von}},
  byproducer   = {{produziert von}{produziert von}},
  fsk          = {{FSK}{FSK}},
  volume       = {{Vol\adddot}{Vol\adddot}},
}
\end{filecontents*}

\NewBibliographyString{bydirector,duration,episode,format,fsk,byproducer,seriesseason}
\DeclareLanguageMapping{ngerman}{custombibstring-ngerman}

\renewcommand*{\titleaddonpunct}{\addspace}
\DeclareFieldFormat{titleaddon}{\mkbibbrackets{#1}}
\DeclareFieldAlias{booktitleaddon}{titleaddon}
\DeclareFieldAlias{maintitleaddon}{titleaddon}
\DeclareFieldAlias{subtitleaddon}{titleaddon}

\DeclareFieldFormat[video]{title}{\textit{#1}\isdot}
\DeclareFieldFormat[video]{subtitle}{\textit{#1}\isdot}
\DeclareFieldFormat[video]{date}{\mkbibparens{#1}}
\DeclareFieldFormat[video]{volume}{\bibstring{volume}~#1}
\DeclareFieldFormat[video]{duration}{\bibstring{duration}~#1}
\DeclareFieldFormat[video]{format}{\mkbibparens{#1}}
\DeclareFieldFormat[video]{fsk}{\bibstring{fsk}~#1}
\DeclareFieldFormat[video]{seriesseason}{\mkbibordinal{#1}~\bibstring{seriesseason}}
\DeclareFieldFormat[video]{episode}{\mkbibordinal{#1}~\bibstring{episode}}
\DeclareListWrapperFormat[video]{organization}{\textsc{#1}}
\DeclareNameWrapperFormat[video]{director}{\bibstring{bydirector}\addspace#1}
\DeclareNameWrapperFormat[video]{producer}{\bibstring{byproducer}\addspace#1}

\newbibmacro*{titles}{%
  \iffieldundef{maintitle}
    {}
    {\printfield{maintitle}%
     \setunit*{\titleaddonpunct}%
     \printfield{maintitleaddon}
     \newunit{\addspace}%
     \printfield{volume}%
     \setunit*{\addcolon\addspace}}%
  \printfield{title}%
  \setunit*{\titleaddonpunct}%
  \printfield{titleaddon}
  \iffieldundef{maintitle}
    {\setunit{\addspace}%
     \printfield{volume}}
    {}%
  \setunit{\addspace}%
  \printdate
}  

\newbibmacro*{format}{%  
  \printlist{organization}%
  \setunit*{\addcolon\addspace}%
  \printfield{type}%
  \setunit*{\titleaddonpunct}%
  \printfield{format}%
}


\newbibmacro*{tvseries}{%
  \printfield{seriesseason}%
  \setunit*{\addcomma\addspace}%
  \printfield{episode}%
  \setunit*{\addcolon\addspace}%
  \printnames{producer}%
  \setunit*{\addperiod\addspace}%
  \printnames{director}%
  \setunit*{\addcolon\addspace}%
  \printfield{duration}%
  \setunit*{\addcomma\addspace}%
  \printfield{fsk}%
  \setunit*{\titleaddonpunct}%
}

\urlstyle{same}%
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\addcolon\space#1}}


\DeclareBibliographyDriver{video}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{titles}%
  \newunit\newblock
  \usebibmacro{format}%
  \newunit\newblock
  \usebibmacro{tvseries}%
  \newunit\newblock
  \usebibmacro{url+urldate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\cite{help}

\cite{helpshort}
\printbibliography
\end{document}

Terasu Hausu [Terrace House]. Vol. 2: Boisu [Boys and Girls In The City] (26.02.2012). Netflix: TV-Mini-Series (Video On Demand). 3. Staffel, 12. Episode: Produziert von Ayaka Matsumoto und Greg Peters. Unter der Regie von Masato Maeda: Spieldauer 54 Minuten, FSK 12. https://www.netflix.com/title/80212301 (letzter Abruf: 21.07.2019).//Boisu [Boys and Girls In The City] Vol. 2 (26.02.2012). Netflix: TV-Mini-Series (Video On Demand). 3. Staffel, 12. Episode: Produziert von Ayaka Matsumoto und Greg Peters. Unter der Regie von Masato Maeda: Spieldauer 54 Minuten, FSK 12. https://www.netflix.com/title/80212301 (letzter Abruf: 21.07.2019).

2
  • Thank you very much! Got it - I usually think multiple tickets might be considered annoying, but I guess, it's either for those who actually take the time and try to fix things :) So if I wanted the last name of producer and director to be set in smallcaps (just like author/editor e.g.), I should open a new ticket for that right? :)
    – user168390
    Jul 27, 2019 at 16:23
  • 1
    @user168390 In general yes. It's easier for those answering questions when they can focus on only one thing (and you don't scare away people who only know about one of the issues you ask about). It also makes the questions more relevant for other people with a similar problem, because the question and answers are focussed on one thing. Before you ask a new question, check out if \renewcommand*{\mkbibnamefamily}{\textsc} might be enough for you
    – moewe
    Jul 27, 2019 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .