如何在 bbx 檔案中自訂 origdate?

如何在 bbx 檔案中自訂 origdate?

現在,它在 PDF 中看起來像這樣(“Ndr.”是“reprint”的德語縮寫):

克里斯蒂安·克拉赫特:費瑟蘭。 1995 年,Ndr。慕尼黑:Deutscher Taschenbuch Verlag 2012。

= author: title. origdate, address: publisher date.

我想看起來像這樣:

克里斯蒂安·克拉赫特:費瑟蘭。慕尼黑:Deutscher Taschenbuch Verlag 2012 [1995]。

= author: title. address: publisher date [origdate].

我想以相同的方式更改 .bib 檔案中的各種條目。 Origdate 應始終位於日期後面的括號中。

我發現下面的程式碼是 bbx 檔案(它基於authortitle-dw)定義輸出的部分。我該如何更改它才能像上面的範例一樣顯示原始日期?

  \renewbibmacro*{publisher+location+date}{%
\ifbool{bbx:origfields}
    {\ifbool{bbx:nolocation}
      {\iffieldundef{origyear}
        {\usebibmacro{loc+pub+year}}
        {\usebibmacro{origloc+origpub+origyear}}}
      {\iflistundef{origlocation}
        {\iffieldundef{origyear}
          {\usebibmacro{loc+pub+year}}
          {\usebibmacro{origloc+origpub+origyear}}}
        {\iffieldundef{origyear}
          {\blxdw@warning{%
             Field 'origlocation' is set, but 'origdate' is 
             \MessageBreak%
             empty at entry '\abx@field@entrykey'.
             The 'orig' fields \MessageBreak are omitted
             for this entry}%
           \usebibmacro{loc+pub+year}}
          {\usebibmacro{origloc+origpub+origyear}}}}}
    {\usebibmacro{loc+pub+year}}}

\newbibmacro{loc+pub+year}{%
  \ifbool{bbx:nolocation}
    {}
    {\printlist{location}%
     \ifbool{bbx:nopublisher}
       {\setunit*{\locationdatepunct}}%
       {\iflistundef{publisher}
         {\setunit*{\locationdatepunct}}
         {\setunit*{\locationpublisherpunct}%
          \printlist{publisher}%
          \setunit*{\publisherdatepunct}}}}%
  \ifbool{bbx:edsuper}
    {\printfield[edition:super]{edition}}
    {}%
  \usebibmacro{date}%
  \newunit}

\newbibmacro{origloc+origpub+origyear}{%
  \ifbool{bbx:nolocation}
    {}
    {\printlist{origlocation}%
     \ifbool{bbx:nopublisher}
       {\setunit*{\locationdatepunct}}%
       {\iflistundef{origpublisher}
         {\setunit*{\locationdatepunct}}
         {\setunit*{\locationpublisherpunct}%
          \printlist{origpublisher}%
          \setunit*{\publisherdatepunct}}}}%
  \ifbool{bbx:edsuper}
    {\printfield[edition:super]{edition}}
    {}%
  \usebibmacro{origdate}%
  \ifdefstring{\bbx@origfieldsformat}{punct}
    {\setunit*{\origfieldspunct}%
     \usebibmacro{origfields:loc+pub+year}}
    {\ifdefstring{\bbx@origfieldsformat}{parens}
      {\setunit*{\addspace}%
       \printtext[parens]{%
         \usebibmacro{origfields:loc+pub+year}}}
      {\ifdefstring{\bbx@origfieldsformat}{brackets}
        {\setunit*{\addspace}%
         \printtext[brackets]{%
           \usebibmacro{origfields:loc+pub+year}}}
        {\setunit*{\origfieldspunct}%
         \usebibmacro{origfields:loc+pub+year}}}}
  \newunit}

\newbibmacro{origfields:loc+pub+year}{%
  \bibstring{reprint}%
  \setunit{\addspace}%
  \ifbool{bbx:nolocation}
    {}
    {\printlist{location}%
     \ifbool{bbx:nopublisher}
       {\setunit*{\locationdatepunct}}%
       {\iflistundef{publisher}
         {\setunit*{\locationdatepunct}}
         {\setunit*{\locationpublisherpunct}%
          \printlist{publisher}%
          \setunit*{\publisherdatepunct}}}}%
  \usebibmacro{date}}

  \newbibmacro*{origdate}{\printorigdate}

這是 MWE:

\begin{filecontents*}{literature.bib}
    @book{kracht_faserland_2012,
        address = {München},
        title = {Faserland},
        publisher = {Deutscher Taschenbuch Verlag},
        author = {Kracht, Christian},
        date = {2012},
        origdate = {1995}
    }

\end{filecontents*}

\documentclass[twoside=false,fontsize=12pt,toc=bibliography,toc=listof]{scrbook}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[babel,german=guillemets]{csquotes}
\usepackage[backend=biber,style=authortitle-dw,series=afteryear,firstfull,nopublisher=false,sorting=nyt]{biblatex}
              \addbibresource{literature.bib}

\begin{document}

Dies ist ein Beispielsatz.\footnote{Vgl. \cite[76]{kracht_faserland_2012}.}

\backmatter
\printbibliography

\end{document}

答案1

這可能不是最優雅的解決方案,但它對我有用。您必須更改一些標點符號命令並更改元素的順序:

    \newbibmacro*{origdate}{\printorigdate}

\renewbibmacro*{publisher+location+date}{%
  \ifbool{bbx:origfields}
    {\ifbool{bbx:nolocation}
      {\iffieldundef{origyear}
        {\usebibmacro{loc+pub+year}}
        {\usebibmacro{origloc+origpub+origyear}}}
      {\iflistundef{origlocation}
        {\iffieldundef{origyear}
          {\usebibmacro{loc+pub+year}}
          {\usebibmacro{origloc+origpub+origyear}}}
        {\iffieldundef{origyear}
          {\blxdw@warning{%
             Field 'origlocation' is set, but 'origdate' is 
             \MessageBreak%
             empty at entry '\abx@field@entrykey'.
             The 'orig' fields \MessageBreak are omitted
             for this entry}%
           \usebibmacro{loc+pub+year}}
          {\usebibmacro{origloc+origpub+origyear}}}}}
    {\usebibmacro{loc+pub+year}}}

\newbibmacro{loc+pub+year}{%
  \ifbool{bbx:nolocation}
    {}
    {\printlist{location}%
   \ifbool{bbx:nopublisher}
       {\setunit*{\locationdatepunct}}%
       {\iflistundef{publisher}
         {\setunit*{\locationdatepunct}}
         {\setunit*{\locationpublisherpunct}%
          \printlist{publisher}%
           \setunit*{\addspace}}}}%
  \ifbool{bbx:edsuper}
    {\printfield[edition:super]{edition}}
    {}%
  \usebibmacro{date}%
  }

\newbibmacro{origloc+origpub+origyear}{%
  \ifbool{bbx:nolocation}
    {}
    {\printlist{origlocation}%
  \ifbool{bbx:nopublisher}
       {\setunit*{\locationdatepunct}}%
       {\iflistundef{origpublisher}
         {\setunit*{\locationdatepunct}}
         {\setunit*{\locationpublisherpunct}%
          \printlist{origpublisher}%
          \setunit*{\addspace}}}}%
  \ifdefstring{\bbx@origfieldsformat}{punct}
    {\setunit*{\origfieldspunct}%
     \usebibmacro{loc+pub+year}}
    {\ifdefstring{\bbx@origfieldsformat}{parens}
      {\setunit*{\addspace}%
       \printtext[parens]{%
         \usebibmacro{loc+pub+year}}}
      {\ifdefstring{\bbx@origfieldsformat}{brackets}
        {\setunit*{\addspace}%
         \printtext[brackets]{%
           \usebibmacro{loc+pub+year}}}
        {\setunit*{\origfieldspunct}%
         \usebibmacro{loc+pub+year}}}}
         \usebibmacro{origdate}%
  \newunit}

相關內容