1

I've been using the biblatex-dw citation style with footnotes and several improvements to it. My question is: how can I generate footnotes from the @incollection entry so that the translator is put directly after the title of the article, not after the book title?

Below there is an example of my preamble:

\documentclass[a4paper,12pt,pdftex]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,french,polish]{babel}
\usepackage{csquotes}
\DeclareQuoteAlias{croatian}{polish}

\usepackage[
style=footnote-dw,
autopunct=false,
sorting=nty,
abbreviate = true,
idembibformat = dash,
nopublisher = false,
pageref = false,
backend=biber]{biblatex}

\renewcommand*{\newunitpunct}{\addcomma\space}
\renewbibmacro*{in:}{}

\renewcommand{\multinamedelim}{\addcomma\space}

\DeclareFieldFormat{title}{\mkbibemph{#1}}
\DeclareFieldFormat{booktitle}{\mkbibemph{#1}}
\DeclareFieldFormat{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[article,periodical]{volume}{\bibstring{jourvol}~#1}% volume of a journal
\DeclareFieldFormat[article,periodical]{number}{nr~#1}% number of a journal

\newbibmacro*{in:}{%
    \ifentrytype{article}
    {}
    {\printtext[brackets]{%
            \bibstring{in}\addcolon}\space}}

\renewbibmacro*{volume+number+eid}{%
    \printfield{volume}%
    \setunit{\addcomma\space}%
    \printfield{number}%
    \setunit{\addcomma\space}%
    \printfield{eid}}

\renewbibmacro*{journal+issuetitle}{%
    \usebibmacro{journal}%
    \setunit*{\addspace}%
    \iffieldundef{series}
    {}
    {\newunit
        \printfield{series}%
        \setunit{\addspace}}%
    \usebibmacro{issue+date}%
    \setunit{\addcomma\space}%
    \usebibmacro{volume+number+eid}%
    \setunit{\addcolon\space}%
    \usebibmacro{issue}%
    \newunit}

\renewbibmacro*{issue+date}{%
    \printfield{issue}%
    \setunit*{\addspace}%
    \usebibmacro{date}%
    \newunit}

\addbibresource{thesis.bib}

\begin{document}
Tytuł dokumentu\cite{jameson_postmodernizm_1996}.

\printbibliography
\end{document}

And the .bib file:

@incollection{jameson_postmodernizm_1996,
    location = {Kraków},
    title = {Postmodernizm i społeczeństwo konsumpcyjne},
    booktitle = {Postmodernizm. Antologia przekładów},
    publisher = {Wydawnictwo Baran i Suszczyński},
    author = {Jameson, Fredric},
    editor = {Nycz, Ryszard},
    translator = {Czapliński, Przemysław},
    date = {1996}

This is the following output: enter image description here

How can I edit the bbx or cbx files so that the translator field would be before the book title (the translation refers only to one article in a collection)?

enter image description here

  • The translator and editor of an @incollection refer to the enclosing work (the booktitle) and not to the title, so it is only natural that they should appear after the booktitle and not directly after the title. In tex.stackexchange.com/q/216369/35864 there is a s solution for a new intranslator that would be printed after the title. – moewe May 9 '18 at 5:28
1

This is similar to Why is the biblatex option "useeditor=true" ignored for book articles?. The problem is that translator and editor refer to booktitle in @in... works and not to title. You can introduce the new names ineditor and instranslator that refer to the title. It requires a bit of machinery, but gets you there in the end

\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,french,polish]{babel}
\usepackage{csquotes}

%\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{jameson_postmodernizm_1996,
  location     = {Kraków},
  title        = {Postmodernizm i społeczeństwo konsumpcyjne},
  booktitle    = {Postmodernizm. Antologia przekładów},
  publisher    = {Wydawnictwo Baran i Suszczyński},
  author       = {Jameson, Fredric},
  editor       = {Nycz, Ryszard},
  intranslator = {Czapliński, Przemysław},
  date         = {1996},
}
\end{filecontents}
\begin{filecontents}{innames.dbx}
\ProvidesFile{innames.dbx}[2018/05/09 more names for @in types]
\RequireBiber[3]
% new translator etc. fields for "inner" work, that is translator of title (not booktitle) in @in...
\DeclareDatamodelFields[type=list,datatype=name]{ineditor, ineditora, ineditorb, ineditorc, intranslator, intranslator, inannotator, incommentator, inintroduction, inforeword, inafterword}
\DeclareDatamodelEntryfields[inbook,incollection,inproceedings,inreference]{ineditor, ineditora, ineditorb, ineditorc, intranslator, inannotator, incommentator, inintroduction, inforeword, inafterword}
\end{filecontents}

\usepackage[
  backend=biber,
  datamodel=innames,
  style=footnote-dw,
  autopunct=false,
  sorting=nty,
  abbreviate = true,
  idembibformat = dash,
  nopublisher = false,
  pageref = false,
]{biblatex}

\makeatletter
\newbibmacro*{ineditorstrg}{%
  \printtext[ineditortype]{%
    \iffieldundef{ineditortype}
      {\ifboolexpr{
         test {\ifnumgreater{\value{ineditor}}{1}}
         or
         test {\ifandothers{ineditor}}
       }
         {\bibstring{editors}}
         {\bibstring{editor}}}
      {\ifbibxstring{\thefield{ineditortype}}
         {\ifboolexpr{
            test {\ifnumgreater{\value{ineditor}}{1}}
            or
            test {\ifandothers{ineditor}}
          }
            {\bibstring{\thefield{ineditortype}s}}
            {\bibstring{\thefield{ineditortype}}}}
         {\thefield{ineditortype}}}}}

\newbibmacro*{ineditor+othersstrg}{%
  \iffieldundef{ineditortype}
    {\ifboolexpr{
       test {\ifnumgreater{\value{ineditor}}{1}}
       or
       test {\ifandothers{ineditor}}
     }
       {\def\abx@tempa{editors}}
       {\def\abx@tempa{editor}}}
    {\ifboolexpr{
       test {\ifnumgreater{\value{ineditor}}{1}}
       or
       test {\ifandothers{ineditor}}
     }
       {\edef\abx@tempa{\thefield{ineditortype}s}}
       {\edef\abx@tempa{\thefield{ineditortype}}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{ineditor}{intranslator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{intranslator}}}
    {}%
  \ifnamesequal{ineditor}{incommentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{incommentator}}}
    {\ifnamesequal{ineditor}{inannotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{inannotator}}}
       {}}%
  \ifnamesequal{ineditor}{inintroduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{inintroduction}}}
    {\ifnamesequal{ineditor}{inforeword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{inforeword}}}
       {\ifnamesequal{ineditor}{inafterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{inafterword}}}
          {}}}%
  \ifbibxstring{\abx@tempa}
    {\printtext[ineditortype]{\bibstring{\abx@tempa}}\abx@tempb}
    {\usebibmacro{ineditorstrg}}}

\newbibmacro*{intranslatorstrg}{%
  \printtext[intranslatortype]{%
    \ifboolexpr{
      test {\ifnumgreater{\value{intranslator}}{1}}
      or
      test {\ifandothers{intranslator}}
    }
      {\bibstring{translators}}
      {\bibstring{translator}}}}

\newbibmacro*{intranslator+othersstrg}{%
  \ifboolexpr{
    test {\ifnumgreater{\value{intranslator}}{1}}
    or
    test {\ifandothers{intranslator}}
  }
    {\def\abx@tempa{translators}}
    {\def\abx@tempa{translator}}%
  \ifnamesequal{intranslator}{incommentator}
    {\appto\abx@tempa{co}%
     \clearname{incommentator}}
    {\ifnamesequal{intranslator}{inannotator}
       {\appto\abx@tempa{an}%
        \clearname{inannotator}}
       {}}%
  \ifnamesequal{intranslator}{inintroduction}
    {\appto\abx@tempa{in}%
     \clearname{inintroduction}}
    {\ifnamesequal{intranslator}{inforeword}
       {\appto\abx@tempa{fo}%
        \clearname{inforeword}}
       {\ifnamesequal{intranslator}{inafterword}
          {\appto\abx@tempa{af}%
           \clearname{inafterword}}
          {}}}%
  \bibstring{\abx@tempa}}


\newbibmacro*{ineditor+others}{%
  \ifboolexpr{
    test \ifuseineditor
    and
    not test {\ifnameundef{ineditor}}
  }
    {\printnames{ineditor}%
     \setunit{\addcomma\space}%
     \usebibmacro{ineditor+othersstrg}%
     \clearname{ineditor}}
    {}}

\newbibmacro*{intranslator+others}{%
  \ifboolexpr{
    test \ifuseintranslator
    and
    not test {\ifnameundef{intranslator}}
  }
    {\printnames{intranslator}%
     \setunit{\addcomma\space}%
     \usebibmacro{intranslator+othersstrg}%
     \clearname{intranslator}}
    {}}

\newbibmacro*{author/ineditor+others/intranslator+others}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{author}}
    {\ifboolexpr{
       test \ifuseineditor
       and
       not test {\ifnameundef{ineditor}}
     }
       {\usebibmacro{ineditor+others}}
       {\usebibmacro{intranslator+others}}}}

\newbibmacro*{byineditor}{%
  \ifnameundef{ineditor}
    {}
    {\usebibmacro{bytypestrg}{ineditor}{editor}%
     \setunit{\addspace}%
     \printnames[byineditor]{ineditor}%
     \newunit}%
  \usebibmacro{byineditorx}}

\newbibmacro*{byineditorx}{%
  \ifnameundef{ineditora}
    {}
    {\usebibmacro{bytypestrg}{ineditora}{editor}%
     \setunit{\addspace}%
     \printnames[byineditora]{ineditora}%
     \newunit}%
  \ifnameundef{ineditorb}
    {}
    {\usebibmacro{bytypestrg}{ineditorb}{editor}%
     \setunit{\addspace}%
     \printnames[byineditorb]{ineditorb}%
     \newunit}%
  \ifnameundef{ineditorc}
    {}
    {\usebibmacro{bytypestrg}{ineditorc}{editor}%
     \setunit{\addspace}%
     \printnames[byineditorc]{ineditorc}%
     \newunit}}

\newbibmacro*{byintranslator}{%
  \ifnameundef{intranslator}
    {}
    {\bibstring{bytranslator}%
     \setunit{\addspace}%
     \printnames[byintranslator]{intranslator}}}

\newbibmacro*{byineditor+others}{%
  \ifnameundef{ineditor}
    {}
    {\usebibmacro{byineditor+othersstrg}%
     \setunit{\addspace}%
     \printnames[byineditor]{ineditor}%
     \clearname{ineditor}%
     \newunit}%
  \usebibmacro{byineditorx}%
  \usebibmacro{byintranslator+others}}

\newbibmacro*{byintranslator+others}{%
  \ifnameundef{intranslator}
    {}
    {\usebibmacro{byintranslator+othersstrg}%
     \setunit{\addspace}%
     \printnames[byintranslator]{intranslator}%
     \clearname{intranslator}%
     \newunit}}

\newbibmacro*{byineditor+othersstrg}{%
  \iffieldundef{ineditortype}
    {\def\abx@tempa{byeditor}}
    {\edef\abx@tempa{by\thefield{ineditortype}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{ineditor}{intranslator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{intranslator}}}
    {}%
  \ifnamesequal{ineditor}{incommentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{incommentator}}}
    {\ifnamesequal{ineditor}{inannotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{inannotator}}}
       {}}%
  \ifnamesequal{ineditor}{inintroduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{inintroduction}}}
    {\ifnamesequal{ineditor}{inforeword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{inforeword}}}
       {\ifnamesequal{ineditor}{inafterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{inafterword}}}
          {}}}%
  \ifbibxstring{\abx@tempa}
    {\printtext{\bibstring{\abx@tempa}}\abx@tempb}
    {\usebibmacro{bytypestrg}{ineditor}{editor}}}

\newbibmacro*{byintranslator+othersstrg}{%
  \def\abx@tempa{bytranslator}%
  \ifnamesequal{intranslator}{incommentator}
    {\appto\abx@tempa{co}%
     \clearname{incommentator}}
    {\ifnamesequal{intranslator}{inannotator}
       {\appto\abx@tempa{an}%
        \clearname{inannotator}}
       {}}%
  \ifnamesequal{intranslator}{inintroduction}
    {\appto\abx@tempa{in}%
     \clearname{inintroduction}}
    {\ifnamesequal{intranslator}{inforeword}
       {\appto\abx@tempa{fo}%
        \clearname{foreword}}
       {\ifnamesequal{intranslator}{inafterword}
          {\appto\abx@tempa{af}%
           \clearname{afterword}}
          {}}}%
  \bibstring{\abx@tempa}}
\makeatother

\renewbibmacro*{author/translator+others}{\usebibmacro{author/ineditor+others/intranslator+others}} %% this is an ad hoc for this particular application

\renewcommand*{\newunitpunct}{\addcomma\space}
\renewbibmacro*{in:}{}

\renewcommand{\multinamedelim}{\addcomma\space}

\DeclareFieldFormat{title}{\mkbibemph{#1}}
\DeclareFieldFormat{booktitle}{\mkbibemph{#1}}
\DeclareFieldFormat{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[article,periodical]{volume}{\bibstring{jourvol}~#1}% volume of a journal
\DeclareFieldFormat[article,periodical]{number}{nr~#1}% number of a journal

\usepackage{xpatch}
\xpatchbibdriver{incollection}
  {\usebibmacro{byauthor}}
  {\usebibmacro{byauthor}%
   \newunit
   \usebibmacro{byineditor+others}}
  {}{}

\renewbibmacro*{in:}{%
  \ifentrytype{article}
    {}
    {\printtext[brackets]{%
       \bibstring{in}\addcolon}\space}}

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit{\addcomma\space}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{issue+date}%
  \setunit{\addcomma\space}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

\renewbibmacro*{issue+date}{%
  \printfield{issue}%
  \setunit*{\addspace}%
  \usebibmacro{date}%
  \newunit}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
Tytuł dokumentu\cite{jameson_postmodernizm_1996}.

\printbibliography
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.