电流输出

电流输出

一年前,@moewe想出了一个办法biblatex-chicago引用某参考文献时,如果该参考文献的作者仅在参考书目中出现,则仅使用作者的姓氏(无头衔)(即,仅引用该作者的一部作品)。

\headlesscite从那时起,我意识到这个解决方案在脚注中遇到了问题\textcite。有什么方法可以使输出(见下文)合理吗?

梅威瑟:

\documentclass{article}

\usepackage[%
    ibidtracker=true,
    notes, 
    singletitle, 
    short]{biblatex-chicago}
\addbibresource{biblatex-examples.bib}

\renewbibmacro*{cite:short}{%
  \usebibmacro{allshort+firstcite+xref}%
  \ifthenelse{\ifnameundef{labelname}\OR%
    \ifentrytype{inreference}\OR%
    \ifentrytype{reference}\OR%
    \ifentrytype{mvreference}}%
  {\ifthenelse{\iffieldequalstr{entrysubtype}{magazine}\AND\NOT%
      \ifentrytype{periodical}}% Simplify .bib creation
    {\ifuseauthor%
      {\ifboolexpr{%
          not test {\iffieldundef{shortjournal}}%
          and
          ((
          test {\ifcitation}%
          and
          togl {cms@citejtabb}%
          )
          or
          (
          test {\ifbibliography}%
          and
          togl {cms@bibjtabb}%
          ))
        }%
        {\printfield[shortjournal]{shortjournal}\newcunit}%
        {\printfield[journaltitle]{journaltitle}\newcunit}}%
      {}}%
    {\ifentrytype{manual}%
      {\printlist{organization}\isdot\newcunit}%
      {}}}%
  {\ifboolexpr{%
      test {\ifciteidem}%
      and
      not test {\ifbibliography}%
      and
      not test {\iffirstonpage}%
      and
      not togl {cms@noidem}%
      and
      not togl {cms@headlessnote}%
    }%
    {\bibstring[\mkibid]{idem\thefield{gender}}%
      \classicpunct}%
    {\iffieldequalstr{authortype}{anon}%
      {\bibleftbracket\printnames{labelname}%
        \bibrightbracket\classicpunct}%
      {\iffieldequalstr{authortype}{anon?}%
        {\bibleftbracket\printnames{labelname}?%
          \bibrightbracket\classicpunct}%
        {\printnames{labelname}%\usebibmacro{choose+labelname}%
          \isdot\classicpunct}}}}%
  \ifsingletitle
    {}
    {\ifboolexpr{%
       togl {cms@allshort}%
       or
       test {\ifbibliography}%
     }%
     {\printtext[bibhyperref]{%
       \printfield[citetitle]{labeltitle}}}%
     {\printtext[cmshyperlink]{%
       \printfield[citetitle]{labeltitle}}}}}%:\thefield{entrytype}?


\begin{document}


\section{headlesscite and textcite in footnotes}

Headlesscite here: \headlesscite{worman}.

\mancite

In a footnote.\footcite[1]{worman}

\mancite

With textcite.\footnote{\Textcite[1]{worman} says otherwise.}

\mancite

With textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\section{with ibid issues thrown in}

Repeated citation.\footcite[1]{worman}

Repeated citation with textcite.\footnote{\Textcite[1]{worman} says otherwise.}

Repeated citation with textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\end{document}

电流输出

1 脚注中的 headlesscite 和 textcite

Headlesscite 在这里:。

在脚注中。1

使用 textcite.2

有文本引用但没有页码。3

2 同上问题

重复引用。4

用 textcite.5 重复引用

重复引用文本但没有页码。6

脚注如下:

  1. 沃尔曼,1.

  2. Worman (,1) 则持不同意见。

  3. 沃曼()则持不同意见。

  4. 同上,1。

  5. Worman (,1) 则持不同意见。

  6. 沃曼()则持不同意见。

期望输出

1 脚注中的 headlesscite 和 textcite

Headlesscite 在这里:Worman。

在脚注中。1

使用 textcite.2

有文本引用但没有页码。3

2 同上问题

重复引用。4

用 textcite.5 重复引用

重复引用文本但没有页码。6

脚注如下:

  1. 沃尔曼,1.

  2. 沃曼(1)则持不同意见。

  3. 沃尔曼却持不同意见。

  4. 同上,1。

  5. 沃曼(1)则持不同意见。

  6. 沃尔曼却持不同意见。

答案1

我完全不确定这段代码是否能在所有情况下起作用,所以你应该非常仔细地测试。

但也许它提供了一个起点。

\documentclass{article}

\usepackage[%
    ibidtracker=true,
    notes, 
    singletitle, 
    short]{biblatex-chicago}
\addbibresource{biblatex-examples.bib}


% ------------------------------------------------------------------------------
% cite:short modified by moewe from https://tex.stackexchange.com/a/408916/87678
% ------------------------------------------------------------------------------

\renewbibmacro*{cite:short}{%
  \usebibmacro{allshort+firstcite+xref}%
  \ifthenelse{\ifnameundef{labelname}\OR%
    \ifentrytype{inreference}\OR%
    \ifentrytype{reference}\OR%
    \ifentrytype{mvreference}}%
  {\ifthenelse{\iffieldequalstr{entrysubtype}{magazine}\AND\NOT%
      \ifentrytype{periodical}}% Simplify .bib creation
    {\ifuseauthor%
      {\ifboolexpr{%
          not test {\iffieldundef{shortjournal}}%
          and
          ((
          test {\ifcitation}%
          and
          togl {cms@citejtabb}%
          )
          or
          (
          test {\ifbibliography}%
          and
          togl {cms@bibjtabb}%
          ))
        }%
        {\printfield[shortjournal]{shortjournal}\newcunit}%
        {\printfield[journaltitle]{journaltitle}\newcunit}}%
      {}}%
    {\ifentrytype{manual}%
      {\printlist{organization}\isdot\newcunit}%
      {}}}%
  {\ifboolexpr{%
      test {\ifciteidem}%
      and
      not test {\ifbibliography}%
      and
      not test {\iffirstonpage}%
      and
      not togl {cms@noidem}%
      and
      not togl {cms@headlessnote}%
    }%
    {\bibstring[\mkibid]{idem\thefield{gender}}%
      \classicpunct}%
    {\iffieldequalstr{authortype}{anon}%
      {\bibleftbracket\printnames{labelname}%
        \bibrightbracket\classicpunct}%
      {\iffieldequalstr{authortype}{anon?}%
        {\bibleftbracket\printnames{labelname}?%
          \bibrightbracket\classicpunct}%
        {\printnames{labelname}%\usebibmacro{choose+labelname}%
          \isdot\classicpunct}}}}%
  \ifsingletitle
    {}
    {\ifboolexpr{%
       togl {cms@allshort}%
       or
       test {\ifbibliography}%
     }%
     {\printtext[bibhyperref]{%
       \printfield[citetitle]{labeltitle}}}%
     {\printtext[cmshyperlink]{%
       \printfield[citetitle]{labeltitle}}}}}%:\thefield{entrytype}?


% ------------------------------
% Make \headlesscite more robust
% ------------------------------

\DeclareCiteCommand{\headlesscite}
  {\usebibmacro{hlcprenote}}
  {\usebibmacro{citeindex}%
    \toggletrue{cms@headlessnote}%
    \ifsingletitle
    {}
    {\usebibmacro{clear+labelname}%
     \clearname{labelname}}%
    \usebibmacro{cite}%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\headlessparencite}[\mkbibparens]
  {\usebibmacro{hlcprenote}}
  {\usebibmacro{citeindex}%
    \toggletrue{cms@headlessnote}%
    \ifsingletitle
    {}
    {\usebibmacro{clear+labelname}%
     \clearname{labelname}}%
    \usebibmacro{cite}%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\headlessparenshortcite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
    \ifboolexpr{%
      togl{cms@firstshort}%
      and
      not test {\iffieldundef{shorthand}}%
    }%
    {\usebibmacro{cite:shorthand}}%
    {\toggletrue{cms@headlessnote}%
      \toggletrue{cms@shortnote}%
      \togglefalse{cms@fullnote}%
      \ifsingletitle
      {}
      {\clearname{labelname}}%
      \usebibmacro{cite:short}}%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}


% ---------------------------------------
% Make \textcite in footnotes more robust
% ---------------------------------------

\renewcommand*{\postnotewrapper}{%
  \iftoggle{cms@modpostnote}%
  {\ifboolexpr{%
      test {\iffieldstart{postnote}{,}}%
      or
      test {\iffieldstart{postnote}{\bibrangessep}}%
    }%
    {\setunit{\addcomma}}% w/ or w/o \addspace?
    {\ifboolexpr{%
        test {\iffieldstart{postnote}{;}}%
        or
        test {\iffieldstart{postnote}{:}}%
        or
        test {\iffieldstart{postnote}{.}}%
      }%
      {}{\setunit{\postnotedelim}}}}%
  {\setunit{\postnotedelim}}}%

\renewcommand{\foottextcite}{%
  \headlessparenshortcite}

\renewcommand{\foottextcites}{%
  \headlessparenshortcites}

\DeclareCiteCommand{\headlessparenshortcite}
  {\ifboolexpr{
     test {\ifsingletitle}
     and
     test {\iffieldundef{postnote}}
   }
   {}
   {\addspace\bibopenparen}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
    \ifboolexpr{%
      togl{cms@firstshort}%
      and
      not test {\iffieldundef{shorthand}}%
    }%
    {\usebibmacro{cite:shorthand}}%
    {\toggletrue{cms@headlessnote}%
      \toggletrue{cms@shortnote}%
      \togglefalse{cms@fullnote}%
      \clearname{labelname}%
      \setunit{\addspace}%
      \usebibmacro{cite:short}%
    }%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\ifboolexpr{
     test {\ifsingletitle}
     and
     test {\iffieldundef{postnote}}
   }
   {\usebibmacro{cite:postnote}}
   {\usebibmacro{cite:postnote}%
    \bibcloseparen}}

\begin{document}

\null\vfill

\section{headlesscite and textcite in footnotes}

Headlesscite here: \headlesscite[1]{worman}.

\mancite

In a footnote.\footcite{worman}

\mancite

With textcite.\footnote{\Textcite[1]{worman} says otherwise.}

\mancite

With textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\section{with ibid issues thrown in}

Repeated citation.\footcite[1]{worman}

Repeated citation with textcite.\footnote{\Textcite[1]{worman} says otherwise.}

Repeated citation with textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\end{document}

输出

相关内容