更改 LyX 中的目錄標題

更改 LyX 中的目錄標題

我已經嘗試遵循這裡的答案: 如何更改目錄標題?

透過使用\renewcommand{\contentsname}{Whatever}

然而,它似乎不適用於LyX,無論是在序言中還是在 ERT 中。使用的套件是 babel。

.lyx 檔案的最小工作範例:

\pagenumbering{roman} 
\renewcommand{\chaptername}{}

\renewcommand{\thechapter}{\arabic{chapter}}

\renewcommand{\contentsname}{Innholdsfortegnelse}

1. Innledning

\pagenumbering{arabic} 

Heisann

答案1

  1. Document>>>Settings...Language語言包: None

  2. Document>>>Settings...LaTeX Preamble

寫:

\usepackage[norsk]{babel}
\addto\captionsnorsk{%
\renewcommand{\contentsname}{Innholdsfortegnelse}}

結果必須與這個普通的 LaTeX 等效:

\documentclass{article}
\usepackage[norsk]{babel}
\addto\captionsnorsk{%
\renewcommand{\contentsname}{Innholdsfortegnelse}}
\begin{document}
\tableofcontents
\section{Section}
\end{document}

姆韋

如果這樣做你會得到Package babel Error: Unknown languagexxxxx'`:

姆韋

然後,前往View Complete Log ...

姆韋

正如您所看到的,這是因為上次運行的文件\select@language {english}中有一個。.aux您可以手動刪除它(在 Linux 系統中的螢幕截圖中是/tmp/lyx_tmpdir.T23297/lyx_tmpbuf6/newfile6.aux),但您只需單擊 Close,LyX 就會為您清理輔助檔案(至少如果只有這個錯誤)。在下一次運行中它應該可以工作。

答案2

嘗試

\AtBeginDocument{\renewcommand\contentsname{Whatever}}

相關內容