用于 printbibliography 转发参数的新命令

用于 printbibliography 转发参数的新命令

我有类似的事情

\printbibliography[heading=subbibintoc,resetnumbers=true,subtype={somelable},   title ={Nice Titlel}]

然后我注意到链接不起作用,不得不

\phantomsection\printbibliography[heading=subbibintoc,resetnumbers=true,subtype={somelable},   title ={Nice Title}]

那甚至更大。

我可以为此提供一个更简短的命令吗?

\myprntbib[subtype={somelable},title ={Nice Title}]

答案1

对于\printbibliography以下应该工作

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=numeric, defernumbers, backend=biber]{biblatex}
\usepackage{hyperref}

\newcommand*{\myprntbib}[1][]{%
  \phantomsection
  \printbibliography[heading=subbibintoc, resetnumbers=true, #1]}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{appleby,
  author  = {Humphrey Appleby},
  title   = {On the Importance of the Civil Service},
  date    = {1980},
  entrysubtype = {somelable},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{appleby}
\myprntbib[subtype={somelable}, title ={Nice Title}]
\end{document}

相关内容