summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pdfcomment
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-10 00:34:00 +0000
committerKarl Berry <karl@freefriends.org>2010-11-10 00:34:00 +0000
commit3b2f26271608630ca56a88b528a1004f51535ea3 (patch)
tree28e000ad2d66a09a7123c86cbaaf10cac7dd42ed /Master/texmf-dist/tex/latex/pdfcomment
parent6a43749c68fb713c7747927e2dbce5fecebeef41 (diff)
pdfcomment (9nov10)
git-svn-id: svn://tug.org/texlive/trunk@20389 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pdfcomment')
-rw-r--r--Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty882
1 files changed, 480 insertions, 402 deletions
diff --git a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty
index 072a3e6cb1c..73fadc2184d 100644
--- a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty
+++ b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty
@@ -15,12 +15,12 @@
%%
%% This work has the LPPL maintenance status "author-maintained".
%%
-%% This Current Maintainer of this work is Josef Kleber.
+%% The Current Maintainer of this work is Josef Kleber.
%%
%% This work consists of all files listed in manifest.txt.
%%
%
-\ProvidesPackage{pdfcomment}[2010/08/15 pdfcomment.sty v1.6 - Josef Kleber (C) 2008-2010]%
+\ProvidesPackage{pdfcomment}[2010/11/08 pdfcomment.sty v2.0 - Josef Kleber (C) 2008-2010]%
%
\RequirePackage{xkeyval}%
%
@@ -57,6 +57,7 @@
\gdef\pc@goptd@captionhoffset{0pt}%
\gdef\pc@goptd@captionvoffset{0pt}%
\gdef\pc@goptd@linesep{0.5cm}%
+\gdef\pc@goptd@disable{false}%
\gdef\pc@goptd@dvipdfmx{true}%
%
% values for global package options
@@ -92,6 +93,7 @@
\gdef\pc@gopt@captionhoffset{}%
\gdef\pc@gopt@captionvoffset{}%
\gdef\pc@gopt@linesep{}%
+\gdef\pc@gopt@disable{}%
%
% values for local command options
\gdef\pc@lopt@subject{}%
@@ -127,6 +129,7 @@
\gdef\pc@lopt@captionvoffset{}%
\gdef\pc@lopt@linesep{}%
\gdef\pc@lopt@mathstyle{}%
+\gdef\pc@lopt@disable{}%
%
\gdef\pc@lopt@c{}%
\gdef\pc@lopt@ic{}%
@@ -138,6 +141,8 @@
%
\newif\ifpc@gopt@dvipdfmx\pc@gopt@dvipdfmxfalse%
\newif\ifpc@gopt@final\pc@gopt@finalfalse%
+\newif\ifpc@lopt@disable\pc@lopt@disablefalse%
+\newif\ifpc@opt@unskip\pc@opt@unskiptrue%
\newif\ifpc@annot@samepage\pc@annot@samepagetrue%
\newif\ifpc@annot@secondpage\pc@annot@secondpagefalse%
%
@@ -189,6 +194,8 @@
\newcommand{\pc@y@top@text}{}%
\newcommand{\pc@y@bottom@text}{}%
%
+\gdef\pc@version{}%
+%
\newcommand{\pc@raggedleftmarginnote}{\centering}%
\newcommand{\pc@raggedrightmarginnote}{\centering}%
%
@@ -386,16 +393,24 @@
\pc@define@key@icon{pdflinecomment}%
\pc@define@key@icon{pdfsidelinecomment}%
%
-\define@key{pdfcomment.sty}{open}[\pc@goptd@open]%
+\define@choicekey*{pdfcomment.sty}{open}[\pc@gopt@open\nr]{true,false}[false]%
{%
- \gdef\pc@gopt@open{#1}%
+ \ifcase\nr\relax%
+ \gdef\pc@gopt@open{true}%
+ \or%
+ \gdef\pc@gopt@open{false}%
+ \fi%
}%
%
\newcommand\pc@define@key@open[1]%
{%
- \define@key{#1}{open}[\pc@gopt@open]%
+ \define@choicekey*{#1}{open}[\pc@lopt@open\nr]{true,false}[true]%
{%
- \gdef\pc@lopt@open{##1}%
+ \ifcase\nr\relax%
+ \gdef\pc@lopt@open{true}%
+ \or%
+ \gdef\pc@lopt@open{false}%
+ \fi%
}%
}%
%
@@ -1044,14 +1059,30 @@
\pc@define@key@linesep{pdflinecomment}%
\pc@define@key@linesep{pdfsidelinecomment}%
%
-\define@key{pdfcomment.sty}{dvipdfmx}[\pc@goptd@dvipdfmx]%
+\newcommand\pc@define@key@disable[1]%
{%
- \expandafter\global\csname pc@gopt@dvipdfmx#1\endcsname%
+ \define@choicekey*{#1}{disable}[\pc@lopt@disable\nr]{true,false}[true]%
+ {%
+ \ifcase\nr\relax%
+ \global\pc@lopt@disabletrue%
+ \or%
+ \global\pc@lopt@disablefalse%
+ \fi%
+ }%
}%
%
-\define@key{pdfmarkupcomment}{mathstyle}%
+\pc@define@key@disable{pdfcomment}%
+\pc@define@key@disable{pdfmargincomment}%
+\pc@define@key@disable{pdffreetextcomment}%
+\pc@define@key@disable{pdfmarkupcomment}%
+\pc@define@key@disable{pdfsquarecomment}%
+\pc@define@key@disable{pdfcirclecomment}%
+\pc@define@key@disable{pdflinecomment}%
+\pc@define@key@disable{pdfsidelinecomment}%
+%
+\define@key{pdfcomment.sty}{dvipdfmx}[\pc@goptd@dvipdfmx]%
{%
- \gdef\pc@lopt@mathstyle{#1}%
+ \expandafter\global\csname pc@gopt@dvipdfmx#1\endcsname%
}%
%
\define@key{pdfcomment.sty}{final}[]%
@@ -1064,6 +1095,20 @@
\pc@gopt@finalfalse%
}%
%
+\define@choicekey{pdfcomment.sty}{version}[\pc@version\nr]{1,2}[2]%
+{%
+ \ifcase\nr\relax%
+ \pc@opt@unskipfalse%
+ \or%
+ \pc@opt@unskiptrue%
+ \fi%
+}%
+%
+\define@key{pdfmarkupcomment}{mathstyle}%
+{%
+ \gdef\pc@lopt@mathstyle{#1}%
+}%
+%
\define@key{listofpdfcomments}{liststyle}[AuthorSubject]%
{%
\gdef\pc@lopt@liststyle{#1}%
@@ -1074,7 +1119,7 @@
\renewcommand{\lpcname}{#1}%
}%
%
-\ExecuteOptionsX{subject,color,author,deadline,icon,open,hspace,voffset,hoffset,width,height,depth,opacity,markup,font,fontsize,fontcolor,justification,borderstyle,linewidth,dashstyle,bse,bsei,type,lineend,linebegin,icolor,line,caption,captionhoffset,captionvoffset,linesep}%
+\ExecuteOptionsX{subject,color,author,deadline,icon,open,hspace,voffset,hoffset,width,height,depth,opacity,markup,font,fontsize,fontcolor,justification,borderstyle,linewidth,dashstyle,bse,bsei,type,lineend,linebegin,icolor,line,caption,captionhoffset,captionvoffset,linesep,version}%
%
\ProcessOptionsX\relax%
%
@@ -1138,9 +1183,11 @@
\disable@keys{pdfcomment.sty}{draft}%
\disable@keys{pdfcomment.sty}{final}%
\disable@keys{pdfcomment.sty}{dvipdfmx}%
+ \disable@keys{pdfcomment.sty}{version}%
}%
\newcommand{\pdfcomment}[2][]%
{%
+ \ifpc@opt@unskip\unskip\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1156,29 +1203,11 @@
\gdef\pc@lopt@c{/C [\pc@hyenc@color]}%
}%
\ifpc@gopt@final\else%
- \hspace*{0pt}%
- \pc@create@lpc%
- % typeset text annotation (see: PDF Reference)
- \ifpdf%
- \vbox%
- {%
- \hsize=0pt%
- \noindent%
- \vspace{\pc@lopt@voffset}%
- \hbox to 0pt%
- {%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pdfannot width 0pt height \normalbaselineskip depth 0pt%
- {%
- /Subtype /Text%
- \pc@annot@text%
- }%
- \hss%
- }%
- }%
- \else%
- \ifpc@gopt@dvipdfmx%
+ \ifpc@lopt@disable\else%
+ \hspace*{0pt}%
+ \pc@create@lpc%
+ % typeset text annotation (see: PDF Reference)
+ \ifpdf%
\vbox%
{%
\hsize=0pt%
@@ -1188,43 +1217,64 @@
{%
\vsize=0pt%
\hskip\pc@lopt@hoffset%
- \special{pdf: ann width 0pt\space height \the\normalbaselineskip\space depth 0pt%
- <<%
- /Subtype /Text%
- \pc@annot@text%
- >>%
+ \pdfannot width 0pt height \normalbaselineskip depth 0pt%
+ {%
+ /Subtype /Text%
+ \pc@annot@text%
}%
\hss%
}%
}%
\else%
- \vbox%
- {%
- \hsize=0pt%
- \noindent%
- \vspace{\pc@lopt@voffset}%
- \vspace{\normalbaselineskip}%
- \hbox to 0pt%
+ \ifpc@gopt@dvipdfmx%
+ \vbox%
{%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pdfmark[\rule{0pt}{0pt}]%
+ \hsize=0pt%
+ \noindent%
+ \vspace{\pc@lopt@voffset}%
+ \hbox to 0pt%
{%
- pdfmark=/ANN,%
- Subtype=/Text,%
- Raw={\pc@annot@text}%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \special{pdf: ann width 0pt\space height \the\normalbaselineskip\space depth 0pt%
+ <<%
+ /Subtype /Text%
+ \pc@annot@text%
+ >>%
+ }%
+ \hss%
}%
- \hss%
}%
- }%
+ \else%
+ \vbox%
+ {%
+ \hsize=0pt%
+ \noindent%
+ \vspace{\pc@lopt@voffset}%
+ \vspace{\normalbaselineskip}%
+ \hbox to 0pt%
+ {%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pdfmark[\rule{0pt}{0pt}]%
+ {%
+ pdfmark=/ANN,%
+ Subtype=/Text,%
+ Raw={\pc@annot@text}%
+ }%
+ \hss%
+ }%
+ }%
+ \fi%
\fi%
+ \hspace{\pc@lopt@hspace}%
\fi%
- \hspace{\pc@lopt@hspace}%
\fi%
}%
%
\newcommand{\pdfmargincomment}[2][]%
{%
+ \ifpc@opt@unskip\unskip\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1240,35 +1290,17 @@
\gdef\pc@lopt@c{/C [\pc@hyenc@color]}%
}%
\ifpc@gopt@final\else%
- \hspace*{0pt}%
- \pc@create@lpc%
- \begingroup%
- % center marginnotes!
- \renewcommand{\raggedleftmarginnote}{\pc@raggedleftmarginnote}%
- \renewcommand{\raggedrightmarginnote}{\pc@raggedrightmarginnote}%
- % typeset text annotation (see: PDF Reference)
- \marginnote%
- {%
- \ifpdf%
- \vbox%
- {%
- \hsize=0pt%
- \noindent%
- \vspace{\pc@lopt@voffset}%
- \hbox to 0pt%
- {%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pdfannot width 0pt height \normalbaselineskip depth 0pt%
- {%
- /Subtype /Text%
- \pc@annot@text%
- }
- \hss%
- }%
- }%
- \else%
- \ifpc@gopt@dvipdfmx%
+ \ifpc@lopt@disable\else%
+ \hspace*{0pt}%
+ \pc@create@lpc%
+ \begingroup%
+ % center marginnotes!
+ \renewcommand{\raggedleftmarginnote}{\pc@raggedleftmarginnote}%
+ \renewcommand{\raggedrightmarginnote}{\pc@raggedrightmarginnote}%
+ % typeset text annotation (see: PDF Reference)
+ \marginnote%
+ {%
+ \ifpdf%
\vbox%
{%
\hsize=0pt%
@@ -1278,45 +1310,66 @@
{%
\vsize=0pt%
\hskip\pc@lopt@hoffset%
- \special{pdf: ann width 0pt\space height \the\normalbaselineskip\space depth 0pt%
- <<%
- /Subtype /Text%
- \pc@annot@text%
- >>%
- }%
+ \pdfannot width 0pt height \normalbaselineskip depth 0pt%
+ {%
+ /Subtype /Text%
+ \pc@annot@text%
+ }
\hss%
}%
}%
\else%
- \vbox%
- {%
- \hsize=0pt%
- \noindent%
- \vspace{\pc@lopt@voffset}%
- \vspace{\normalbaselineskip}%
- \hbox to 0pt%
+ \ifpc@gopt@dvipdfmx%
+ \vbox%
{%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pdfmark[\rule{0pt}{0pt}]%
+ \hsize=0pt%
+ \noindent%
+ \vspace{\pc@lopt@voffset}%
+ \hbox to 0pt%
{%
- pdfmark=/ANN,%
- Subtype=/Text,%
- Raw={\pc@annot@text}%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \special{pdf: ann width 0pt\space height \the\normalbaselineskip\space depth 0pt%
+ <<%
+ /Subtype /Text%
+ \pc@annot@text%
+ >>%
+ }%
+ \hss%
}%
- \hss%
}%
- }%
+ \else%
+ \vbox%
+ {%
+ \hsize=0pt%
+ \noindent%
+ \vspace{\pc@lopt@voffset}%
+ \vspace{\normalbaselineskip}%
+ \hbox to 0pt%
+ {%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pdfmark[\rule{0pt}{0pt}]%
+ {%
+ pdfmark=/ANN,%
+ Subtype=/Text,%
+ Raw={\pc@annot@text}%
+ }%
+ \hss%
+ }%
+ }%
+ \fi%
\fi%
- \fi%
- \hspace{\pc@lopt@hspace}%
- }%
- \endgroup%
+ \hspace{\pc@lopt@hspace}%
+ }%
+ \endgroup%
+ \fi%
\fi%
}%
%
\newcommand{\pdffreetextcomment}[2][]%
{%
+ \ifpc@opt@unskip\unskip\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1340,30 +1393,10 @@
%create options for \pdfannot
\pc@create@pdfannotopt%
\ifpc@gopt@final\else%
- \hspace*{0pt}%
- % typeset freetext annotation (see: PDF Reference)
- \ifpdf%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \vskip-\pc@lopt@voffset%
- \hbox to 0pt%
- {%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pc@create@lpc%
- \expandafter\pdfannot \pc@pdfannotopt%
- {%
- /Subtype /FreeText%
- \pc@annot@freetext%
- }%
- \hss%
- }%
- \vss%
- }%
- \else%
- \ifpc@gopt@dvipdfmx%
+ \ifpc@lopt@disable\else%
+ \hspace*{0pt}%
+ % typeset freetext annotation (see: PDF Reference)
+ \ifpdf%
\vbox to 0pt%
{%
\hsize=0pt%
@@ -1374,47 +1407,70 @@
\vsize=0pt%
\hskip\pc@lopt@hoffset%
\pc@create@lpc%
- \special{pdf: ann \pc@pdfannotopt%
- <<%
- /Subtype /FreeText%
- \pc@annot@freetext%
- >>%
+ \expandafter\pdfannot \pc@pdfannotopt%
+ {%
+ /Subtype /FreeText%
+ \pc@annot@freetext%
}%
- \hss%
+ \hss%
}%
- \vss%
+ \vss%
}%
\else%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \vskip-\pc@lopt@voffset%
- % add extra \vskip box height because of different reference point
- \vskip-\pc@lopt@height%
- \hbox to 0pt%
+ \ifpc@gopt@dvipdfmx%
+ \vbox to 0pt%
{%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pc@create@lpc%
- %create dimensions of annotation
- \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ \hsize=0pt%
+ \noindent%
+ \vskip-\pc@lopt@voffset%
+ \hbox to 0pt%
{%
- pdfmark=/ANN,%
- Subtype=/FreeText,%
- Raw={\pc@annot@freetext}%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pc@create@lpc%
+ \special{pdf: ann \pc@pdfannotopt%
+ <<%
+ /Subtype /FreeText%
+ \pc@annot@freetext%
+ >>%
+ }%
+ \hss%
}%
- \hss%
+ \vss%
}%
- \vss%
- }%
+ \else%
+ \vbox to 0pt%
+ {%
+ \hsize=0pt%
+ \noindent%
+ \vskip-\pc@lopt@voffset%
+ % add extra \vskip box height because of different reference point
+ \vskip-\pc@lopt@height%
+ \hbox to 0pt%
+ {%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pc@create@lpc%
+ %create dimensions of annotation
+ \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ {%
+ pdfmark=/ANN,%
+ Subtype=/FreeText,%
+ Raw={\pc@annot@freetext}%
+ }%
+ \hss%
+ }%
+ \vss%
+ }%
+ \fi%
\fi%
- \fi%
+ \fi%
\fi%
}%
%
\newcommand{\pdfsquarecomment}[2][]%
{%
+ \ifpc@opt@unskip\unskip\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1439,30 +1495,10 @@
%create options for \pdfannot
\pc@create@pdfannotopt%
\ifpc@gopt@final\else%
- \hspace*{0pt}%
- % typeset square annotation (see: PDF Reference)
- \ifpdf%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \vskip-\pc@lopt@voffset%
- \hbox to 0pt%
- {%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pc@create@lpc%
- \expandafter\pdfannot \pc@pdfannotopt%
- {%
- /Subtype /Square\space%
- \pc@annot@square%
- }%
- \hss%
- }%
- \vss%
- }%
- \else%
- \ifpc@gopt@dvipdfmx%
+ \ifpc@lopt@disable\else%
+ \hspace*{0pt}%
+ % typeset square annotation (see: PDF Reference)
+ \ifpdf%
\vbox to 0pt%
{%
\hsize=0pt%
@@ -1473,47 +1509,70 @@
\vsize=0pt%
\hskip\pc@lopt@hoffset%
\pc@create@lpc%
- \special{pdf: ann \pc@pdfannotopt%
- <<%
- /Subtype /Square\space%
- \pc@annot@square%
- >>%
+ \expandafter\pdfannot \pc@pdfannotopt%
+ {%
+ /Subtype /Square\space%
+ \pc@annot@square%
}%
\hss%
}%
\vss%
}%
\else%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \vskip-\pc@lopt@voffset%
- % add extra \vskip box height because of different reference point
- \vskip-\pc@lopt@height%
- \hbox to 0pt%
+ \ifpc@gopt@dvipdfmx%
+ \vbox to 0pt%
{%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pc@create@lpc%
- %create dimensions of annotation
- \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ \hsize=0pt%
+ \noindent%
+ \vskip-\pc@lopt@voffset%
+ \hbox to 0pt%
{%
- pdfmark=/ANN,%
- Subtype=/Square,%
- Raw={\pc@annot@square}%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pc@create@lpc%
+ \special{pdf: ann \pc@pdfannotopt%
+ <<%
+ /Subtype /Square\space%
+ \pc@annot@square%
+ >>%
+ }%
+ \hss%
}%
- \hss%
+ \vss%
}%
- \vss%
- }%
+ \else%
+ \vbox to 0pt%
+ {%
+ \hsize=0pt%
+ \noindent%
+ \vskip-\pc@lopt@voffset%
+ % add extra \vskip box height because of different reference point
+ \vskip-\pc@lopt@height%
+ \hbox to 0pt%
+ {%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pc@create@lpc%
+ %create dimensions of annotation
+ \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ {%
+ pdfmark=/ANN,%
+ Subtype=/Square,%
+ Raw={\pc@annot@square}%
+ }%
+ \hss%
+ }%
+ \vss%
+ }%
+ \fi%
\fi%
- \fi%
+ \fi%
\fi%
}%
%
\newcommand{\pdfcirclecomment}[2][]%
{%
+ \ifpc@opt@unskip\unskip\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1538,31 +1597,10 @@
%create options for \pdfannot
\pc@create@pdfannotopt%
\ifpc@gopt@final\else%
- \hspace*{0pt}%
- % typeset circle annotation (see: PDF Reference)
- \ifpdf%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \vskip-\pc@lopt@voffset%
- \hbox to 0pt%
- {%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pc@create@lpc%
- \expandafter\pdfannot \pc@pdfannotopt%
- {%
- /Subtype /Circle\space%
- % circle and square annatations differ only in /Subtype, so ...
- \pc@annot@square%
- }%
- \hss%
- }%
- \vss%
- }%
- \else%
- \ifpc@gopt@dvipdfmx%
+ \ifpc@lopt@disable\else%
+ \hspace*{0pt}%
+ % typeset circle annotation (see: PDF Reference)
+ \ifpdf%
\vbox to 0pt%
{%
\hsize=0pt%
@@ -1573,47 +1611,71 @@
\vsize=0pt%
\hskip\pc@lopt@hoffset%
\pc@create@lpc%
- \special{pdf: ann \pc@pdfannotopt%
- <<%
- /Subtype /Circle\space%
- \pc@annot@square%
- >>%
+ \expandafter\pdfannot \pc@pdfannotopt%
+ {%
+ /Subtype /Circle\space%
+ % circle and square annatations differ only in /Subtype, so ...
+ \pc@annot@square%
}%
\hss%
}%
\vss%
}%
\else%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \vskip-\pc@lopt@voffset%
- % add extra \vskip box height because of different reference point
- \vskip-\pc@lopt@height%
- \hbox to 0pt%
+ \ifpc@gopt@dvipdfmx%
+ \vbox to 0pt%
{%
- \vsize=0pt%
- \hskip\pc@lopt@hoffset%
- \pc@create@lpc%
- %create dimensions of annotation
- \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ \hsize=0pt%
+ \noindent%
+ \vskip-\pc@lopt@voffset%
+ \hbox to 0pt%
{%
- pdfmark=/ANN,%
- Subtype=/Circle,%
- Raw={\pc@annot@square}%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pc@create@lpc%
+ \special{pdf: ann \pc@pdfannotopt%
+ <<%
+ /Subtype /Circle\space%
+ \pc@annot@square%
+ >>%
+ }%
+ \hss%
}%
- \hss%
+ \vss%
}%
- \vss%
- }%
+ \else%
+ \vbox to 0pt%
+ {%
+ \hsize=0pt%
+ \noindent%
+ \vskip-\pc@lopt@voffset%
+ % add extra \vskip box height because of different reference point
+ \vskip-\pc@lopt@height%
+ \hbox to 0pt%
+ {%
+ \vsize=0pt%
+ \hskip\pc@lopt@hoffset%
+ \pc@create@lpc%
+ %create dimensions of annotation
+ \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ {%
+ pdfmark=/ANN,%
+ Subtype=/Circle,%
+ Raw={\pc@annot@square}%
+ }%
+ \hss%
+ }%
+ \vss%
+ }%
+ \fi%
\fi%
- \fi%
+ \fi%
\fi%
}%
%
\newcommand{\pdflinecomment}[2][]%
{%
+ \ifpc@opt@unskip\unskip\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1659,28 +1721,11 @@
%create options for \pdfannot
\pc@create@pdfannotopt%
\ifpc@gopt@final\else%
- \hspace*{0pt}%
- \pc@create@lpc%
- % typeset line annotation (see: PDF Reference)
- \ifpdf%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \hbox to 0pt%
- {%
- \vsize=0pt%
- \expandafter\pdfannot \pc@pdfannotopt%
- {%
- /Subtype /\pc@lopt@type\space%
- \pc@annot@line%
- }%
- \hss%
- }%
- \vss%
- }%
- \else%
- \ifpc@gopt@dvipdfmx%
+ \ifpc@lopt@disable\else%
+ \hspace*{0pt}%
+ \pc@create@lpc%
+ % typeset line annotation (see: PDF Reference)
+ \ifpdf%
\vbox to 0pt%
{%
\hsize=0pt%
@@ -1688,37 +1733,56 @@
\hbox to 0pt%
{%
\vsize=0pt%
- \special{pdf: ann \pc@pdfannotopt%
- <<%
- /Subtype /\pc@lopt@type\space%
- \pc@annot@line%
- >>%
+ \expandafter\pdfannot \pc@pdfannotopt%
+ {%
+ /Subtype /\pc@lopt@type\space%
+ \pc@annot@line%
}%
\hss%
}%
\vss%
}%
\else%
- \vbox to 0pt%
- {%
- \hsize=0pt%
- \noindent%
- \hbox to 0pt%
+ \ifpc@gopt@dvipdfmx%
+ \vbox to 0pt%
{%
- \vsize=0pt%
- %create dimensions of annotation
- \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ \hsize=0pt%
+ \noindent%
+ \hbox to 0pt%
{%
- pdfmark=/ANN,%
- Subtype=/\pc@lopt@type,%
- Raw={\pc@annot@line}%
+ \vsize=0pt%
+ \special{pdf: ann \pc@pdfannotopt%
+ <<%
+ /Subtype /\pc@lopt@type\space%
+ \pc@annot@line%
+ >>%
+ }%
+ \hss%
}%
- \hss%
+ \vss%
}%
- \vss%
- }%
+ \else%
+ \vbox to 0pt%
+ {%
+ \hsize=0pt%
+ \noindent%
+ \hbox to 0pt%
+ {%
+ \vsize=0pt%
+ %create dimensions of annotation
+ \pdfmark[\rule{0pt}{\pc@lopt@height}\rule{\pc@lopt@width}{0pt}]%
+ {%
+ pdfmark=/ANN,%
+ Subtype=/\pc@lopt@type,%
+ Raw={\pc@annot@line}%
+ }%
+ \hss%
+ }%
+ \vss%
+ }%
+ \fi%
\fi%
- \fi%
+ \fi%
\fi%
}%
%
@@ -1738,36 +1802,38 @@
\setlength{\pc@Eposy}{\zposy{pdfcomment:\thezref@unique}sp}%
\ifmmode%
\ifpc@gopt@final\else%
- %changed \pc@encode@PDF, \pdfstringdef does not work in math mode
- \marginnote{\pc@encode@PDF@math{#3}}%
- \HyColor@XZeroOneThreeFour{\pc@lopt@color}{\pc@hyenc@color}{pdfcomment}{color}%
- \HyColor@XZeroOneThreeFour{\pc@lopt@fontcolor}{\pc@hyenc@fontcolor}{pdfcomment}{color}%
- \HyColor@XZeroOneThreeFour{\pc@lopt@icolor}{\pc@hyenc@icolor}{pdfcomment}{color}%
- \settowidth{\pc@box@width}{$\pc@lopt@mathstyle#2$}%
- \settoheight{\pc@box@height}{$\pc@lopt@mathstyle#2$}%
- \settodepth{\pc@box@depth}{$\pc@lopt@mathstyle#2$}%
- \setbox\pc@mathannot@box=\hbox to\pc@box@width%
- {%
- \vrule height\pc@box@height depth\pc@box@depth width\z@%
- \hfill%
- \pc@annot@calc@pos@math%
- \xdef\pc@annot@quadpoints{\pc@x@one\space\pc@y@one\space\pc@x@two\space\pc@y@two\space\pc@x@three\space\pc@y@three\space\pc@x@four\space\pc@y@four}%
- \ifpdf%
- \pc@annot@markup@pdf%
- \else%
- \ifpc@gopt@dvipdfmx%
- \pc@annot@markup@dvipdfmx%
+ \ifpc@lopt@disable\else%
+ %changed \pc@encode@PDF, \pdfstringdef does not work in math mode
+ \marginnote{\pc@encode@PDF@math{#3}}%
+ \HyColor@XZeroOneThreeFour{\pc@lopt@color}{\pc@hyenc@color}{pdfcomment}{color}%
+ \HyColor@XZeroOneThreeFour{\pc@lopt@fontcolor}{\pc@hyenc@fontcolor}{pdfcomment}{color}%
+ \HyColor@XZeroOneThreeFour{\pc@lopt@icolor}{\pc@hyenc@icolor}{pdfcomment}{color}%
+ \settowidth{\pc@box@width}{$\pc@lopt@mathstyle#2$}%
+ \settoheight{\pc@box@height}{$\pc@lopt@mathstyle#2$}%
+ \settodepth{\pc@box@depth}{$\pc@lopt@mathstyle#2$}%
+ \setbox\pc@mathannot@box=\hbox to\pc@box@width%
+ {%
+ \vrule height\pc@box@height depth\pc@box@depth width\z@%
+ \hfill%
+ \pc@annot@calc@pos@math%
+ \xdef\pc@annot@quadpoints{\pc@x@one\space\pc@y@one\space\pc@x@two\space\pc@y@two\space\pc@x@three\space\pc@y@three\space\pc@x@four\space\pc@y@four}%
+ \ifpdf%
+ \pc@annot@markup@pdf%
\else%
- \pc@annot@markup@dvips%
+ \ifpc@gopt@dvipdfmx%
+ \pc@annot@markup@dvipdfmx%
+ \else%
+ \pc@annot@markup@dvips%
+ \fi%
\fi%
- \fi%
- }%
- \wd\pc@mathannot@box\z@%
- \ht\pc@mathannot@box\z@%
- \dp\pc@mathannot@box\z@%
- \box\pc@mathannot@box%
- \nobreak%
- \fi%
+ }%
+ \wd\pc@mathannot@box\z@%
+ \ht\pc@mathannot@box\z@%
+ \dp\pc@mathannot@box\z@%
+ \box\pc@mathannot@box%
+ \nobreak%
+ \fi%
+ \fi%
#2%
\else%
\pc@encode@PDF{#3}%
@@ -1786,59 +1852,65 @@
\fi%
\ifpc@annot@samepage\else%
\ifpc@gopt@final\else%
- % 1st part of annotation on 1st page
- \pc@annot@calc@pos%
- \pc@copy@xy@to@anna%
- \renewcommand{\pc@anna@x@two}{\pc@x@right@text}%
- \renewcommand{\pc@anna@x@four}{\pc@x@right@text}%
- %calculate baseline of last line (not necessarily bottom text block!)
- \setlength\pc@dimc{\dimexpr \dimexpr \pc@anna@y@three bp \relax\relax}%
- \setlength\pc@dimd{\dimexpr \paperheight - \dimexpr 1in\relax - \voffset - \topmargin - \headheight - \headsep - \textheight\relax}%
- \whiledo{\lengthtest{\pc@dimc>\pc@dimd}}%
- {%
- \addtolength\pc@dimc{-\the\baselineskip}%
- }%
- % one too much
- \addtolength\pc@dimc{\the\baselineskip}%
- \renewcommand{\pc@anna@y@four}{\pc@pttobp{\pc@dimc}}%
- \renewcommand{\pc@anna@y@two}{\pc@pttobp{\pc@dimc + \pc@box@depth + \pc@box@height +2pt}}%
- \pc@annot@secondpagefalse%
- \pc@create@annot%
- \fi%
+ \ifpc@lopt@disable\else%
+ % 1st part of annotation on 1st page
+ \pc@annot@calc@pos%
+ \pc@copy@xy@to@anna%
+ \renewcommand{\pc@anna@x@two}{\pc@x@right@text}%
+ \renewcommand{\pc@anna@x@four}{\pc@x@right@text}%
+ %calculate baseline of last line (not necessarily bottom text block!)
+ \setlength\pc@dimc{\dimexpr \dimexpr \pc@anna@y@three bp \relax\relax}%
+ \setlength\pc@dimd{\dimexpr \paperheight - \dimexpr 1in\relax - \voffset - \topmargin - \headheight - \headsep - \textheight\relax}%
+ \whiledo{\lengthtest{\pc@dimc>\pc@dimd}}%
+ {%
+ \addtolength\pc@dimc{-\the\baselineskip}%
+ }%
+ % one too much
+ \addtolength\pc@dimc{\the\baselineskip}%
+ \renewcommand{\pc@anna@y@four}{\pc@pttobp{\pc@dimc}}%
+ \renewcommand{\pc@anna@y@two}{\pc@pttobp{\pc@dimc + \pc@box@depth + \pc@box@height +2pt}}%
+ \pc@annot@secondpagefalse%
+ \pc@create@annot%
+ \fi%
+ \fi%
\fi%
\ifpc@gopt@final\else%
- \pc@create@lpc%
+ \ifpc@lopt@disable\else%
+ \pc@create@lpc%
+ \fi%
\fi%
#2%
\zsavepos{pdfcomment:\thezref@unique}%
\zref@refused{pdfcomment:\thezref@unique}%
\refstepcounter{zref@unique}%
\ifpc@gopt@final\else%
- \ifpc@annot@samepage%
- % annot complete on one page
- \pc@annot@calc@pos%
- \pc@copy@xy@to@anna%
- \pc@annot@secondpagefalse%
- \pc@create@annot%
- \else%
- % 2nd part of annotation on 2nd page
- \pc@annot@calc@pos%
- \pc@copy@xy@to@anna%
- \renewcommand{\pc@anna@x@one}{\pc@x@left@text}%
- \renewcommand{\pc@anna@x@three}{\pc@x@left@text}%
- \setlength\pc@dimc{\dimexpr \dimexpr \pc@anna@y@four bp \relax\relax}%
- \setlength\pc@dimd{\dimexpr \paperheight - \dimexpr 1in\relax - \voffset - \topmargin - \headheight - \headsep\relax}%
- \whiledo{\lengthtest{\pc@dimc<\pc@dimd}}%
- {%
- \addtolength\pc@dimc{\the\baselineskip}%
- }%
- % two too much
- \addtolength\pc@dimc{-\the\baselineskip}\addtolength\pc@dimc{-\the\baselineskip}%
- \renewcommand{\pc@anna@y@three}{\pc@pttobp{\pc@dimc}}%
- \renewcommand{\pc@anna@y@one}{\pc@pttobp{\pc@dimc + \pc@box@depth + \pc@box@height +2pt}}%
- \pc@annot@secondpagetrue%
- \pc@create@annot%
- \fi%
+ \ifpc@lopt@disable\else%
+ \ifpc@annot@samepage%
+ % annot complete on one page
+ \pc@annot@calc@pos%
+ \pc@copy@xy@to@anna%
+ \pc@annot@secondpagefalse%
+ \pc@create@annot%
+ \else%
+ % 2nd part of annotation on 2nd page
+ \pc@annot@calc@pos%
+ \pc@copy@xy@to@anna%
+ \renewcommand{\pc@anna@x@one}{\pc@x@left@text}%
+ \renewcommand{\pc@anna@x@three}{\pc@x@left@text}%
+ \setlength\pc@dimc{\dimexpr \dimexpr \pc@anna@y@four bp \relax\relax}%
+ \setlength\pc@dimd{\dimexpr \paperheight - \dimexpr 1in\relax - \voffset - \topmargin - \headheight - \headsep\relax}%
+ \whiledo{\lengthtest{\pc@dimc<\pc@dimd}}%
+ {%
+ \addtolength\pc@dimc{\the\baselineskip}%
+ }%
+ % two too much
+ \addtolength\pc@dimc{-\the\baselineskip}\addtolength\pc@dimc{-\the\baselineskip}%
+ \renewcommand{\pc@anna@y@three}{\pc@pttobp{\pc@dimc}}%
+ \renewcommand{\pc@anna@y@one}{\pc@pttobp{\pc@dimc + \pc@box@depth + \pc@box@height +2pt}}%
+ \pc@annot@secondpagetrue%
+ \pc@create@annot%
+ \fi%
+ \fi%
\fi%
\fi%
%only local!
@@ -1847,6 +1919,7 @@
%
\newenvironment{pdfsidelinecomment}[2][]%
{%
+ \ifpc@opt@unskip\unskip\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1904,15 +1977,17 @@
\fi%
\ifpc@annot@samepage\else%
\ifpc@gopt@final\else%
- \pc@calc@sidelinepos%
- \renewcommand{\pc@y@two}{\pc@y@bottom@text}
- \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}%
- \gdef\pc@lopt@le{/LE [\pc@lopt@linebegin\space/None]}%
- \marginnote{\pc@create@lpc\pc@create@annot@sideline}%
- \gdef\pc@lopt@line{\pc@x@one\space\pc@y@two\space\pc@x@one\space\pc@y@one}%
- \gdef\pc@lopt@le{/LE [/None\space\pc@lopt@linebegin]}%
- \marginnote{\pc@create@annot@sideline}%
- \fi%
+ \ifpc@lopt@disable\else%
+ \pc@calc@sidelinepos%
+ \renewcommand{\pc@y@two}{\pc@y@bottom@text}
+ \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}%
+ \gdef\pc@lopt@le{/LE [\pc@lopt@linebegin\space/None]}%
+ \marginnote{\pc@create@lpc\pc@create@annot@sideline}%
+ \gdef\pc@lopt@line{\pc@x@one\space\pc@y@two\space\pc@x@one\space\pc@y@one}%
+ \gdef\pc@lopt@le{/LE [/None\space\pc@lopt@linebegin]}%
+ \marginnote{\pc@create@annot@sideline}%
+ \fi%
+ \fi%
\fi%
}%
{%
@@ -1920,25 +1995,27 @@
\zref@refused{pdfcomment:\thezref@unique}%
\refstepcounter{zref@unique}%
\ifpc@gopt@final\else%
- \ifpc@annot@samepage%
- % annot complete on one page
- \pc@calc@sidelinepos%
- \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}%
- \gdef\pc@lopt@le{/LE [\pc@lopt@linebegin\space\pc@lopt@lineend]}%
- \marginnote{\pc@create@lpc\pc@create@annot@sideline}%
- \gdef\pc@lopt@line{\pc@x@one\space\pc@y@two\space\pc@x@one\space\pc@y@one}%
- \gdef\pc@lopt@le{/LE [\pc@lopt@lineend\space\pc@lopt@linebegin]}%
- \marginnote{\pc@create@annot@sideline}%
- \else%
- \pc@calc@sidelinepos%
- \renewcommand{\pc@y@one}{\pc@y@top@text}
- \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}%
- \gdef\pc@lopt@le{/LE [/None\space\pc@lopt@lineend]}%
- \marginnote{\pc@create@annot@sideline}%
- \gdef\pc@lopt@line{\pc@x@one\space\pc@y@two\space\pc@x@one\space\pc@y@one}%
- \gdef\pc@lopt@le{/LE [\pc@lopt@lineend\space/None]}%
- \marginnote{\pc@create@annot@sideline}%
- \fi%
+ \ifpc@lopt@disable\else%
+ \ifpc@annot@samepage%
+ % annot complete on one page
+ \pc@calc@sidelinepos%
+ \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}%
+ \gdef\pc@lopt@le{/LE [\pc@lopt@linebegin\space\pc@lopt@lineend]}%
+ \marginnote{\pc@create@lpc\pc@create@annot@sideline}%
+ \gdef\pc@lopt@line{\pc@x@one\space\pc@y@two\space\pc@x@one\space\pc@y@one}%
+ \gdef\pc@lopt@le{/LE [\pc@lopt@lineend\space\pc@lopt@linebegin]}%
+ \marginnote{\pc@create@annot@sideline}%
+ \else%
+ \pc@calc@sidelinepos%
+ \renewcommand{\pc@y@one}{\pc@y@top@text}
+ \gdef\pc@lopt@line{\pc@x@two\space\pc@y@one\space\pc@x@two\space\pc@y@two}%
+ \gdef\pc@lopt@le{/LE [/None\space\pc@lopt@lineend]}%
+ \marginnote{\pc@create@annot@sideline}%
+ \gdef\pc@lopt@line{\pc@x@one\space\pc@y@two\space\pc@x@one\space\pc@y@one}%
+ \gdef\pc@lopt@le{/LE [\pc@lopt@lineend\space/None]}%
+ \marginnote{\pc@create@annot@sideline}%
+ \fi%
+ \fi%
\fi%
}%
%
@@ -2068,6 +2145,7 @@
\gdef\pc@lopt@captionhoffset{\pc@gopt@captionhoffset}%
\gdef\pc@lopt@captionvoffset{\pc@gopt@captionvoffset}%
\gdef\pc@lopt@linesep{\pc@gopt@linesep}%
+ \pc@lopt@disablefalse%
}%
%
\newcommand{\pc@encode@PDF}[1]%