embrac 和 biblatex 的兼容性

embrac 和 biblatex 的兼容性

我想使用该embrac软件包强制强调文本中的直立括号和方括号。虽然手册embrac声称该软件包与 biblatex 兼容,但我的参考书目书名中出现的所有方括号和方括号仍为斜体。我这里遗漏了什么吗?

最小(非)工作示例:

\documentclass{article}

\usepackage[biblatex=true]{embrac}
\usepackage[backend=biber]{biblatex}
\addbibresource{bibliography.bib}

\begin{filecontents}{bibliography.bib}
@InProceedings{gnucon,
  author = {Gary Gnu},
  title = {Gnus I Have Known And Loved},
  booktitle = {Proc. 3rd Workshop [on] Gnuphilia (GNUCON)},
  year = {2004},
}
\end{filecontents}

\begin{document}
\emph{This (this) is a test. This [this] is a test.} % Works as expected
\nocite{gnucon}
\printbibliography % Parentheses are unexpectedly in italics here
\end{document}

输出:

上述示例的输出,显示了参考书目中错误斜体的括号和圆括号

答案1

embrac如果您在宏中隐藏文本,则不起作用。所以在我看来,直接输入括号和括号是行不通的。但您可以使用以下命令:

\documentclass{article}

\usepackage[biblatex=true]{embrac}
\usepackage[backend=biber]{biblatex}

\addbibresource{bibliography.bib}
%\usepackage{filecontents}

\begin{filecontents}{bibliography.bib}
@InProceedings{gnucon,
  author = {Gary Gnu},
  title = {Gnus I Have Known And Loved},
  booktitle = {Proc. 3rd Workshop \mkbibbrackets{on} Gnuphilia \mkbibparens{GNUCON}},
  year = {2004},
}
\end{filecontents}


\begin{document}


\emph{This (this) is a test. This [this] is a test.} % Works as expected
\newcommand\mytext{This (this) is a test. This [this] is a test.}
\emph{\mytext} %doesn't work
\nocite{gnucon}
\printbibliography % Parentheses are unexpectedly in italics here
\end{document}

在此处输入图片描述

相关内容