2

There are reference citation entries that span more than one line. Since I compile with LaTeX -> PS -> PDF, the links created by hyperref are not correctly displayed in the output file (pdf). To fix this issue, I added \usepackage{hypdvips} in my preamble. But I am not getting the links (at the same time I am getting links for toc that span more than one line)

Here is my minimal working example:

\documentclass{book}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[draft=false,dvips,ps2pdf=true,colorlinks,pdfborderstyle={/S/U/W 0},bookmarksnumbered,bookmarksopen=false,unicode=true,pdfpagelabels=false]{hyperref}%
\usepackage[emptypagelabels=false]{hypdvips}
\makeatletter
\renewcommand*{\Hy@backout}[1]{}
\providecommand*{\backrefsetup}[1]{}
\makeatother

\begin{document}

The second breakthrough was the development of the semiconductor laser.
Demonstrations of laser action\enlargethispage{12pt}
in semiconductors were reported in \citet*{Hall1962}, in \citet*{Nathan1962}, in
\citet*{Holonyak1962}, and in \citet*{Quist1962}.
All of the papers were independently submitted within a span of less than three months in 1962. The practical breakthrough of the first
continuous-wave room-temperature semiconductor laser was reported by
\citet*{Alferov1970}.

\begin{thebibliography}{}
\bibitem[\protect\citeauthoryear{Hall, Fenner, Kingsley, Soltys, and Carlson}{Hall et~al.}{1962}]{Hall1962}
Hall, R.~N., G.~E. Fenner, J.~D. Kingsley, T.~J. Soltys, and R.~O. Carlson.
\newblock Coherent light emission from {Ga--As} junctions.
\newblock \textit{Physics Review Letters}, 9(9):366--8, 1962.

\bibitem[\protect\citeauthoryear{Nathan, Dumke, Burns, Dill, and Lasher}{Nathan et~al.}{1962}]{Nathan1962}
Nathan, M., W.~Dumke, G.~Burns, F.~Dill, and G.~Lasher.
\newblock Stimulated emission of radiation from {GaAs P--N} junctions.
\newblock \textit{Applied Physics Letters}, 1(3):62--4, 1962.

\bibitem[Holonyak and Bevacqua(1962)]{Holonyak1962}
Holonyak, N. and S.~F. Bevacqua.
\newblock Coherent (visible) light emission from {$\textrm{Ga}(\textrm{As}_{1 - x}\textrm{P}_x)$} junctions.
\newblock \textit{Applied Physics Letters}, 1(4):82--3, 1962.

\bibitem[\protect\citeauthoryear{Quist, Rediker, Keyes, Krag, Lax, and
  Zeigler}{Quist et~al.}{1962}]{Quist1962}
Quist, T.~M., R.~H. Rediker, R.~J. Keyes, W.~E. Krag, B.~Lax, A.~L. McWhorter, and H.~J. Zeigler.
\newblock Semiconductor maser of {GaAs}.
\newblock \textit{Applied Physics Letters}, 1(4):91--2, 1962.

\bibitem[\protect\citeauthoryear{Alferov, Andreev, Portnoi, and Turkan}{Alferov et~al.}{1970}]{Alferov1970}
Alferov, Zh.~I., V.~M. Andreev, E.~L. Portnoi, and M.~K. Turkan.
\newblock {AlAs--GaAs} heterojunction injection lasers with a low room-temperature threshold.
\newblock \textit{Soviet Physics Semiconductors}, \hbox{3:460--3}, 1970.

\end{thebibliography}
\end{document} 

I tried to modify on the below, but I am not able to modify

\def\hyper@natlinkstart#1{%
  \Hy@backout{#1}%
  \hyper@linkstart{cite}{cite.#1}%
  \def\hyper@nat@current{#1}%
}

In the below image I have highlighted the broken links

Please check and advise how to rectify the broken link issue

enter image description here

10
  • 1
    This will works if you use PDFLaTeX instead of dvips, PS2PDF...
    – MadyYuvi
    Mar 29, 2019 at 9:32
  • @ MadyYuvi, is possible to do through dvips method?
    – pdy_tam
    Mar 29, 2019 at 9:39
  • This problem related with dvips driver mode, hope till now it was not fixed, but some one may know how to fix it, will wait for better suggestions...
    – MadyYuvi
    Mar 29, 2019 at 9:41
  • @ MadyYuvi, at the same time it is working for toc entries is more than one line
    – pdy_tam
    Mar 29, 2019 at 9:43
  • 3
    Make a bug report to the maintainer of hypdvips. Apr 2, 2019 at 10:01

1 Answer 1

1

I got solution and simply modified in the natbib package

i changed \NAT@hyper@ to \hyper@@link{}{cite.@citeb@extra@b@citeb} to get the break links

  \def\NAT@citex%
  [#1][#2]#3{%
  \NAT@reset@parser
  \NAT@sort@cites{#3}%
  \NAT@reset@citea
  \@cite{\let\NAT@nm\@empty\let\NAT@year\@empty
    \@for\@citeb:=\NAT@cite@list\do
    {\@safe@activestrue
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \@safe@activesfalse
     \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
       {\reset@font\bfseries ?}\NAT@citeundefined
                 \PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}\def\NAT@date{}}%
     {\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
      \NAT@parse{\@citeb}%
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
     \ifNAT@full\let\NAT@nm\NAT@all@names\else
       \let\NAT@nm\NAT@name\fi
     \ifNAT@swa\ifcase\NAT@ctype
       \if\relax\NAT@date\relax
         \@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}\NAT@date}%
       \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year
              \def\NAT@temp{{?}}%
              \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
               {Multiple citation on page \thepage: same authors and
               year\MessageBreak without distinguishing extra
               letter,\MessageBreak appears as question mark}\fi
              \NAT@hyper@{\NAT@exlab}%
            \else\unskip\NAT@spacechar
              \NAT@hyper@{\NAT@date}%
            \fi
         \else
           \@citea\hyper@@link{}{cite.\@citeb\@extra@b@citeb}{\NAT@nmfmt{\NAT@nm}}%%%%changed to \hyper@@link
               \NAT@aysep\NAT@spacechar%
               \NAT@hyper@{\NAT@date}%
         \fi
       \fi
     \or\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
     \or\@citea\NAT@hyper@{\NAT@date}%
     \or\@citea\NAT@hyper@{\NAT@alias}%
     \fi \NAT@def@citea
     \else
       \ifcase\NAT@ctype
        \if\relax\NAT@date\relax
          \@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
        \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year
              \def\NAT@temp{{?}}%
              \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
               {Multiple citation on page \thepage: same authors and
               year\MessageBreak without distinguishing extra
               letter,\MessageBreak appears as question mark}\fi
              \NAT@hyper@{\NAT@exlab}%
            \else
              \unskip\NAT@spacechar
              \NAT@hyper@{\NAT@date}%
            \fi
         \else
           \@citea{%
             \hyper@@link{}{cite.\@citeb\@extra@b@citeb}{\NAT@nmfmt{\NAT@nm}}%%%%%changed to \hyper@@link
             {\NAT@spacechar\NAT@@open\if*#1*\else#1\NAT@spacechar\fi}%
             %  {\@citeb\@extra@b@citeb}%
             \NAT@hyper@{\NAT@date}%
           }%
         \fi
        \fi
       \or\@citea\hyper@@link{}{cite.\@citeb\@extra@b@citeb}{\NAT@nmfmt{\NAT@nm}}%%%%%changed to \hyper@@link
       \or\@citea\NAT@hyper@{\NAT@date}%
       \or\@citea\NAT@hyper@{\NAT@alias}%
       \fi
       \if\relax\NAT@date\relax
         \NAT@def@citea
       \else
         \NAT@def@citea@close
       \fi
     \fi
     }}\ifNAT@swa\else\if*#2*\else\NAT@cmt#2\fi
     \if\relax\NAT@date\relax\else\NAT@@close\fi\fi}{#1}{#2}}
1
  • Well try...keep going...
    – MadyYuvi
    Jul 23, 2019 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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