删除 oscola biblatex 中 ibid 后的逗号

删除 oscola biblatex 中 ibid 后的逗号

如果这个问题在其他地方被问到,我深表歉意——到目前为止我还没有找到合适的答案。(此外,我对 Latex 和这个社区还很陌生,因此对任何不当之处深表歉意)。

我在用着oscola biblatex到目前为止非常高兴。我遇到的一个问题是逗号放在同上. 正确的同上oscola 中的引用应为:同上 4. 有时我会得到这个;有时逗号错误地插入在后面同上我也不知道为什么。

下面是我得到的结果的一个例子:

示例截图同上引文

(在第二个和后续的句子中添加逗号的模式同上引用并不总是重复——在另一份文件中,第一个同上ref 有时也包含逗号。)

以下是产生这些结果的 MWE:

\documentclass[12pt]{article}
\usepackage[style=oscola]{biblatex}
\addbibresource{test.bib}

\begin{document}

Reference 1.\autocite{godziak} 

Ibid reference.\autocite[1]{godziak}

Ibid reference.\autocite[2]{godziak} 

Reference 2.\autocite{home}

Ibid reference.\autocite[2]{home}

Ibid reference.\autocite[3]{home} 

Ibid reference.\autocite[45]{home}

\end{document}

编辑:我使用以下方法重新创建了错误biblatex-examples.bib

\documentclass[12pt]{article}
\usepackage[style=oscola]{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}

    Reference 1.\autocite{companion} 

    Ibid reference.\autocite[1]{companion}

    Ibid reference.\autocite[2]{companion} 

    Reference 2.\autocite{knuth:ct}

    Ibid reference.\autocite[2]{knuth:ct}

    Ibid reference.\autocite[3]{knuth:ct} 

    Ibid reference.\autocite[45]{knuth:ct}

\end{document}

编辑:我在这里添加了它,test.bib以防它仍然有用。

@report{godziak,
title = {Data and Research on Human Trafficking: Bibliography of Research-Based Literature},
author = {Godziak, Elzbieta M. and Bump, Michah N.},
date = {2008-09}
}

@report{home,
title = {Setting the {{Boundaries}}: {{Reforming}} the law on sex offences, {{Volume}} 1},
timestamp = {2015-11-05T14:26:44Z},
author = {{Home Office}},
date = {2000-07},
}

答案1

有一些非常复杂的代码可以正确处理后注。似乎在非常特殊的情况下,为该任务设置的代码会“溢出”到下一个脚注。使用

\makeatletter
\AtEveryCitekey{\bbx@resetpostnotedelim}
\makeatother

以避免这种情况。

如果要删除“ibid”后面的逗号,需要\bbx@unsetpostnotedelim添加footcite:ibid

\makeatletter
\renewbibmacro*{footcite:ibid}{%
  \ifboolexpr{ ( test {\iffieldundef{userc}} 
                 or test {\iffieldundef{postnote}}) 
               and not 
                 test{\iffieldequals{entrysubtype}{\subtypecourtrules}} }%
  {\printtext[bibhyperlink]{\iftoggle{bbx@capibid}{}{\midsentence}\bibstring{ibidem}}%
  \ifloccit
    {\global\toggletrue{cbx:loccit}}
    {}%
   \bbx@unsetpostnotedelim}
  {\usebibmacro{cite:refonlyfull}}}
\makeatother

相关内容