使用 \DefineBibliographyStrings (未定义)?

使用 \DefineBibliographyStrings (未定义)?

如果我尝试编译这个MWE:

\documentclass{article}
\usepackage{biblatex}
\DefineBibliographyStrings{english}{%
  teststring      = {Test string},
}
\begin{document}
\parbox{2pt}{\hspace*{1pt}Testing my statement}
\end{document}

...失败了:

! Package keyval Error: teststring undefined.

See the keyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \begin{document}

为什么?我认为这\DefineBibliographyStrings可以很好地定义teststring?我做错了什么?

答案1

\DefineBibliographyStrings存储定义已知语言的字符串。如果要声明一个全新的字符串,必须先声明它:

\documentclass{article}
\usepackage{biblatex}
\NewBibliographyString{teststring}
\DefineBibliographyStrings{english}{%
  teststring      = {Test string},
}
\begin{document}
\parbox{2pt}{\hspace*{1pt}Testing my statement}
\end{document}

相关内容