![为什么在这种情况下包 csquotes 会出现错误?](https://linux22.com/image/469715/%E4%B8%BA%E4%BB%80%E4%B9%88%E5%9C%A8%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E4%B8%8B%E5%8C%85%20csquotes%20%E4%BC%9A%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF%EF%BC%9F.png)
当我使用包 csquotes (style=spanish) 的命令 enquote 和书目样式 caauda0.bst 时,我遇到了问题。我给你一个 MWE 来说明,但我得到了以下错误:
LaTeX Error: Command \enquote already defined.
./output.bbl, 6
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.6 ...nquote}[1]{\guillemotleft#1\guillemotright}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
你知道为什么会发生这种情况吗?我需要使用 XeLatex 进行编译。
梅威瑟:
\documentclass{beamer}
\usepackage[catalan]{babel}
\usepackage[utf8]{inputenc}
\usepackage[style=spanish]{csquotes}
\begin{filecontents}{\bib.bib}
@book{key,
author = {Author, A.},
year = {2001},
title = {Title},
publisher = {Publisher},
}
\end{filecontents}
\begin{document}
\begin{frame}{BON DIA}
\enquote{Aquest títol}.
\cite{key}
\end{frame}
\begin{frame}{BON DIA}
\bibliography{bib}
\bibliographystyle{caauda0}
\end{frame}
\end{document}
问题似乎出在参考书目风格上: https://ctan.org/tex-archive/biblio/bibtex/contrib/catalan
答案1
bst 文件有
"\newcommand{\enquote}[1]{\guillemotleft#1\guillemotright}"
这有点不幸,但一个简单的解决方法是将其本地副本更改为
"\renewcommand{\enquote}[1]{\guillemotleft#1\guillemotright}"