仅在 Debian 9 上使用 TexLive 2017 运行时才会引发错误。如果我在 Windows 10 上使用 MikTex 运行相同示例,则一切正常:
\PassOptionsToPackage{main=brazil,english,spanish,french}{babel}
\documentclass[brazilian,brazil,10pt,a4paper,]{memoir}
\usepackage{babel}
\usepackage{hyperref}
\newcommand{\autor}[1]{\author{#1}}
\newcommand{\imprimirautor}{\theauthor}
\newcommand{\brazilword}[1]{\foreignlanguage{brazil}{#1}}
\autor{\brazilword{Your Name}}
\hypersetup{
pdfauthor={\imprimirautor},
}
\begin{document}
Hi.
\end{document}
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)))
! Argument of \bbl@tempd has an extra }.
<inserted text>
\par
l.14 }
? H
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
答案1
通过研究,我发现了以下相关问题:
我尝试了这两个答案,但都没有用。
查看代码后,我发现在 babel 命令\protect
前添加\foreignlanguage
,可以修复 TexLive 2017 和 MikTeX 的问题。唯一的问题是,为什么之前没有“保护”的 MikTeX 可以正常工作,而 TexLive 却会报错。