1

Working on my thesis template and need help understanding titletoc. I've found an example of a TOC i liked, copy/paste, looks wonderful, but my sections that have roman numerals are missing their numering.

this is what it looks like

The code that does things with the TOC looks like this:

\usepackage[nottoc]{tocbibind}
\usepackage{titletoc}
\titlecontents{chapter}
                [0.0cm]             % left margin
                {\vspace{1cm}}      % above code
                {%                  % numbered format
                {{\scshape Kapittel} \thecontentslabel---}%
                }%
                {}         % unnumbered format
                {}         % filler-page-format, e.g dots

I've tried reading the manual but i'm just a simple composer... What am i missing?

EDIT: Full code of main body

%===============Supernødvendige==================================
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc} % ØÆÅ
\usepackage[norsk]{babel} % Norske ord og uttrykk i automatisk generert materiale.
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry} % A4 og margdetaljer.
%\linespread{1.5} % Linjeavstand, om nødvendig (det er det ikke).
\usepackage{graphicx} % For å importere grafikk
    \graphicspath{ {grafikk/} }
\usepackage{pdfpages} % Importere pdf-filer
\usepackage{csquotes} % Enkel og grei måte å sitere tekst på. Ex.:\begin{displayquote}Tekst\end{displayquote}
\usepackage{wrapfig} % Tabellting
\usepackage{multirow} % "-"
\usepackage{booktabs} % "-"
\usepackage{hyperref} % Gjør lenker og referanser klikkbare
\usepackage{apacite} % Denne gjør siteringen om til APA, som er kravet satt av HiNESNA
\tolerance = 5000 % Norsk bruker noe lengre ord enn engelsk, 
\hbadness = \tolerance % derfor bruker vi denne for å hindre LATEX å bryte ord på hi-
\pretolerance = 2000 % nsides plasser.
%===============PYNTETING==================================
%=========Header og footer============
\usepackage[Conny]{fncychap} % Fæncy overskrift. Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\usepackage{fancyhdr} % Dette er header og footer.
    \pagestyle{fancy}
        \fancyhead{}
        \fancyhead[LO,RE]{Kapittel \thechapter}
        \fancyfoot{}
        \fancyfoot[LE,RO]{\thepage}
        \fancyfoot[LO,CE]{}
        \fancyfoot[CO,RE]{}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%=========Modifiserer Innholdslista============
\usepackage[nottoc]{tocbibind}
\usepackage{titletoc}
\titlecontents{chapter}
                [0.0cm]             % left margin
                {\vspace{1cm}}      % above code
                {%                  % numbered format
                {{\scshape Kapittel} \thecontentslabel---}%
                }%
                {}         % unnumbered format
                {}         % filler-page-format, e.g dots
%\addtocontents{toc}{~\hfill\textif{Side}\par} % Legger til "side" i innholdsfortegnelsen.
%=========Typografiske tillegg============
\usepackage{lettrine} % Stor bokstav i starten av paragraf. Ex.: \lettrine[lines=3]{L}{ook}
\usepackage{fix-cm} % Nødvendig fiksepakke for \lettrine
\usepackage{epigraph} % Sitat i starten av et kapittel. Ex.: \epigraph{TEXT}{\textit{UNDERTEXT\\UNDERUNDERTEXT}}
\usepackage{lipsum} 
%===============Selve dokumentet==================================
\begin{document}

\include{kapittel/tittel}
        \setcounter{page}{0} % Ingen telling av forsiden.
        \pagenumbering{roman} % Nullstiller sidetelleren og bruker romertall for alt som ikke er selve oppgaven.

\include{kapittel/sammendrag}

\include{kapittel/introduksjon}

\tableofcontents % Innholdsfortegnelse.
        \thispagestyle{plain}
            \clearpage 
        \pagenumbering{arabic}
        \thispagestyle{empty}

\include{kapittel/kapittel01}

\include{eksempelkoder}

%\include{kapittel/kapittel02}

%\include{kapittel/kapittel03}

%\include{kapittel/konklusjon}

\bibliographystyle{apacite}
\bibliography{bibliografi.bib}

\listoffigures % Legger til listene over figurer og tabeller i TOC.

\listoftables

\include{kapittel/vedlegg01} % Eventuelle vedlegg legges til her.

%\include{kapittel/vedlegg02}
%========================================
\end{document} 

I dont know if this will run because the chapters are embeded, but you guys are the smart ones, i trust it will sort it self out.

  • 1
    Welcome to TeX.SX! Please help us to help you and add a full minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. You might also want to add to your question how you're including the pdfs etc. – Aradnix Oct 22 '14 at 7:02
  • Where are you defining roman numbered chapters? I can't see it in the example. One of our members wrote some notes on preparing a minimal working example – Johannes_B Oct 22 '14 at 7:22
  • Concerning your change of the pagination, please have a look at How to use pagenumbering in the document? – Johannes_B Oct 22 '14 at 7:23
  • 1
    @Buschmann: Could you please provide the community with a minimal example that replicates your problem so that we can copy-and-paste-and-compile and see exactly what the problem is. As it stands, we don't have the included files, and have to mock up something ourselves... if you want to be helped quicker, then make something we can consume quickly. Helping us really does help yourself. – Werner Oct 22 '14 at 7:35
  • 3
    I am not sure if I understand your question: Are you missing the page numbers for the chapters in your table of contents? Then you have to add \hfill\contentspage in the last argument: \titlecontents{chapter}[0.0cm]{\vspace{1cm}}{{\scshape Kapittel} \thecontentslabel---}{}{\hfill\contentspage} – esdd Oct 22 '14 at 8:53
1

The solution: add \hfill\contentspage in the last argument: \titlecontents{chapter}[0.0cm]{\vspace{1cm}}{{\scshape Kapittel} \thecontentslabel---}{}{\hfill\contentspage}

Tata!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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