General ⇒ Making a fake content
-
- Posts: 42
- Joined: Fri Jul 22, 2011 12:26 am
Making a fake content
I wanna make a fake content as following
Content
Preface ....................... I
Chapter one: Introduction ..................... 1
Section 1: Apple .............................. 2
Section 2: Wine Brew .......................... 19
Chapter two: Industry ......................... 41
Section 1: Wheat .............................. 42
Section 2: Pesticide .......................... 67
etc.
The reason why it is fake is because the actual sections and corresponding page numbers do not exist at all.
How could I do this? Thank you very much!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Making a fake content
\addtocontents
and \contentsline
, such asCode: Select all
\addtocontents{toc}{\protect\contentsline{chapter}{Industry}{41}}
\addtocontents{toc}{\protect\contentsline{section}{Wheat}{42}}
-
- Posts: 42
- Joined: Fri Jul 22, 2011 12:26 am
Making a fake content
Thank you for your help!
Your code does not work very well in LyX. It partially fail to generate content and chapter or section number, and it returns an error message:
Now I am using the following code:Paragraph ended before \contentsline was complete.
Code: Select all
\tableofcontents
\protect \contentsline {chapter}{\protect \numberline Preface {}}{IV}
\protect \contentsline {chapter}{\protect \numberline Chapter {1}: Preliminary}{1}
\protect \contentsline {section}{\protect \numberline {1.1}Mathmetical Background}{1}
So everytime I have to ignore this error message.Paragraph ended before \contentsline was complete.