(e)def 和 BibLaTeX

(e)def 和 BibLaTeX

我试图理解为什么以下代码不起作用:

\documentclass[12pt]{book}
\usepackage{polyglossia}
\setdefaultlanguage{french}
\setotherlanguage{english}
\def\col{\begin{english}:\end{english}}
\usepackage{filecontents}

\begin{filecontents*}{library.bib}
@article{Bara2006,
  author = {Bara, Judith},
  title = {{English Citation: entry}},
  year = {2006},
  journal = {Journal of Space},
  pages = {20\col1--20\col12},
}
@article{Baranov2001,
  author = {Jacques, Paul},
  title = {{Citation française : espace}},
  year = {2001},
  journal = {Comptes Rendus sur les Espaces},
  pages = {20:1--20:12},
}
\end{filecontents*}
\usepackage[bibencoding=auto,backend=biber,autolang=other]{biblatex}
\addbibresource{library.bib}
\DefineBibliographyStrings{french}{
    inseries = {dans},
    in = {dans}
}
\begin{document}
\textsc{url:} www. \\
\begin{french}
\textsc{url:} www. \\
\end{french}
\textsc{url:} www. \\
\textsc{url\col} www. \\
C'est un essai. \parencite{Bara2006,Baranov2001}
\printbibliography
\end{document}

如果我注释掉这一行\printbibliography,一切都会按预期运行。

答案1

您希望将其定义\col为不受字符间标记状态影响的字符;您还希望英文引用使用英文规则排版,这是通过设置字段获得的hyphenation

\documentclass[12pt]{book}
\usepackage{polyglossia}
\setdefaultlanguage{french}
\setotherlanguage{english}

\newcommand\col{\mbox{\XeTeXinterchartokenstate=0 :}}

\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@article{Bara2006,
  author = {Bara, Judith},
  title = {{English Citation: entry}},
  year = {2006},
  journal = {Journal of Space},
  pages = {20\col1--20\col12},
  hyphenation={english},
}
@article{Baranov2001,
  author = {Jacques, Paul},
  title = {{Citation française : espace}},
  year = {2001},
  journal = {Comptes Rendus sur les Espaces},
  pages = {20\col1--20\col12},
}
\end{filecontents*}
\usepackage[bibencoding=auto,backend=biber,autolang=other]{biblatex}
\usepackage{csquotes}
\addbibresource{\jobname.bib}
\DefineBibliographyStrings{french}{
    inseries = {dans},
    in = {dans}
}
\begin{document}
\textsc{url:} www. \\
\begin{french}
\textsc{url:} www. \\
\end{french}
\textsc{url:} www. \\
\textsc{url\col} www. \\
C'est un essai. \parencite{Bara2006,Baranov2001}
\printbibliography
\end{document}

在此处输入图片描述

相关内容