5

I use Lyx 2.1, class document : report. I created a general introduction as unnumbered chapter, but at the table of Contents, the introduction does not exist. enter image description here

6

There is no formal LyX way to insert general content into the Table of Contents (ToC) other than using an ERT (the (La)TeX way). As such, you should insert an ERT containing

\addcontentsline{toc}{chapter}{General Introduction}

immediately after you've inserted the chapter. For alignment purposes (of the numbers in the ToC), you could also use

\addcontentsline{toc}{chapter}{\numberline{}General Introduction}

One could modify the LaTeX preamble to always insert an unnumbered chapter into the ToC by adding the following:

\usepackage{xparse}% http://ctan.org/pkg/xparse
\let\oldchapter\chapter
\RenewDocumentCommand{\chapter}{s o m}{%
  \IfBooleanTF{#1}
    {\oldchapter*{#3}% \chapter*
     \IfNoValueTF{#2}
      {\addcontentsline{toc}{chapter}{\numberline{}#3}}%  \chapter*{...}
      {\addcontentsline{toc}{chapter}{\numberline{}#2}}}% \chapter*[..]{...}
    {\IfNoValueTF{#2}%
      {\oldchapter{#3}}%      \chapter{...}
      {\oldchapter[#2]{#3}}}% \chapter[..]{...}
}

However, you may not be interested in this generic redefinition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.