biblatex:为什么找不到我自己的.bbx 文件?

biblatex:为什么找不到我自己的.bbx 文件?

在 LaTeX 源文件的目录和我的本地texmf树(即~/Library/texmf/tex/latex/biblatex/bbx)中我放置了以下.bbx文件:

\ProvidesFile{mybooknumeric.bbx}
%[\abx@bbxid]
\RequireBibliographyStyle{standard}
\RequireBibliographyStyle{numeric}
%
\DeclareBibliographyOption[boolean]{dashed}[true]{%
  \ifstrequal{#1}{true}
    {\ExecuteBibliographyOptions{pagetracker}%
     \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@lasthash}}}
    {\renewbibmacro*{bbx:savehash}{}}}
%
\newbibmacro*{bbx:savehash}{%
  \savefield{fullhash}{\bbx@lasthash}}

这样做的目的只是为了用水平线代替具有相同作者的后续书目条目的作者姓名。

但是当我处理我的源代码(例如下面的源代码)时,出现错误:

(/usr/local/texlive/2016/texmf-dist/tex/latex/biblatex/biblatex.def)(./mybooknumeric.bbx(/usr/local/texlive/2016/texmf-dist/tex/latex/biblatex/bbx/standard.bbx)(/usr/local/texlive/2016/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx))

/usr/local/texlive/2016/texmf-dist/tex/latex/biblatex/biblatex.sty:13002:Packa ge biblatex 错误:未找到样式“mybooknumeric”。...

l.13002 \RequireCitationStyle{\blx@cbxfile}

怎么了?

来源:

\documentclass[12pt]{memoir}

\usepackage[style=mybooknumeric,backend=bibtex,,dashed=true]{biblatex}

\begin{filecontents}{euler.bib}
@article{EulerE1776,
    Author = {Euler, Leonhard},Title = {All about E},
    Journal = {Math.\ Psychol.},
    Year = {1776},Volume = {4},number={1},
    pages={1--2718}
}
@article{EulerE1748,
    Author = {Euler, Leonhard},Title = {My formula},
    Journal = {Math.\ Formulas},
    Year = {1748},Volume = {4},
    pages={233--234}
}
\end{filecontents}

\addbibresource{euler.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

答案1

biblatex的‘加载时’选项包括(biblatex版本 3.5,§3.1.1):

style=<file>                                             default: numeric 
Loads the bibliography style file .bbx and the citation style file .cbx.
See § 3.3 for an overview of the standard styles.

bibstyle=<file>                                           default: numeric
Loads the bibliography style file .bbx. See § 3.3.2 for an overview of the
standard bibliography styles.

citestyle=<file>                                          default: numeric
Loads the citation style file .cbx. See § 3.3.1 for an overview of the
standard citation styles.

因此,如果您使用style=mybooknumericbiblatex将尝试同时查找mybooknumeric.bbxmybooknumeric.cbx。 在您的例子中,它设法找到了前者,但无法(显然)找到后者。

biblatex因此您可能希望按以下方式加载:

% strictly speaking, naming the `citestyle` is not needed 
% if you want the 'numeric' style
\usepackage[bibstyle=mybooknumeric, citestyle=numeric, backend=bibtex, dashed=true]{biblatex}

... 或创建一个mybooknumeric.cbx

相关内容