GeneralChapters in index without chapter number with a pagenumber

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tweeg
Posts: 22
Joined: Tue Jun 24, 2008 5:12 pm

Chapters in index without chapter number with a pagenumber

Post by tweeg »

Been lurking for a while but i thought it was time to register and commit to the community (and ask a few things :P)

So basicly this is the problem, i have a thesis set up, where i include my files using

Code: Select all

\input{./tex/bla.tex}
.

The order is basicly this:

front
list of figures
list of tables
abbreviations
welcome text
index

Now, the problem i have is, that i want all the files before the index, to be in the index (numbered, i use \pagenumbering{roman} ofc) but not with a chapter number.

But the welcome text for example has

Code: Select all

\addtocontents{toc}{\vspace{1em}} 
\chapter*{welcome}
in it. This way, it will not show up in the index in the right way, if i delete the * in the chapter command, it will get numbered, and if i leave it there, it wont show up at all.

So basicly, i wanna have some files in my index with a pagenumber, but without a chapter number :P

Whats the most easy way to do this ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Chapters in index without chapter number with a pagenumber

Post by localghost »

First of all you should clarify if we are talking about an index, which contains key words marked in the text, or the Table of Contents (ToC), which lists the chapters and their corresponding page number.

The next thing is that I can't really figure out what you want.
tweeg wrote:[…] Now, the problem i have is, that i want all the files before the index, to be in the index (numbered, i use \pagenumbering{roman} ofc) but not with a chapter number. […] So basicly, i wanna have some files in my index with a pagenumber, but without a chapter number. […]
I wonder what you mean when using the term "files" in this context. The last statement makes me suggest you some simple lines of code.

Code: Select all

\chapter{Welcome}
  \addcontentsline{toc}{chapter}{Welcome}
This makes the chapter appear in the ToC without any numbering, followed by the corresponding page number. That's all for the moment from my side. If I didn't get the problem, please describe more precisely where and what it is.


Best regards and welcome to the board
Thorsten¹
tweeg
Posts: 22
Joined: Tue Jun 24, 2008 5:12 pm

Chapters in index without chapter number with a pagenumber

Post by tweeg »

Thx for the help, and sorry for the misunderstanding.

I dident mean index, but TOC.

Ur idea worked out great, thx :) Got that working now.

Got some more small questions though.

1 My latex mainfile looks like this:

Code: Select all

\tableofcontents  
\pagestyle{fancy}  
\pagenumbering{arabic}
\input{./tex/chapter1.tex}
The problem with this is, that both the fancyheader as wel as the (arabic) pagenumbering, thats 1 page to early, it doesent start at the first page of chapter1, but at the second page of the toc. How to fix this ?



Thx in advance !
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Chapters in index without chapter number with a pagenumber

Post by localghost »

tweeg wrote:[...] The problem with this is, that both the fancyheader as wel as the (arabic) pagenumbering, thats 1 page to early, it doesent start at the first page of chapter1, but at the second page of the toc. How to fix this ? [...]
For this issue it's necessary to have a minimal working example (MWE) which reproduces the undesired behaviour.
tweeg
Posts: 22
Joined: Tue Jun 24, 2008 5:12 pm

Chapters in index without chapter number with a pagenumber

Post by tweeg »

Okey, i think this is the problem. Theres 3 files. First, my main latex file:

Code: Select all

\documentclass[12pt,a4paper]{report}
\usepackage{lipsum}
\begin{document}
\pagenumbering{roman}
\input{1.tex}
\pagenumbering{arabic}
\input{2.tex}
\end{document}
The file 1.tex:

Code: Select all

\chapter{test1}
\lipsum{1-50}
And 2.tex:

Code: Select all

\chapter{test2}
\lipsum{1-50}
And as stated earlyer, the arabic numbering doesent start at 2.tex, but at page 2 of 1.tex. How to fix this ? Guess its a really stupid question :P
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Chapters in index without chapter number with a pagenumber

Post by localghost »

Ah, now I see clearer. Put the command for the page numbering into the single files for the chapters.

Code: Select all

\chapter{Test 1}
  \pagenumbering{roman}
This has always to be done when changing the page number format. Now the new format should start on the right page.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Chapters in index without chapter number with a pagenumber

Post by Stefan Kottwitz »

Hi tweeg,

call \cleardoublepage directly before \pagenumbering{arabic}, or move \pagenumbering{arabic} into 2.tex after you called \chapter.

Stefan
LaTeX.org admin
Post Reply