Babel パッケージはテンプレートでは動作しません

Babel パッケージはテンプレートでは動作しません

私はルグラン オレンジブック テンプレート(そこから tex ファイルをダウンロードするか、Overleaf で開くことができます)。現在、スペイン語の仕様が記載されたドキュメントを入手しようとしていますが、 を使用すると\usepackage[spanish]{babel}セクションに関するいくつかのエラーが発生し、それらはすべて欠落しているか、余分なものになっています\endcsname

babelLegrand Orange Book LaTeX クラスに含まれる book クラスを読み込んだ後にコマンドを実行したためだと思いました。

MWE コード:

\documentclass[11pt,a4paper]{LegrandOrangeBook}

\usepackage[spanish]{babel}

\definecolor{ocre}{RGB}{0, 100, 100}

\chapterspaceabove{6.5cm}
\chapterspacebelow{6.75cm}

\usepackage{svg}

\begin{document}


\thispagestyle{empty} 
\begin{tikzpicture}[remember picture, overlay]
    \node [text opacity=1, minimum height=0.2\paperheight, minimum width=\paperwidth, text width=0.8\paperwidth] at (10,-5) {\sffamily 
        {\Huge\bfseries The$\,\,$ document$\,\,$ title\par}
        \vspace{16pt} % Vertical whitespace
        {\LARGE Blablabla\par} % Subtitle
        \vspace{24pt} % Vertical whitespace
        {\huge\bfseries Your$\,\,$ Name\par}
        \vspace{10pt}
        {\LARGE Tutor: }
        }; 
    \end{tikzpicture}
    

\pagestyle{empty} % Disable headers and footers for the following pages
\tableofcontents % Output the table of contents
\pagestyle{fancy} % Enable default headers and footers again
\cleardoublepage % Start the following content on a new page


\chapterspaceabove{6.75cm} 
\chapterspacebelow{7.25cm} 

\chapter{Sectioning Examples}\index{Sectioning}

\section{Section Title}\index{Sectioning!Sections}
Lorem ipsum

\subsection{Subsection Title}\index{Sectioning!Subsections}
Fusce varius orci

\end{document}

これを実行するには、前に投稿したリンクを入力し、「テンプレート コードのダウンロード」に移動して、LegrandOrangeBook ファイルと tex ファイルを私の MWE とともに同じフォルダーに含める必要があります。

答え1

あなたがやっていることのすべてが意味を成すかどうかはわかりませんが、少なくともこれはコンパイルできます:

\documentclass[11pt,a4paper]{LegrandOrangeBook}

 \usepackage[spanish]{babel}
 \usepackage{csquotes}      % <<< was missing

 \definecolor{ocre}{RGB}{0, 100, 100}

\chapterspaceabove{6.5cm}
\chapterspacebelow{6.75cm}

% \usepackage{svg} % <<< not needed here

\begin{document}


 \thispagestyle{empty} 
\begin{tikzpicture}[remember picture, overlay]
    \node [text opacity=1, minimum height=0.2\paperheight, minimum width=\paperwidth, text width=0.8\paperwidth] at (10,-5) {\sffamily 
        {\Huge\bfseries The$\,\,$ document$\,\,$ title\par}
        \vspace{16pt} % Vertical whitespace
        {\LARGE Blablabla\par} % Subtitle
        \vspace{24pt} % Vertical whitespace
        {\huge\bfseries Your$\,\,$ Name\par}
        \vspace{10pt}
        {\LARGE Tutor: }
        }; 
    \end{tikzpicture}
    

 \pagestyle{empty} % Disable headers and footers for the following pages
 % !!! trouble ahead
% \tableofcontents % Output the table of contents
 \pagestyle{fancy} % Enable default headers and footers again
 \cleardoublepage % Start the following content on a new page


\chapterspaceabove{6.75cm} 
\chapterspacebelow{7.25cm} 

\chapter{Sectioning Examples}\index{Sectioning}

\section{Section Title}\index{Sectioning!Sections}
Lorem ipsum

\subsection{Subsection Title}\index{Sectioning!Subsections}
Fusce varius orci

\end{document}

手順:

  • すべてをコメントアウトしたが、何らかの「hello world」が残っていた
  • コメントなしステップバイステップ
  • 1つのパッケージが不足していることがわかった
  • トラブルメーカー\tableofcontents

ドキュメントクラスに関連する警告またはエラーが 1 つ残っています。

Package hyperref Warning: Option `hyperindex' has already been used, 
setting the option has no effect on input line 507.

関連情報