Text FormattingTable of content is showing wrong reference page number

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
sakif
Posts: 1
Joined: Thu Dec 24, 2020 6:00 pm

Table of content is showing wrong reference page number

Post by sakif »

Hi guys
I am new in this forum.
I have encountered a problem that i can't solve.
problem is, Reference page number started from 11 to 13. but on the table of content it is showing page number 13. but it should be 11.
could you please tell me how to solve it?
I have tried

Code: Select all

\cleardoublepage before \addcontentsline. Also a \phantomsection
but nothing worked.
[[[[ I am using overleaf ]]]]
My preamble is here:
\documentclass[a4paper, 12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage{lipsum}
\usepackage{indentfirst}
\usepackage{dirtytalk}
\usepackage{caption}
\usepackage{float}
\usepackage[acronym]{glossaries}

% package for including graphics with figure-environment
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[toc,page]{appendix}
% colors for hyperlinks
% colored borders (false) colored text (true)
\hypersetup{colorlinks=true,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black}
\usepackage[letterpaper, margin=1in, top=1in, bottom=1in]{geometry}
\begin{document}
% package for bibliography
\usepackage[authoryear,round]{natbib}
\newpage

\bibliographystyle{natdin}
\bibliography{references} % expects file "references.bib"
\addcontentsline{toc}{section}{References}
\newpage
\appendix
\section{Appendix}
\end{document}
looking forward to your answers
thank you in advance.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Table of content is showing wrong reference page number

Post by Bartman »

Better use the tags provided for multiline source code.

Do you have a Infominimal working example for us that reproduces the problem?

You should read the error message in the log file, that is caused by the command

Code: Select all

\usepackage[authoryear,round]{natbib}
Off topic:

Read in issue 28 of ltnews whether you still need inputenc with the utf8 option in the preamble.

According to the entry on CTAN, the times package is out of date and should be replaced by mathptmx or even newtx.

Are you allowed to use biblatex and biber?
Post Reply