註釋中的第二次引用會導致額外的句號

註釋中的第二次引用會導致額外的句號

如果我有一個 note= 本身包含一個 \cite,那麼第二個 \cite 有一個前導句點「.」。

例如,在下面的輸出中,我得到Another sentence.[. 2],但我期望Another sentence.[2]

[1]
References
[1] A sentence.[2] Another sentence.[. 2] Yet another sentence[2]
[2] An Author. “A Title”. In: ().

這是一個螢幕截圖:

輸出顯示“.2”而不是“2”

這是一個 MWE:

\documentclass{article}
\usepackage{biblatex}
\addbibresource{\jobname.bib}

\begin{filecontents}{\jobname.bib}
@misc{AFootnote,
  note={A sentence.\cite{AnArticle}
    Another sentence.\cite{AnArticle}
    Yet another sentence.\cite{AnArticle}\nopunct}
}

@article{AnArticle,
author={An Author},
title={A Title},
}
\end{filecontents}

\begin{document}

\cite{AFootnote}

\printbibliography

\end{document}

為了編譯該範例,我使用:

        pdflatex book
        biber book
        pdflatex book
        biber book
        pdflatex book
        pdflatex book

我在 macOS 下運行這些版本的 biber 和 pdflatex:

bash-3.2$ biber --version
biber version: 2.19
bash-3.2$ pdflatex --version
pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023)
kpathsea version 6.3.5
Copyright 2023 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.39; using libpng 1.6.39
Compiled with zlib 1.2.13; using zlib 1.2.13
Compiled with xpdf version 4.04
bash-3.2$ 

是的,我意識到這很奇怪。潛在的出版商更喜歡在每章末尾混合腳註和參考文獻,因此對於腳註,我使用帶有註釋的雜項。一些腳註本身引用了其他來源。奇怪的是,第二個引文具有領先的句點。使用 \supercite 會產生類似前導「.」的結果。

答案1

這基本上是同樣的問題https://github.com/plk/biblatex/issues/988biblatex: \parencite 在註解欄位中印出虛假;採用authoryear-icomp 風格(也biblatex: \DeclareCiteCommand 在 \printfield 和 \printnames 之間加上分號,但只是有時):在參考書目上下文中,biblatex不會自動重置\...cite指令的標點符號緩衝區。這允許命令直接與參考書目巨集和其他在參考書目中生成文本的代碼\...cite一起使用,但是當存在不是由其本身生成的文本和標點符號(如字段的實際內容)時,它的工作效果就不是特別好。biblatexbiblatex

連結中討論了其他一些解決方案,但對於您的用例,@misc本質上始終是正常的腳註,我可能會告訴biblatex不要假設note此類條目的 位於參考書目中。

\documentclass{article}
\usepackage{biblatex}

\DeclareFieldFormat[misc]{note}{%
  \togglefalse{blx@bibliography}%
  #1%
}

\begin{filecontents}{\jobname.bib}
@misc{AFootnote,
  note = {A sentence.\cite{AnArticle}
          Another sentence.\cite{AnArticle}
          Yet another sentence.\cite{AnArticle}\nopunct},
}
@article{AnArticle,
  author = {An Author},
  title  = {A Title},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\cite{AFootnote}

\printbibliography
\end{document}

[1] 一句話。又一句話。又一句話。 [2] 一位作者。 「一個標題」。在: ()。


請注意,有notes2bib包裹它允許您使用更像普通\footnote命令的介面將腳註發送到參考書目。特別是,您不必手動將腳註寫入文件.bib(讓我們面對現實,它們在語義上並不真正屬於 - 在內部,該包與您所做的相同,但它對最終用戶隱藏了它) )。該套件在大多數“正常”情況下不會遇到相同的問題,因為它為“腳註”定義了專用驅動程序,在列印註釋之前不使用標點符號緩衝區。

\documentclass{article}
\usepackage[backend=biber, style=numeric, sorting=none,]{biblatex}
\usepackage{notes2bib}

\begin{filecontents}{\jobname.bib}
@article{AnArticle,
  author = {An Author},
  title  = {A Title},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\bibnote{A sentence.\cite{AnArticle}
          Another sentence.\cite{AnArticle}
          Yet another sentence.\cite{AnArticle}}

\printbibliography
\end{document}

[1] 一句話。又一句話。還有一句話。 [2] 一位作者。 「一個標題」。在: ()。

如果您確實需要類似的修復notes2bib,您可以使用

\DeclareFieldFormat[bibnote]{note}{%
  \togglefalse{blx@bibliography}%
  #1%
}

相關內容