![如何在 biblatex 中上标或下标引用](https://linux22.com/image/382904/%E5%A6%82%E4%BD%95%E5%9C%A8%20biblatex%20%E4%B8%AD%E4%B8%8A%E6%A0%87%E6%88%96%E4%B8%8B%E6%A0%87%E5%BC%95%E7%94%A8.png)
我使用以下命令biblatex
\usepackage[backend=biber,bibstyle=ieee,citestyle=numeric-comp,sorting=none,labeldateparts,maxbibnames=99,maxcitenames=2,mincitenames=1]{biblatex}
你能告诉我如何在文中上标或下标引用吗?
答案1
对于上标引用,有\supercite
(针对所有标准样式定义numeric
)。
没有\subcite
下标引用(我从未见过),但它可以作为的直接改编来实现\supercite
。请记住,的定义\supercite
取决于样式,因此下面的代码仅适用于(cite)style=numeric-comp
。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, bibstyle=ieee, citestyle=numeric-comp,
sorting=none, labeldateparts,
maxbibnames=99, maxcitenames=2, mincitenames=1]{biblatex}
\newrobustcmd{\mkbibsubscript}[1]{%
\unspace\allowhyphens\textsubscript{%
\begingroup
\protected\long\def\mkbibsuperscript##1{%
\blx@warning{Nested superscript}%
\mkbibbrackets{##1}}%
#1\endgroup}}
\DeclareCiteCommand{\subcite}[\mkbibsubscript]
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}
{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}
{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem\supercite{sigfridsson} ipsum\supercite{worman}
dolor\supercite{sigfridsson}
Lorem\subcite{sigfridsson} ipsum\subcite{geer}
dolor\supercite{sigfridsson}
\printbibliography
\end{document}