在 phys 样式中启用虚线选项

在 phys 样式中启用虚线选项

我是新来的,抱歉,格式可能有错误:)

我目前正在使用此biblatex设置。

 \documentclass{article}
 \usepackage[backend=bibtex,
citestyle=alphabetic,
bibstyle=phys,
natbib=true]{biblatex}

\bibliography{references.bib}

\usepackage{filecontents}

\begin{filecontents}{\references.bib}
@article{np30,
title={{China Sea Pilot, Vol. 1}},
author={{United Kingdom Hydrographic Office [UKHO]}},
journal={\textit{Admiralty Sailing Directions 30} 8th ed. (2010)},
}

@article{np31,
title={{China Sea Pilot, Vol. 2}},
author={{United Kingdom Hydrographic Office [UKHO]}},
journal={\textit{Admiralty Sailing Directions 31} 9th ed. (2010)},
}
\end{filecontents}

\begin{document}

\printbibliography
\nocite{*}

\end{document}

但是,此样式不支持该dashed选项。有什么办法可以解决这个问题吗?

答案1

可以添加与样式相同的代码ieee

\makeatletter
% Support for dashed author name replacement
\InitializeBibliographyStyle{\global\undef\bbx@lasthash}

\newbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@lasthash}}

% Bibliography macros
\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {%
      \iffieldequals{fullhash}{\bbx@lasthash}
        {\bibnamedash\addcomma\space}
        {\printnames{author}}%
      \usebibmacro{bbx:savehash}%  
      \iffieldundef{authortype}
        {}
        {%
          \setunit{\addcomma\space}%
          \usebibmacro{authorstrg}%
        }%
    }
    {\global\undef\bbx@lasthash}%
}
\makeatother

这将启用破折号。

相关内容