3

I am trying to make automatically generate bookmark in my PDF file, but hyperref is not doing so. Here is my code. Any idea what am I missing.

% nVSDguide.tex
% v4.0 released October 2014

%\documentclass{article}
\documentclass{nVSD2e}

\usepackage[bookmarksopen=true,bookmarks=true]{hyperref}
\usepackage{bookmark}

\begin{document}
\title{How well does?}
\maketitle

\begin{abstract}
    The effect is very easy to construct.   
\end{abstract}

\section{Introduction}
jack for none.
\section{Procedure}
here it is.. 
\end{document}
manjurul
  • 303
  • Is the nVSD2e document class available online somewhere? If so, where? – Mico Oct 22 '17 at 08:49
  • Hi Mico, here is the link for the nVSD2e.cls [https://www.dropbox.com/s/1bq1kyj5ga9zf3f/nVSD2e.cls?dl=0] – manjurul Oct 22 '17 at 08:53
  • Is the mcode package available online? – Mico Oct 22 '17 at 08:57
  • Thanks, that works. but if I would like to keep the nVSD2e.cls, do you konw how I should \newcommand or something so that it woks for my case? – manjurul Oct 22 '17 at 08:57
  • here is the mcode link: [https://www.dropbox.com/s/9o9ibt15013fipt/mcode.sty?dl=0] – manjurul Oct 22 '17 at 08:59
  • Yes, now I have shorted the code. if I use nVSD2e as documentclass, the bookmarking in PDF file works perfectly fine. But If I use article as documentclass, the bookmarking in PDF file does NOT work. – manjurul Oct 22 '17 at 09:12
  • Did you mean to write this the other way round, i.e., you get bookmarks if the article document class is used but not if the nVSD2e document class is used? (At least, that's the result on my system -- TeXlive2017...) – Mico Oct 22 '17 at 09:17
  • Exactly, Mico. You are right. But, the problem is, I need to use nVSD2e document class while I would, at the same time, like to get the bookmarking in PDF. – manjurul Oct 22 '17 at 09:23
  • Thanks, Mico. I am going to do as you have said. Probably I would also send link to this page, so that they know what I am trying to explain. – manjurul Oct 22 '17 at 09:59
  • 1
    The nVSD2e class is very, very, very, very strange. Don't use it. –  Oct 22 '17 at 15:05
  • For my information : what is a bookmark? – Karlo Mar 04 '20 at 12:04

1 Answers1

8

The nVSD2e class is very weird, defining a lot of strange things, even having an own version of \document, but the culprit is that tocdepth is set to 0 since there is no explicit code like \setcounter{tocdepth}{3} as in article.cls so the default value of 0is applied, meaning that only chapters or parts enter the .toc or bookmarks, but the nVSD2e class does not even provide \chapter or \part macros.

There is no \tableofcontents or \listoffigures etc. command, no \contentsname defined.

The whole class looks like glued together without proper understanding of TeX/LaTeX.

In short: Setting tocdepth to a value higher than 0, i.e. 2 or 3 etc. settles this issue, depending on the desired ToC leveling. (See How to hide/show section levels in the table of contents? for more on this topic.)

\documentclass{nVSD2e}

\setcounter{tocdepth}{2}

\usepackage[bookmarksopen=true,bookmarks=true]{hyperref}
\usepackage{bookmark}


\title{How well does?}

\author{I.S.Hould Not Use This Class}

\begin{document}
\maketitle


\begin{abstract}
    The effect is very easy to construct.   
\end{abstract}

See \ref{intro}

\section{Introduction} \label{intro}
jack for none.
\section{Procedure}
here it is.. 
\end{document}

enter image description here