在 biblatex 中獲得真正裸露的數字引用

在 biblatex 中獲得真正裸露的數字引用

我終於屈服並轉向 biblatex,至少對我的論文來說是這樣。我使用的是上標數字參考樣式,效果很好。然而,有時能夠說「數據取自參考文獻 1」之類的內容會很有用。如果我使用cite{some_ref},我會得到“...來自參考文獻 [1]”。這是根據手冊設計的,但我有在 bibtex 中這樣做的一個好方法——那我該如何複製這個呢?

另外(我懷疑答案會相關)我的參考書目列出了方括號中的引用編號。

我開始希望我一直使用 bibtex - 與切換中間文件的麻煩相比,使用 biblatex 的好處似乎很小。

答案1

你可能想嘗試

\DeclareFieldFormat{labelnumberwidth}{#1}
\DeclareFieldFormat{shorthandwidth}{#1}

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\cites}{\cite}{\multicitedelim}

在你的序言中。

前兩個指令確保參考書目中的數字周圍沒有括號。雖然第二個區塊從\cite{}(及其多引用版本\cites{}\parencite{}但仍然有括號)中去除了括號。

\documentclass[english]{article}  
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=numeric, backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{labelnumberwidth}{#1}
\DeclareFieldFormat{shorthandwidth}{#1}

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\cites}{\cite}{\multicitedelim}

\begin{document}
  See \cite{wilde} as noted before\supercite{wilde}.
  \printbibliography
\end{document}

產生

在此輸入影像描述


由於OP似乎使用了numeric-comp,因此解決方法是

\DeclareCiteCommand{\cite}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

而不是\cite上面的重新定義。

因為numeric-verb它是

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

相關內容