Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use the article document class and I created a TOC. It works fine and uses the \section to write the header, but the problem is that the first page after my TOC is the introduction and there I used \part without any \section. This is not recognized and so on the introduction page in the header it says "Contents" and not "Introduction". Can anyone help?

\tableofcontents
\newpage
\setcounter{page}{1}
\input{Chapter1} 
%\newpage
\input{Chapter2}

etc.

and the chapters are like:

\part{Chapter1} 
\part{Chapter2} 
\section
\section

But the problem is, Chapter 1 has no \section and is not recognized.

share|improve this question
2  
I'm not sure I completely understand your problem. First of all it puzzles me that you use the part structure (which you call chapter). Part uses roman numbering - are you sure you want that? The highest structure level in an article class (that is using latin numbers) is as far as I know the section and in any case, the syntax to use it is: \section{This is the title of my section}. This title then also appears in the toc. –  Philipp Apr 8 '12 at 17:37
    
@Philipp The standard article class does feature \part (here not followed by a page break). –  lockstep Apr 8 '12 at 17:43
    
I know, but I was just confused by the way it is used. Anyway, as far as I can grasp the problem the only problem I see is how the section command was used. Else I dont see why this shouldn't work. –  Philipp Apr 8 '12 at 17:49
4  
Please, provide a real example of what you're doing. However, using article and \part to emulate chapters is quite strange: use the book class. –  egreg Apr 8 '12 at 19:18

2 Answers 2

If the answer is really that simple, I'll give it a shot:

To use the section command you need to pass an argument, namely the name of the section which looks like this:

\section{Introduction}

This line then creates an entry in the toc with the name Introduction and also creates a section within the document with this title.

share|improve this answer
    
well, thanks for your answers but it does not solve my problem, I want that \part and you said that article does feature it, so it should work, but it doesnt, the \part{Introduction} is not in the header which is created by the toc. You know what I mean? It is in the toc, but the header on the next page says "content" and not "Introduction". –  useranflatex Apr 8 '12 at 19:18

You must issue a \mark command to fill the header. Probably \markright{Introduction}.

share|improve this answer
    
That certainly works for the first page where the command is issued but am I right when I say it needs manually repeated if there are more than just one page (which could be a bit tedious if that part is a long one - but then again, since there occurs no section it rather unlikely to be that long)? –  Philipp Apr 8 '12 at 21:41
    
The effect of a \mark command doesn't end at a page break. Also remark that the question title speaks of the toc. But the text of the header. –  Ulrike Fischer Apr 8 '12 at 22:03
    
hey Ulrike thanks a lot! it really worked! thanks!! –  user13408 Apr 9 '12 at 6:25
    
@useranflatex Please don't post comments as another answer. I converted your non-answer to a comment to Ulrike's answer. And if you like her answer, please consider upvoting and accepting it. –  Stefan Kottwitz Apr 9 '12 at 9:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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