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've tried adapting the answer here, to make invisible subsections by changing 'section' to 'subsection' everywhere. It didn't seem to work. Basically, what I want is to have subsections that appear in the bookmarks menu of adobe (or other pdf readers) so that I can't jump to their location, but they shouldn't appear in the text itself. Ideally I would prefer these subsections (or sections for that matter) didn't interfere with the numbering of regular subsections, but that's the less important part.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You want to use the command \addcontentsline to add something to the table of contents.

\documentclass{report}
\usepackage{blindtext}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{You can see this section}
\blindtext

\addcontentsline{toc}{subsection}{You can't see this one}

\blindtext
\subsection{You can see this one!}

\blindtext
\end{document}

This will put an unnumbered entry at the level of subsection into the \tableofcontents and and entry in the index! More information can be found here.

share|improve this answer
    
very good! Thank you, Nethanael. Is it too much to ask that the tex editor (TeXstudio) recognize it too? :) –  giladrv Feb 8 '13 at 9:24
    
You could make an actual invisible subsection, which would probably be recognised by TeXstudio, but that would be much more than a line long! I think I have some code at home that could work, I'll give it a look later. Still, one line answers are usually the best! –  Nathanael Farley Feb 8 '13 at 10:18
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.