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.

One section of my article is a table. Because of space limitation, I cannot put section title in the same page as the table. On the other hand, I want my section title appear in pdf bookmarks. How can I define a hidden section name and make sure that it is going to appear in toc and more importantly in pdf bookmarks. By the way, I don't want to make my table smaller.

I tried the solution suggested in make section headings invisible and it doesn't work.

share|improve this question
2  
It would be helpful if you showed how the answer at the linked question does not work by composing a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem. –  Peter Grill Nov 5 '12 at 5:47
    
I used \pdfbookmark[n]{}{} and it worked. Thanks a lot for your comment. –  N Nik Nov 5 '12 at 6:08
1  
Excellent. It would be helpful if you posted an answer explaining that as it would be helpful to others that have the same problem in the future. Self-answers are welcome. Ideal would be if you posted a complete compilable example. –  Peter Grill Nov 5 '12 at 6:10
    
You are absolutely right and I apologize I forgot to answer your question. I checked my document again. And here is the answer. Both solutions work. Either the one suggested in the above link or using \pdfbookmark. My mistake was that I wasn't entering these commands at the right place in the document. Sorry for posting a redundant question. Please feel free to remove this it. –  N Nik Nov 5 '12 at 6:24
1  
Again that can still be useful to others. I am sure you are not the last person to make this mistake so adding that as an answer would be a good idea. Actually it might even help you in the future -- I often refer to a lot of my earlier questions (and answers) as I need the same info and forgot exactly how it was solved previously. –  Peter Grill Nov 5 '12 at 6:32

1 Answer 1

up vote 2 down vote accepted

my page was basically a big table and I didn't have the luxury of entering a section name. However, I wanted the section name to appear in pdf bookmark.

\documentclass[12pt]{article}
\usepackage{url}
\usepackage[pdftex]{hyperref} %% comes last
\hypersetup{ 
pdftitle={}, 
pdfauthor={},
bookmarks=true, bookmarksopen=true, pdftoolbar=true, 
pdffitwindow=false,
colorlinks=false,
linkcolor=red, 
citecolor=red,
filecolor=magenta,
urlcolor=black }
\usepackage{bookmark}

\begin{document}    
\newpage%

% LOCATION A

\begin{table}[htb] \centering
% LOCATION B

Possible solution 1:

\newcommand\invisiblesection[1]{%
  \refstepcounter{section}%
  \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
  \sectionmark{#1}}
enter chapter title here
\invisiblesection{text you want to appear in pdf file}

Possible solution 2:

\pdfbookmark[1]{title}{comment}

My mistake: I tried each of these solutions in Location A.
Consequence: strangly the pdf file bookmark was linked to a very different page.

Solution: Try them at Location B

share|improve this answer

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.