如何定制 Historische-Zeitschrift 风格的 \footcite 命令?

如何定制 Historische-Zeitschrift 风格的 \footcite 命令?

我正在尝试自定义\footcite命令历史杂志风格这样我就可以使用特殊的引用类型。

这是我需要的:

  1. 当我在自定义字段中有一个包含某些内容的书目条目usera并且我使用时\footcite,我的引用需要如下所示:

    参见亚他那修·亚历山大 (Athanasius Alexandrinus),Epistula ad Marcellinum de interpretatione psalmorum,载于:PG 27,S.56。

  2. 当我\footcite在此之后第二次对同一条目使用时,它需要生成:

    参见 ebd.,第 22 节。

  3. \footcite当我第三次对同一条目但在文本的其他地方使用时,它需要生成:

    参见 Ath.,第 Marcell 集(Wie Anm. 1),第 56 页。

  4. 如果该字段中没有任何内容,则需要使用默认引用。它看起来像这样:

    参见 Iustinus Martyr、Iustini Martyris dialogus cum Tryphone,载于:Miroslav Marcovich (Hrsg.)。屋宇署47. (Patrologiae cursus completus:希腊系列)柏林/纽约 1997 年,第 22 页。

现在,我设法得到了所有这些,除了一件事,我不知道为什么会发生这种情况。你可以在这张图片上看到我在说什么:

在此处输入图片描述

因此,数字 2 所在的位置应为 1。它指向的不是第一次引用该条目的原始脚注,而是最后一次重复的条目。

有人能帮我解决这个问题吗?提前感谢您的回答!

这是我的 MWE:

\documentclass[a4paper,11pt]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage{csquotes}
\usepackage{blindtext}
\usepackage{filecontents}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
     citecolor=black,
     filecolor=black,
     linkcolor=black,
     urlcolor=black
}
\begin{filecontents}{\jobname.bib} 
@incollection{athanasius1857,
        Address = {Parisiis},
        Author = {{Athanasius Alexandrinus}},
        Booktitle = {Patrologiae cursus completus: Series Graeca},
        Editor = {Jacques Paul Migne},
        Pages = {37-40},
        Usera = {PG},
        Publisher = {Accurante J.-P. Migne},
        Shortauthor = {Ath.},
        Shorttitle = {ep. Marcell.},
        Title = {Epistula ad Marcellinum de interpretatione psalmorum},
        Volume = {27},
        Year = {1857}}
 @incollection{iustinus1997,
        Address = {Berlin/New York},
        Author = {{Iustinus Martyr}},
        Title = {Iustini Martyris dialogus cum Tryphone},
        Editor = {Miroslav Marcovich},
        Publisher = {Walter de Gruyter},
        Series = {Patrologiae cursus completus: Series Graeca},
        Shortauthor = {Iust.},
        Shorttitle = {De Tryph.},
        Volume = {47},
        Year = {1997}}
\end{filecontents}
\usepackage[ngerman]{babel}
\usepackage[style=historische-zeitschrift, maxnames=2, hyperref=true, backref=true, backrefstyle=none, backend=bibtex,idemtracker=true]{biblatex}
\bibliography{\jobname}
%
\makeatletter
\renewbibmacro*{footcite}{%
  \global\boolfalse{cbx@loccit}%
  \global\boolfalse{cbx@seenote}% NEW!
  \ifciteseen
    {\iffieldundef{shorthand}
       {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
          {\usebibmacro{footcite:ibid}}
          {\usebibmacro{footcite:note}}}
       {\usebibmacro{footcite:shorthand}}}
       {\iffieldundef{usera}
         {\usebibmacro{footcite:full}}{\printnames{author}%
       \setunit{\addcomma\space}%
       \printfield{title}\isdot%
         {\setunit{\addcomma\space}%
          \usebibmacro{in:}%
          \printfield{usera}%
          \setunit*{\addspace}%
          \printfield[default]{volume}}}}
     \usebibmacro{footcite:save}}
\makeatother
%
\begin{document}
\blindtext\footcite[See][S. 56]{athanasius1857}
\blindtext\footcite[See][S. 22]{athanasius1857}
\blindtext\footcite[See][S. 22]{iustinus1997}
\blindtext\footcite[See][S. 56]{athanasius1857}
\printbibliography

\end{document}

答案1

由于historische-zeitschrift样式比较老旧(2016 年进行了更新,以处理Biblatex 3.3 名称格式),我决定尝试重新创建它。我使用的基本样式是verbose-inote

括号中的相关行seenote

\renewbibmacro*{footcite:note}{%
  \ifnameundef{labelname}
    {\printfield{label}}
    {\printnames{labelname}}%
  \ifsingletitle
    {}
    {\setunit*{\nametitledelim}%
     \printfield[title]{labeltitle}}%
  %\setunit*{\addcomma\space}%
  \setunit*{\addspace}%<--- this line ...
  \printtext[parens]{%<---- ... and this line
    \bibstring{seenote}\addnbspace
    \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
    \iftoggle{cbx:pageref}
      {\ifsamepage{\the\value{instcount}}{\csuse{cbx@f@\thefield{entrykey}}}
        {}
        {\addcomma\space\bibstring{page}\addnbspace
         \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
      {}}}

名称格式由(答案已被编辑以使用新的名称格式,请参阅旧格式的历史记录)处理。

\DeclareNameAlias{sortname}{given-family-emph}

\DeclareNameFormat{labelname}{%
  \mkbibemph{%
    \ifcase\value{uniquename}%
      \usebibmacro{name:family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}%
    \or
      \ifuseprefix
        {\usebibmacro{name:given-family}
          {\namepartfamily}
          {\namepartgiveni}
          {\namepartprefix}
          {\namepartsuffixi}}
        {\usebibmacro{name:given-family}
          {\namepartfamily}
          {\namepartgiveni}
          {\namepartprefixi}
          {\namepartsuffixi}}%
    \or
      \usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}%
    \fi
    \usebibmacro{name:andothers}}}

\DeclareNameFormat{given-family-emph}{%
  \mkbibemph{%
    \ifgiveninits
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefix}
        {\namepartsuffix}}
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}}%
    \usebibmacro{name:andothers}}}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{editor}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editorstrg}%
     \clearname{editor}}
    {}}
\renewbibmacro*{editor+others}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}

标题等只是纯文本,没有强调、引号等。

\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{citetitle}{#1}
\DeclareFieldFormat*{booktitle}{#1\isdot}
\DeclareFieldFormat*{journaltitle}{#1\isdot}
\DeclareFieldFormat*{issuetitle}{#1\isdot}
\DeclareFieldFormat*{maintitle}{#1\isdot}

有些字段不显示

\newcommand{\clearunecfields}{%
  \clearlist{language}%
  \clearlist{publisher}%
  \clearfield{pagetotal}%
  \iffieldequalstr{edition}{1}
    {\clearfield{edition}}
    {}%
}
\AtEveryBibitem{\clearunecfields}
\AtEveryCitekey{\clearunecfields}

(单位)分隔符

%\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\subtitlepunct}{\addperiod\space}
\renewcommand*{\labelnamepunct}{\addcomma\space}
\renewcommand*{\multilistdelim}{\addslash}
\renewcommand*{\finallistdelim}{\multilistdelim}
\renewcommand*{\multinamedelim}{\multilistdelim}
\renewcommand*{\finalnamedelim}{\multinamedelim}
\renewbibmacro*{in:}{%
  \setunit{\addcomma\space}%
  \printtext{\bibstring{in}\intitlepunct}}

日期、地点、出版商的位置调整

\renewbibmacro*{issue+date}{%
  \setunit{\addcomma\space}%
  \iffieldundef{issue}
    {\usebibmacro{date}}
    {\printfield{issue}%
     \setunit*{\addspace}%
     \usebibmacro{date}}%
  \newunit}
\renewbibmacro*{location+date}{%
  \printlist{location}%
  \setunit{\addspace}%
  \usebibmacro{date}%
  \newunit}
\newbibmacro*{pio+location+date}[1]{%
  \printlist{location}%
  \setunit{\addcomma\space}%
  \printlist{#1}%
  \setunit{\addspace}%
  \usebibmacro{date}%
  \newunit}
\renewbibmacro*{publisher+location+date}{\usebibmacro{pio+location+date}{publisher}}
\renewbibmacro*{institution+location+date}{\usebibmacro{pio+location+date}{institution}}
\renewbibmacro*{organization+location+date}{\usebibmacro{pio+location+date}{organization}}
\DeclareFieldFormat{pages}{#1}

系列和编号应显示在条目末尾的括号中

\renewbibmacro*{series+number}{%
  \iffieldundef{series}
    {}
    {\printtext[parens]{%
        \printfield{series}%
        \setunit*{\addspace}%
        \printfield{number}%
        \newunit\newblock}
      \nopunct}}

@in...条目的其他编辑器格式

\xpatchbibdriver{incollection}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }
  {\usebibmacro{in:}%
   \usebibmacro{byeditor+others}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock}%
  {}{}

\xpatchbibdriver{inbook}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{byeditor+others}
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}}%
  {}{}

\renewbibmacro*{byeditor+others}{%
  \ifboolexpr{
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}%
    {}}

最后,引用命令被修补以包括使用正确的作者姓名格式

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\renewbibmacro*{footcite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

平均能量损失

\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst}
\documentclass[12pt,ngerman,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{filecontents}
\usepackage{xpatch}
\usepackage[style=verbose-inote,backend=biber,maxnames=999]{biblatex}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
@book{schramm,
  author    = {Percy Ernst Schramm},
  title     = {Hamburg, Deutschland und die Welt},
  subtitle  = {Leistungen und Grenzen hanseatischen Bürgertums in der Zeit zwischen Napoleon I. und Bismarck},
  edition   = {2},
  location  = {Hamburg},
  publisher = {Hoffmann \& Campe},
  date      = {1952},
}
@book{hanham,
  author    = {Harold John Hanham},
  title     = {Elections and Party Management},
  subtitle  = {Politics in the Age of Disraeli and Gladstone},
  location  = {London},
  date      = {1959},
  publisher = {Longman},
}
@book{BlackEley,
  author    = {David Blackbourn and Geoff Eley},
  title     = {Mythen deutscher Geschichtsschreibung},
  subtitle  = {Die gescheiterte bürgerliche Revolution von 1848},
  location  = {Frankfurt am Main and Berlin and Wien},
  date      = {1980},
  publisher = {Ullstein},
}
@book{Lutz,
  author    = {Heinrich Lutz},
  title     = {Reformation und Gegenreformation},
  location  = {Frankfurt am Main and Berlin and Wien},
  date      = {1982},
  publisher = {Oldenbourg Wissenschaftsverlag},
  edition   = {2},
  location  = {München and Wien},
  series    = {Oldenbourg Grundriß der Geschichte},
  number    = {10},
  pagetotal = {251},
}
@article{zorn,
  author    = {Wolfgang Zorn},
  title     = {Wirtschafts- und sozialgeschichtliche Zusammenhänge der deutschen Reichsgründung (1850–1879)},
  journal   = {HZ},
  volume    = {197},
  date      = {1963},
  pages     = {318–34},
}
@collection{schieder,
  editor    = {Theodor Schieder},
  title     = {Beiträge zur britischen Geschichte im 20. Jahrhundert},
  location  = {München},
  date      = {1983},
  series    = {Historische Zeitschrift, Beihefte},
  number    = {8},
  edition   = {1},
}
@incollection{alter,
  author    = {Peter Alter},
  title     = {Der britische Generalstreik von 1926 als politische Wende},
  pages     = {89–116},
  crossref  = {schieder},
}
@phdthesis{lacher,
  author   = {Hugo Lacher},
  title    = {Politischer Katholizismus und kleindeutsche Reichsgründung},
  subtitle = {Eine Studie zur politischen Ideenwelt im deutschen Katholizismus},
  location = {Mainz},
  date     = {1963},
}
\end{filecontents*}
\DeclareNameAlias{sortname}{given-family-emph}

\DeclareNameFormat{labelname}{%
  \mkbibemph{%
    \ifcase\value{uniquename}%
      \usebibmacro{name:family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}%
    \or
      \ifuseprefix
        {\usebibmacro{name:given-family}
          {\namepartfamily}
          {\namepartgiveni}
          {\namepartprefix}
          {\namepartsuffixi}}
        {\usebibmacro{name:given-family}
          {\namepartfamily}
          {\namepartgiveni}
          {\namepartprefixi}
          {\namepartsuffixi}}%
    \or
      \usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}%
    \fi
    \usebibmacro{name:andothers}}}

\DeclareNameFormat{given-family-emph}{%
  \mkbibemph{%
    \ifgiveninits
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefix}
        {\namepartsuffix}}
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}}%
    \usebibmacro{name:andothers}}}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{editor}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editorstrg}%
     \clearname{editor}}
    {}}
\renewbibmacro*{editor+others}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{citetitle}{#1}
\DeclareFieldFormat*{booktitle}{#1\isdot}
\DeclareFieldFormat*{journaltitle}{#1\isdot}
\DeclareFieldFormat*{issuetitle}{#1\isdot}
\DeclareFieldFormat*{maintitle}{#1\isdot}
\newcommand{\clearunecfields}{%
  \clearlist{language}%
  \clearlist{publisher}%
  \clearfield{pagetotal}%
  \iffieldequalstr{edition}{1}
    {\clearfield{edition}}
    {}%
}
\AtEveryBibitem{\clearunecfields}
\AtEveryCitekey{\clearunecfields}
%\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\subtitlepunct}{\addperiod\space}
\renewcommand*{\labelnamepunct}{\addcomma\space}
\renewcommand*{\multilistdelim}{\addslash}
\renewcommand*{\finallistdelim}{\multilistdelim}
\renewcommand*{\multinamedelim}{\multilistdelim}
\renewcommand*{\finalnamedelim}{\multinamedelim}
\renewbibmacro*{in:}{%
  \setunit{\addcomma\space}%
  \printtext{\bibstring{in}\intitlepunct}}
\renewbibmacro*{issue+date}{%
  \setunit{\addcomma\space}%
  \iffieldundef{issue}
    {\usebibmacro{date}}
    {\printfield{issue}%
     \setunit*{\addspace}%
     \usebibmacro{date}}%
  \newunit}
\renewbibmacro*{location+date}{%
  \printlist{location}%
  \setunit{\addspace}%
  \usebibmacro{date}%
  \newunit}
\newbibmacro*{pio+location+date}[1]{%
  \printlist{location}%
  \setunit{\addcomma\space}%
  \printlist{#1}%
  \setunit{\addspace}%
  \usebibmacro{date}%
  \newunit}
\renewbibmacro*{publisher+location+date}{\usebibmacro{pio+location+date}{publisher}}
\renewbibmacro*{institution+location+date}{\usebibmacro{pio+location+date}{institution}}
\renewbibmacro*{organization+location+date}{\usebibmacro{pio+location+date}{organization}}
\DeclareFieldFormat{pages}{#1}
\renewbibmacro*{series+number}{%
  \iffieldundef{series}
    {}
    {\printtext[parens]{%
        \printfield{series}%
        \setunit*{\addspace}%
        \printfield{number}%
        \newunit\newblock}
      \nopunct}}

\xpatchbibdriver{incollection}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }
  {\usebibmacro{in:}%
   \usebibmacro{byeditor+others}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock}%
  {}{}

\xpatchbibdriver{inbook}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{byeditor+others}
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}}%
  {}{}

\renewbibmacro*{byeditor+others}{%
  \ifboolexpr{
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}%
    {}}

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\renewbibmacro*{footcite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\renewbibmacro*{footcite:note}{%
  \ifnameundef{labelname}
    {\printfield{label}}
    {\printnames{labelname}}%
  \ifsingletitle
    {}
    {\setunit*{\nametitledelim}%
     \printfield[title]{labeltitle}}%
  %\setunit*{\addcomma\space}%
  \setunit*{\addspace}%
  \printtext[parens]{%
    \bibstring{seenote}\addnbspace
    \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
    \iftoggle{cbx:pageref}
      {\ifsamepage{\the\value{instcount}}{\csuse{cbx@f@\thefield{entrykey}}}
        {}
        {\addcomma\space\bibstring{page}\addnbspace
         \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
      {}}}

\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
  Lorem\footcite{Lutz} ipsum\footcite{Lutz} dolor\footcite{zorn} sit\footcite{Lutz}.

  Lorem\footcite{Lutz} ipsum\footcite[7]{Lutz} dolor\footcite[see][12]{zorn} sit\footcite[9]{Lutz}.
  \printbibliography
\end{document}

在此处输入图片描述

相关内容