biblatex 意外出现粗体

biblatex 意外出现粗体

biblatex出乎意料的是,当我使用withbibtex作为后端并使用基于 and 的自定义 biblatex 样式时,我得到了某些术语 - “版本”、“卷”、“编号”、“编辑”和“和”(最后一个表示多位作者standardnumeric

bibtex令人惊讶的是,这种情况只是最近才发生的,这表明、biblatexstandard和风格已经发生了一些变化numeric

来源.tex

\documentclass[12pt]{article}

\RequirePackage[strict=true]{csquotes}

\RequirePackage[backend=bibtex,%
    bibstyle=mybooknumeric,citestyle=numeric,dashed=true,defernumbers=true,
    urldate=edtf,date=edtf]%
    {biblatex} 

\usepackage{hyperref}
\hypersetup{hyperindex,colorlinks, citecolor=red} 

\begin{filecontents}{references.bib}
@book{Apostol1969vol2,
Author = {Apostol, Tom M.},
Edition = {2},
Maintitle = {Calculus},
Publisher = {Wiley},
Subtitle = {Multi-Variable Calculus and Linear Algebra with Applications to Differential Equations and Probability},
Title = {Calculus},
Volume = {2},
Year = {1969},
keywords={main}
}   
@Book{Bernays1991,
     title     = {Axiomatic Set Theory},
     publisher = {Dover},
     year      = {1991},
     author    = {Bernays, Paul},
     address   = {New York},
     edition   = {2},
     addendum  = {republication of 2 ed., North-Holland, 1958},
     location  = {New York},
     keywords={main}
}
@article{Archimedes200,
  author = {Archimedes},
  title = {Pi's the limit },
  journal = {Syracuse J. Gastronom.\ Math.}, 
  year = {200BCE},volume = {10},number={3},
  pages={\textsc{cccxv}--\textsc{cccxvii}},
  keywords={main}
}   
@article{EulerE1776,
    Author = {Euler, Leonhard},Title = {All about E},
    Journal = {Math.\ Psychol.},
    Year = {1776},Volume = {4},number={1},
    pages={1--2718},
    keywords={main}
  } 
@article{EulerE1748,
   Author = {Euler, Leonhard},Title = {My formula},
   Journal = {Math.\ Formulas},
   Year = {1748},Volume = {4},
   pages={233--234},
   keywords={main}
}
@book{CantorEmptySet1895,
editor = {Cantor, Georg},
title = {Eintausend und eins S\"{a}tze \"{u}ber die Nullmenge},
publisher = {Springer},
year = {1895},
location = {Berlin},
keywords = {main}
}
@book{BourbakiSets1970,
  Author = {Bourbaki, Nicolas},
  Title = {Th{\'e}orie des ensembles},
  Year ={ 1970},
  Publisher ={ Hermann},
  location ={ Paris},
  keywords = {two}
}    
@book{RussellWhitehead1927Vol3,
  author = {Whitehead, Alfred North and Russell, Bertrand},
  title = {Principia Mathematica},
  edition = {2},
  year = {1927},
  publisher = {Cambridge Univ.\ Press},
  volume = {3},
  keywords = {main}
}    
\end{filecontents}

\addbibresource{references.bib}

\begin{document}

\nocite{*}

The ``Alephs'' are discussed in \textcite[Section 26]{RussellWhitehead1927Vol3}.

\printbibliography

\end{document}

输出:

参考书目中出现意外的粗体。

请注意,在具有多个作者的条目中,意外加粗的“and”也出现在该条目的引用中。

我的biblatex.cfg

% BIBLATEX.CFG
% mimic amsplain
\ProvidesFile{biblatex.cfg}

\DeclareNameAlias{sortname}{family-given}

% Allow better line splits in URLs:
\Urlmuskip=0mu plus 1mu minus 1mu

% Punctuation & delimiter mods:
\DeclareLanguageMapping{english}{mylanguagestrings} % external file!
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand{\subtitlepunct}{\addcolon\addspace}
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

% Field mods:
\renewcommand*{\bibnamedash}{\rule{3em}{0.4pt}\hskip 0.16667em plus 0.01em minus 0.01em\relax \addcomma}
%
\renewbibmacro*{addendum+pubstate}{%
  \setunit{\addsemicolon\space}%
  \printfield{addendum}%
  \newunit\newblock
  \printfield{pubstate}}
%
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{\mkbibemph{#1}}% no quote marks
  \DeclareFieldFormat{journaltitle}{#1}
%
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {volume}{\mkbibbold{#1}}  
\DeclareFieldFormat{pages}{#1}% no prefix for the `pages` field in the bibliography
%  
\DeclareFieldFormat{pages}{#1}% no prefix for the `pages` field

% URL mods:    
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}

% Book mods:    
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}

% Article mods:     
\DeclareFieldFormat[article,periodical]{number}{\bibstring{number}~#1}% number of a journal

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \printfield{volume}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcomma\space}%
  \printfield{number}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \setunit{\addcomma\space}%
  \printfield{eid}
  \newunit} 

我的自定义biblatex样式文件是~/Library/texmf/tex/latex/biblatex/bbx/mybooknumeric.bbx

\ProvidesFile{mybooknumeric.bbx}
%
\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}}

\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
  {\usebibmacro{bbx:dashcheck}
    {\bibnamedash}
    {\printnames{author}%
      \setunit{\addcomma\space}%
      \usebibmacro{bbx:savehash}}%
    \usebibmacro{authorstrg}}
  {\global\undef\bbx@lasthash}}

\newbibmacro*{bbx:dashcheck}[2]{%
  \ifboolexpr{
    test {\iffieldequals{fullhash}{\bbx@lasthash}}
    and
    not test \iffirstonpage
  }
  {#1}
  {#2}}

还有一个自定义的mylanguagestrings.lbx,它在我的本地 texmf 树中~/Library/texmf/tex/biblatex/lbx/mylanguagestrings.lbx(我不确定它是否会被使用):

\ProvidesFile{custom-english-ordinal-sscript.lbx}
%
\InheritBibliographyExtras{english}
%
\DeclareBibliographyExtras{%
  \protected\def\mkbibordinal#1{%
\begingroup%
 \@tempcnta0#1\relax\number\@tempcnta%%
    \endgroup}%
  \protected\def\mkbibmascord{\mkbibordinal}%
  \protected\def\mkbibfemord{\mkbibordinal}%
}
\DefineBibliographyStrings{english}{%
  urlseen =    {accessed},
}
\DefineBibliographyStrings{american}{%
  urlseen =    {accessed},
}
\endinput

答案1

当 Biblatex 无法找到字符串的值时,它会将字符串名称(内部名称)显示为粗体。由于字符串名称与值有些相似english,因此很难理解这种情况发生了什么。无论如何,这意味着 biblatex 找不到字符串的值。

就您而言,问题在于您正在使用个人.lbx文件,该文件与您的语言英语相关联,\DeclareLanguageMapping{english}{mylanguagestrings}但使用前导语法来重新定义一些字符串。

因此,您应该使用:

\DeclareBibliographyStrings{%
  inherit = {english},
  urlseen = {{accessed}{accessed}},
}

这将从 biblatex 中继承字符串english.lbx并(重新)定义以下字符串。请注意,我们不会在此处添加语言,语言由语言映射定义(因此english)。此外,与 的语法相反DefineBibliographyStringsDeclareBibliographyStrings您必须提供字符串的长格式和缩写格式。

因此,你可以将你的mylanguagestrings.lbxas 设置为:

\ProvidesFile{mylanguagestrings.lbx}
% with custom-english-ordinal-sscript
%
\InheritBibliographyExtras{english}
%
\DeclareBibliographyExtras{%
  \protected\def\mkbibordinal#1{%
\begingroup%
 \@tempcnta0#1\relax\number\@tempcnta%%
    \endgroup}%
  \protected\def\mkbibmascord{\mkbibordinal}%
  \protected\def\mkbibfemord{\mkbibordinal}%
}

\DeclareBibliographyStrings{%
  inherit = {english},
  urlseen = {{accessed}{accessed}},
}

\endinput

离题:您的代码发出了大量弃用命令警告,您应该查看这些警告。

相关内容