Babel 套件不適用於模板

Babel 套件不適用於模板

我正在使用羅格朗橙皮書模板(您可以從那裡下載 tex 文件或在 Overleaf 中打開它),我目前正在嘗試獲取具有西班牙語語言規範的文檔,但使用\usepackage[spanish]{babel}提供了幾個有關分段的錯誤,所有這些錯誤都丟失或額外\endcsname

我認為這可能是因為我babel在載入書籍類別之後放置了命令,該類別包含在 Legrand Orange Book LaTeX 類別中。

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”
  • 一步步未註釋
  • 發現有一個包裹遺失
  • 麻煩製造者\tableofcontents

仍然存在一個與文檔類別相關的警告或錯誤:

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

相關內容