0

By compiling the following code

\documentclass{report}
\usepackage{lipsum}
\usepackage{amsthm}
\usepackage[many]{tcolorbox}
\usepackage[dvips,colorlinks,bookmarks,breaklinks]{hyperref}
\usepackage[capitalize,nameinlink]{cleveref}
\usepackage{longfbox}

\newtcolorbox[auto counter,number within=chapter,crefname={theorem}{theorems}]{theo}[2][]{%
breakable,enhanced,colback=blue!5!white,
colframe=blue!75!black,
colbacktitle=cyan!50!green,
coltitle=blue!25!black,
fonttitle=\bfseries,
subtitle style={boxrule=0.4pt,colback=cyan!50!red!25!white},title=Theorem~\thetcbcounter~#2,label=#1}

\begin{document}

\begin{theo}[mytheo]{(My Theorem)}
\lipsum
\end{theo}

Here is my \Cref{mytheo}.

\end{document}

the red link of "Theorem 0.1" in page 2 of the pdf file leads to the top of this page and not to the initial box theorem in page 1. Why?

The problem is: I need to compile the file as dvi->ps->pdf...

2
  • If I typeset with pdflatex (dvips option needs to be removed from hyperref), clicking the link takes me precisely to the top of the theorem in Evince PDF viewer.
    – AlexG
    Mar 9, 2022 at 19:59
  • The problem is: I need to compile the file as dvi->ps->pdf... How I can solve this? C.W.
    – C.W.
    Mar 10, 2022 at 8:35

1 Answer 1

0

This is my suggestion.

You can try to label that particular place with \label{Theo} for example and put \phantomsection alongside with the label. Afterwards use \ref{Theo} to reference the theorem and see if it links directly to the box as required.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .