## LaTeX forum ⇒ Page Layout ⇒ Indent contents line of table of content Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Jack1234567
Posts: 3
Joined: Fri Feb 08, 2019 10:33 am

### Indent contents line of table of content

Hi there,

I used the following formatting to include apa references in my report, importing it from Mendeley.

% REFERENCES
\bibliographystyle{apacite}
\bibliography{Library.bib}

It automatically included a line in my table of content, as you can see below. However, I want to tab (indent) the reference line, in order to align it with the rest of the sections (summery, acknowledgement, etc.). Does anyone know how I can fix this problem?

TOC.PNG (35.94 KiB) Viewed 365 times

ps. when I add another section line to my table of content, I get two references lines.

TOC 2.PNG (36.58 KiB) Viewed 365 times

Thank you!!

Stefan Kottwitz
Posts: 9405
Joined: Mon Mar 10, 2008 9:44 pm
Hi Jack,

welcome to the forum!

It seems you have somewhere else in your code such an \addcontentsline already, but without that \numberline{}. That happens for example if you simply use the tocbibind package.

Quick patch, at the end of your document preamble, so right before \begin{document}:

\let\origaddcontentsline\addcontentsline\renewcommand{\addcontentsline}[3]{\origaddcontentsline{#1}{#2}{\numberline{}#3}}

Stefan

Jack1234567
Posts: 3
Joined: Fri Feb 08, 2019 10:33 am
Hi Stefan,

Thank you so much, this was very much of a help. Fixed the 'reference' problem.
However, next problem the appendix's have indented now. Do you also know how to get them aligned with the numbers?

Excuse me, just started working with Latex, so it's all a bit new to me.

TOC 3.PNG (53.23 KiB) Viewed 356 times

Thank you!

Stefan Kottwitz
Posts: 9405
Joined: Mon Mar 10, 2008 9:44 pm
You could revert that change after \bibliography and before the appendix:

\let\addcontentsline\origaddcontentsline

Stefan

Jack1234567
Posts: 3
Joined: Fri Feb 08, 2019 10:33 am
Perfect, thank you!

### Who is online

Users browsing this forum: No registered users and 1 guest