Hello, everybody!
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!
General ⇒ Making a fake content
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Making a fake content
You could use
Stefan
\addtocontents
and \contentsline
, such asCode: Select all
\addtocontents{toc}{\protect\contentsline{chapter}{Industry}{41}}
\addtocontents{toc}{\protect\contentsline{section}{Wheat}{42}}
LaTeX.org admin
-
- Posts: 42
- Joined: Fri Jul 22, 2011 12:26 am
Making a fake content
Hello, Stefan_K!
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:
This code can generate everything for me, I am quite satisfied. But it also returns an error message:
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.