Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use \phantomsection in my document, because I have nonnumbered chapters in Table of Contents:

\chapter*{Chapter title}    
\phantomsection
\addcontentsline{toc}{chapter}{Chapter title}

Command \phantomsection works not correctly - jump properly to page, but the center of the page, not on top. View as a pdf is 'fit to horizontal' so I cannot see 'Chapter title' without scroll through the page. Command \chapter{} works fine.

share|improve this question
4  
Welcome! \cleardoublepage\phantomsection\chapter*{Chapter Title}. If you use a KOMA class you can use \addchap –  Marco Daniel May 19 '12 at 17:40
    
Works perfectly. Thank you! –  rgb May 19 '12 at 19:51
add comment

2 Answers

The command \phantomsection sets the label at the current position. However the command chapter has previous and and skip below the title. Based on the last skip the position of \phantomsection is specified. To provide the label at the top of the page use the following order:

\cleardoublepage%\clearpage in onside mode
\phantomsection
\chapter*{Chapter Title}

If you use a KOMA class you can also use the command \addchap which simplefy the the lines above to

\addchap{Chapter Title}
share|improve this answer
add comment

Can you use something like this:

\documentclass{report}

% \makeatletter% <-- another useful trick
% \renewcommand\@seccntformat[1]{}
% \makeatother%

\usepackage{hyperref}

\begin{document}

\tableofcontents

\chapter{First Chapter}

Text.

\newpage
\section{First Section}

Text.

\newpage
\setcounter{secnumdepth}{-1}% must reset if you want to bring numbering back
\chapter{Second Chapter} 
\section{Another First Section}

More text.

\end{document}
share|improve this answer
2  
One has to remember to reset tocdepth and secnumdepth afterwards, if the unnumbered chapter is not the last. –  egreg May 19 '12 at 20:16
1  
Your changing doesn't work. tocdepth must be changed in the preamble or by \addcontentsline. –  Marco Daniel May 19 '12 at 20:55
    
@MarcoDaniel -- well, it works for me when I do it. Have you tried the example? EDIT: oh! you are referring to the tocdepth. True, and that part should be taken out since it doesn't have anything to do with the question.... –  jon May 19 '12 at 21:12
    
@jon: lol -- have fun –  Marco Daniel May 19 '12 at 21:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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