I'm a bit perplexed by why it is necessary to specify the page numbers manually. A
minimal working example would be helpful.
How do these "sections" appear in the document? With the starred \section*{...} command? If so, then consider using:
Code: Select all
\phantomsection%
\addcontentsline{toc}{section}{name of section}%
\section*{name of section}
If it is
really necessary for some reason to specify the page numbers manually, then I guess you could use the
\addtocontents command instead of
\addcontentsline. Exactly the right syntax to use here would depend quite a bit on your document class and what packages, if any, are being used to format the table of contents. You might be able to get a sense of the right format by looking at the .aux file being generated. But for a relatively plain document in the article class, then something like:
Code: Select all
\addtocontents{toc}{\contentsline{section}{\numberline{9}Section Title}{15}}
Here, "9" is the section number, and "15" the page number. You could change "{9}" to "{}" to make the section number blank, and change 15 to whatever.
That seems to work for the article class with an otherwise untouched table of contents; no guarantees it would work elsewhere.