我在文档中使用 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}
有人知道如何解决这个问题吗?谢谢!
答案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
将共享相同的高度和深度。m
g
\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}