![平均能量损失](https://linux22.com/image/478356/%E5%B9%B3%E5%9D%87%E8%83%BD%E9%87%8F%E6%8D%9F%E5%A4%B1.png)
我使用 biblatex 和 authoryear-ibid 样式进行内联引用,因此与哈佛引用样式有些接近。我也可以出于相同目的使用 philosophy-classic 或 -modern 样式(虽然我不知道它们是否也使用 ibid,但我希望如此)
问题:我有一本带有简写的 mvbook,我想引用它。引用时,我希望输出省略逗号和“vol.”,因此它应该如下所示:
EXP 3, p. 5
同时,如果不进行调整,输出如下所示:
EXP, vol. 3, p.5
梅威瑟:
\documentclass{article}
\usepackage[style=authoryear-ibid]{biblatex}
\begin{filecontents*}{example.bib}
@mvbook{exampl,
date = {2000},
author = {Examplus, Iannus},
title = {Lorem Ipsum},
shorthand = {EXP}
}
\end{filecontents*}
\addbibresource{example.bib}
\begin{document}
\volcite{2}[5]{exampl}
\end{document}
不幸的是,这里的相关问题使用了 biblatex-chicago,它们的解决方案似乎包含了一些我使用的样式未提供的内容,而我还没有找到如何使它们适应我的情况。
答案1
试试这个,主要取自https://github.com/plk/biblatex/issues/868。
biblatex 3.13
一旦发布,大部分代码就不再需要。但仍是必需的biblatex 3.12
。
平均能量损失
\documentclass{article}
\usepackage[style=authoryear-ibid]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@mvbook{exampl,
date = {2000},
author = {Examplus, Iannus},
title = {Lorem Ipsum},
shorthand = {EXP}
}
@mvbook{test,
date = {2019},
author = {Author, An},
title = {Some Title}
}
\end{filecontents}
\addbibresource{\jobname.bib}
% Work arounds not needed from biblatex 3.13
\makeatletter
\newtoggle{blx@volcite}
\protected\def\ifvolcite{%
\iftoggle{blx@volcite}}
\DeclareDelimFormat{postnotedelim}{\addcomma\space}
\renewbibmacro*{postnote}{%
\iffieldundef{postnote}
{}
{\setunit{\printdelim{postnotedelim}}%
\printfield{postnote}}}
\renewrobustcmd*{\volcitecmd}{%
\AtNextCite{%
\DeclareFieldAlias{postnote}{volcitenote}%
\toggletrue{blx@volcite}}%
\begingroup\let\blx@citeargs\blx@volciteargs}
\long\def\blx@volciteargs@i#1[#2]#3{%
\def\abx@field@volcitevolume{#3}%
\undef\abx@field@volcitepages
\eappto\blx@tempe{%
\def\noexpand\abx@field@volcitevolume{#3}%
\undef\noexpand\abx@field@volcitepages}%
\@ifnextchar[%]
{\blx@volciteargs@ii{#1}{#2}{#3}}
{\blx@citeargs@iii{#1{#2}{{#3}{}}}}}
\long\def\blx@volciteargs@ii#1#2#3[#4]{%
\def\abx@field@volcitepages{#4}%
\eappto\blx@tempe{\def\noexpand\abx@field@volcitepages{#4}}%
\blx@citeargs@iii{#1{#2}{{#3}{#4}}}}
\renewrobustcmd*{\multivolcitecmd}{%
\AtNextCite{%
\DeclareFieldAlias{postnote}{volcitenote}%
\toggletrue{blx@volcite}}%
\def\blx@hook@mcite@before{%
\global\undef\blx@hook@mcite@before
\let\blx@citeargs\blx@volmciteargs}}
\makeatother
% user level changes
\DeclareDelimFormat[shorthandvolcite]{postnotedelim}{\addspace}
\DeclareFieldFormat{volcitevolume}{%
\iffieldundef{shorthand}
{\bibstring{volume}\ppspace#1}
{#1}}
\renewbibmacro*{cite:shorthand}{%
\ifvolcite
{\delimcontext{shorthandvolcite}}
{}%
\printtext[bibhyperlink]{\printfield{shorthand}}}
\begin{document}
\volcite{2}[5]{exampl}
\volcite{2}{exampl}
\cite[5]{exampl}
\volcite{2}[5]{test}
\volcite{2}{test}
\cite[5]{test}
\volcites{2}[5]{exampl}{2}[5]{test}
\volcites{2}{exampl}{2}{test}
\cites[5]{exampl}[5]{test}
\end{document}