1

I'm sorry, I'm new to latex and still have much to learn.

I'm using the report document class and also openright. And this is what my "structure" looks like:

\tableofcontents


\setstretch{1.5}

\include{Introduction} 
\include{Chap1}
\include{Chap2}
\include{Chap3}
\include{Conclusions}

With Introduction and Conclusions starting with chapter*{} in order to have them as unnumbered chapters (and all of them being single .tex files, of course).

How do I have them unnumbered but also appearing in the TOC with the correct page numbering? The only way I found was \addcontentsline, but the lines in the TOC reported wrong page numbers.

Thanks everybody in advance for the help!!

EDIT: forgot to say that I specified that I'm using openright since maybe that's the problem with wrong numbering.

2
  • Please provide a minimal working example following the demands you find here: tex.meta.stackexchange.com/q/228/231952, so that we can better understand the problem you are encountering.
    – Ivan
    Commented Mar 29, 2021 at 14:15
  • 1
    Where are you putting the \addcontentsline? You should put it right after \chapter* in the intro/conclusion sections. Commented Mar 29, 2021 at 16:00

1 Answer 1

2

You have to put the \addcontentsline after the \chapter* command.

% tocincprob.tex  SE 590518
\documentclass[openright]{report}
\begin{document}
\tableofcontents
%\setstretch{1.5}  %%% where does this come from?
\chapter*{Intooduction}
\addcontentsline{toc}{chapter}{Introduction}
\chapter{Chap1}
\chapter{Chap2}
\chapter*{Conclusions}
\addcontentsline{toc}{chapter}{Conclusions}
\end{document}

enter image description here

1
  • Thank you so much!!! I tried everything but this, I didn't know it had to go in the other .tex file.. as I said, I still have much to learn! Thanks again. I don't know if it was a question for me, anyway I forgot to delete \setstretch as I copied that code part.
    – pigna89
    Commented Mar 29, 2021 at 18:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .