電流輸出

電流輸出

一年前,@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 註腳中的無頭引用和文本引用

這裡無頭引用:。

在註腳中。

與textcite.2

有文字引用,但沒有頁碼。

2 同上的問題拋出

重複引用4

使用 textcite.5 重複引用

重複引用 textcite 但沒有頁碼。

其中腳註是:

  1. 沃曼,1.

  2. 沃曼 (, 1) 則不然。

  3. 沃曼()則不然。

  4. 同上,1。

  5. 沃曼 (, 1) 則不然。

  6. 沃曼()則不然。

所需輸出

1 註腳中的無頭引用和文本引用

這裡無頭引用:Woman。

在註腳中。

與textcite.2

有文字引用,但沒有頁碼。

2 同上的問題拋出

重複引用4

使用 textcite.5 重複引用

重複引用 textcite 但沒有頁碼。

其中腳註是:

  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}

輸出

相關內容