Hyperref 和 oremstyle 中断:上面的线上绘制了红色框

Hyperref 和 oremstyle 中断:上面的线上绘制了红色框

我在文档中使用 hyperref 包来链接,使用 ntheorem 来定理。我想使用“break”定理样式,在定理标签后给出换行符。但是,在我的定理的第一行中使用引用会导致 hyperref 过度绘制红​​色框。

梅威瑟:

\documentclass[]{report}

\usepackage[pdftex]{hyperref}
\usepackage[hyperref]{ntheorem}
\newtheorem{theorem}{Theorem}
\theoremstyle{break}
\newtheorem{lemma}{Lemma}

\begin{document}

\begin{lemma}\label{lem}
    An interesting lemma!
\end{lemma}
\begin{lemma}[Some description]
    Here we refer to lemma \ref{lem}. This causes the red box to overdraw.
\end{lemma}
\begin{theorem}
    Here, we need some more space to get into the second line, but then the link to our lemma \ref{lem} does not pose a problem.
\end{theorem}

\end{document}          

截屏: MWE 截图

有人知道如何解决这个问题吗?谢谢!

答案1

你可以\ref用包围你的\mbox。以下示例中有一个自己的命令。

盒子

\documentclass[]{report}

\usepackage[hyperref]{ntheorem}
\usepackage{hyperref}

\newtheorem{theorem}{Theorem}
\theoremstyle{break}
\newtheorem{lemma}{Lemma}

\newcommand{\lref}[1]{\mbox{\ref{#1}}}

\begin{document}

\begin{lemma}\label{lem}
    An interesting lemma!
\end{lemma}
\begin{lemma}[Some description]
    Here we refer to lemma \lref{lem}. This causes the red box to overdraw.
\end{lemma}
\begin{theorem}
    Here, we need some more space to get into the second line, but then the link to our lemma \lref{lem} does not pose a problem.
\end{theorem}

\end{document}          

答案2

周围框的高度和深度用于获取驱动程序 情况下注释矩形的高度和深度pdftex。引理 2 中链接的周围框包括引理标题行和f中的 下降部分refer。该定理的实现方式不同,因此当前高度要小得多。

用较小的框包围链接可以使矩形更紧密,\mbox。行中的第三个链接将框增大,以获得更均匀的高度和深度。然后,\vphantom链接文本的矩形1将共享相同的高度和深度。mg

\documentclass[]{report}

\usepackage[pdftex]{hyperref}
\usepackage[hyperref]{ntheorem}
\newtheorem{theorem}{Theorem}
\theoremstyle{break}
\newtheorem{lemma}{Lemma}

\begin{document}

\begin{lemma}\label{lem}
    An interesting lemma!
\end{lemma}
\begin{lemma}[Some description]
    Here we refer to lemma
    \ref{lem}/\mbox{\ref{lem}}/\mbox{\vphantom{g\"A}\ref{lem}}.
    This causes the red box to overdraw.
\end{lemma}
\begin{theorem}
    Here, we need some more space to get into the second line,
    but then the link to our lemma
    \ref{lem}/\mbox{\ref{lem}}/\mbox{\vphantom{g\"A}\ref{lem}}
    does not pose a problem.
\end{theorem}

\end{document}

结果

相关内容