
私は自分の作品をMikTex 2.9 Windows 7および/またはKyle 2.1.2でコンパイルしようとしています
言語をポルトガル語に設定してコンパイルしようとすると、付録でサポートされていない制御シーケンス エラーが発生します。
これはパッケージがロードされるプリアンブルです。
\usepackage[brazil,american]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\usepackage{natbib}
\usepackage{url}
\usepackage{xcolor,graphicx,url}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{epstopdf,placeins}
\usepackage{glossaries}
\usepackage{caption}
\usepackage[toc,page]{appendix}
言語を英語に設定すると、ドキュメントは正常にコンパイルされます。
エラー メッセージは .out ファイルを指しています:
\BOOKMARK [0][-]{section*.40}{Refer\352ncias}{}% 35
\BOOKMARK [0][-]{Ap�ndice.1.A} <-------------- this line is throwing the error
Kyle (Linux) と Windows (MikTex) でコンパイルしようとしましたが、どちらも同じエラーが発生します。唯一の違いは、Linux では文字がê
.out ファイルに印刷されるのに対し、Windows ではあのくだらない疑問符のエンコード エラーが発生することです。
付録の章を呼び出す前に言語を切り替えると、すべて正常に実行されます。
\def\appendixname{Ap\^endice}%
また、アクセントなしで PT babel ファイルから をオーバーライドすると、正常にコンパイルされます。
そのエラーなしで、付録をポルトガル語でコンパイルするには(単語の正しいスペルを維持しながら)どうすればよいでしょうか?
答え1
私も同じ問題を抱えていました。解決策は、メイン ソース ファイルのプリアンブルに次のコードを挿入することです。コードは、パッケージをロードした行の後に配置する必要がありますhyperref
。appendix
\makeatletter
\renewcommand
{\appendixtocname}{Ap\^{e}ndices}
\renewcommand
{\appendixpagename}{Ap\^{e}ndices}
\renewcommand
{\appendixname}{Ap\^{e}ndice} \let\oriAlph\Alph
\let\orialph\alph
\renewcommand{\@resets@pp}
{\par\@ppsavesec
\stepcounter{@pps}%
\setcounter{section}{0}%
\if@chapter@pp
\setcounter{chapter}{0}%
\renewcommand\@chapapp{\appendixname}%
\renewcommand\thechapter{\@Alph\c@chapter}%
\else
\setcounter{subsection}{0}%
\renewcommand\thesection{\@Alph\c@section}%
\fi
\if@pphyper
\if@chapter@pp
\renewcommand
{\theHchapter}
{\theH@pps.\oriAlph{chapter}}%
\else
\renewcommand
{\theHsection}
{\theH@pps.\oriAlph{section}}%
\fi
\def\Hy@chapapp
{appendix}%
\fi
\restoreapp
}
\makeatother