带有 pdfcomment 的环境

带有 pdfcomment 的环境

pdfcomment环境无法正常工作,仅使用文本即可正常工作paragraph

我的 MWE 是:

\documentclass{article}
\usepackage{amsthm,xcolor}
\usepackage[subject={Top1},author={Daisy Duck},version=1,opacity=0,voffset=8pt,hoffset=-2pt]{pdfcomment}

\theoremstyle{theorem}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}

\def\Added#1{\pdfsquarecomment[author={Added Text:}]{#1}#1}
\def\Deleted#1{\pdfsquarecomment[author={Deleted Text:}]{#1}}
\def\Replaced#1#2{\pdfsquarecomment[author={Replaced Text: #1 with}]{#2}#2}

\def\Commentson{\let\Add\Added\let\Del\Deleted\let\Rep\Replaced}

\begin{document}
\Commentson
Thus leave \Add{open} essentially \Del{just} the \Rep{Cases}{case} of polylogarithmic $r(n)$ (beyond the general constant $r\geq 4$ noted above).

\begin{lemma}[Tannery's Theorem]\label{lem1}
If, for each $i\geq 1$, we have $\lim_{n\to\infty}f_{i}(n)=f_{i}$ and  $|f_i(n)| \leq M_i$ integer-valued sequence $(s_n)$ with $s_n\to\infty$.
\end{lemma}

.... and ....

\begin{lemma}[Tannery's \Del{t}heorem]\label{lem2} %%% Heading is missing in the PDF file when using \Del command
If, for each $i\geq 1$, we have $\lim_{n\to\infty}f_{i}(n)=f_{i}$ and  $|f_i(n)| \leq M_i$ integer-valued sequence $(s_n)$ with $s_n\to\infty$.
\end{lemma}

\end{document}

使用命令时,PDF 文件中缺少引理 2 标题\Del。如何获取支持 的相应 PDF 文件Acobat Reader

答案1

在处理定理标题时,amsthm不需要像这样的奇异命令\pdfcomment。虽然这可能可以通过一些扩展技巧来解决,但您也可以作弊并稍后跳回到标题中,只是为了添加评论。

这稍微复杂一些,因为您需要存储标题的其余部分(以知道需要跳回多远)并且需要调用另一个命令来实际放置评论。

以下两个命令实现了这种方法:

% collect the comment and the rest of the title, typeset the rest of the title
\def\collect#1#2{\xdef\commentarg{#1}\xdef\collected{#2}#2}
% jump left, put a delete comment with the collected comment text, jump right
\def\retrodel{\hspace{\widthof{\collected). }*-1}\Del{\commentarg}\hspace{\widthof{\collected). }}}

梅威瑟:

\documentclass{article}
\usepackage{amsthm,xcolor}
\usepackage[subject={Top1},author={Daisy Duck},version=1,opacity=0,voffset=8pt,hoffset=-2pt]{pdfcomment}

%\theoremstyle{theorem}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}

\def\Added#1{\pdfsquarecomment[author={Added Text:}]{#1}#1}
\def\Deleted#1{\pdfsquarecomment[author={Deleted Text:}]{#1}}
\def\Replaced#1#2{\pdfsquarecomment[author={Replaced Text: #1 with}]{#2}#2}

\def\Commentson{\let\Add\Added\let\Del\Deleted\let\Rep\Replaced}

\def\collect#1#2{\xdef\commentarg{#1}\xdef\collected{#2}#2}
\def\retrodel{\hspace{\widthof{\collected). }*-1}\Del{\commentarg}\hspace{\widthof{\collected). }}}

\begin{document}
\Commentson
Thus leave \Add{open} essentially \Del{just} the \Rep{Cases}{case} of polylogarithmic $r(n)$ (beyond the general constant $r\geq 4$ noted above).

\begin{lemma}[Tannery's Theorem]\label{lem1}
If, for each $i\geq 1$, we have $\lim_{n\to\infty}f_{i}(n)=f_{i}$ and  $|f_i(n)| \leq M_i$ integer-valued sequence $(s_n)$ with $s_n\to\infty$.
\end{lemma}

.... and ....

\begin{lemma}[Tannery's \collect{t}{heorem}]\label{lem2}\retrodel %%% Heading is missing in the PDF file when using \Del command
If, for each $i\geq 1$, we have $\lim_{n\to\infty}f_{i}(n)=f_{i}$ and  $|f_i(n)| \leq M_i$ integer-valued sequence $(s_n)$ with $s_n\to\infty$.
\end{lemma}

\end{document}

结果:

在此处输入图片描述

相关内容