tcolorbox의 정확한 초참조 대상

tcolorbox의 정확한 초참조 대상

패키지를 사용하고 있는데 tcolorbox이 기능으로 인해 attach boxed title to top left하이퍼타겟이 제목 상자 상단이 아닌 기본 상자 상단에 고정되어 있습니다.

즉, 2페이지의 링크를 클릭하면 아래에 제공된 코드(MWE)가 이를 생성합니다. 여기에 이미지 설명을 입력하세요

보시다시피 제목 상자가 "잘려져 있습니다".

질문

hyperref제목 상자 상단에 대상이 정확하게 고정 되도록 하려면 어떻게 패치해야 합니까 ? (이상적으로 솔루션은 에서도 작동해야 합니다 cleveref).

암호:

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage[colorlinks=true]{hyperref}

\NewTColorBox[auto counter]{thmboxB}{O{} O{}}{%
    title = {theorem~(#1)}, 
    enhanced,
    attach boxed title to top left = {yshift = -\tcboxedtitleheight/2, xshift = 5mm},
    top = 1.2em,
    #2
}

\begin{document}
  \begin{thmboxB}[Wow][label=thmB]
  Let $Y$ be a set.
  \end{thmboxB}
  \newpage
  theorem \ref{thmB}
\end{document}

답변1

하이퍼레퍼런스가 앵커를 높이는 양을 늘릴 수 있습니다.

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage[colorlinks=true]{hyperref}

\NewTColorBox[auto counter]{thmboxB}{O{} O{}}{%
    code={\renewcommand\HyperRaiseLinkDefault{2\baselineskip}},%<---
    title = {theorem~(#1)}, 
    enhanced,
    attach boxed title to top left = {yshift = -\tcboxedtitleheight/2, xshift = 5mm},
    top = 1.2em,
    #2
}
\begin{document}
  \begin{thmboxB}[Wow][label=thmB]
  Let $Y$ be a set.
  \end{thmboxB}
  \newpage
  theorem \ref{thmB}
\end{document}

이는 자연스럽게 상자 내부의 모든 앵커에 영향을 미치므로 다시 양을 줄이려면 콘텐츠 부분의 시작 부분에 유사한 코드를 배치하십시오.

관련 정보