summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pdfcomment
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-03-14 23:23:54 +0000
committerKarl Berry <karl@freefriends.org>2012-03-14 23:23:54 +0000
commit7ae8d02f3d6d6c4c97fc8c8cba605d61c863a2b8 (patch)
treeff781c8af7977a26066b486de1d84a48d13e4ce2 /Master/texmf-dist/tex/latex/pdfcomment
parent18dc1f4a0a1c103c9edf4869c2abc951195e2fbf (diff)
pdfcomment 2.3 (14mar12)
git-svn-id: svn://tug.org/texlive/trunk@25643 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pdfcomment')
-rw-r--r--Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty659
1 files changed, 301 insertions, 358 deletions
diff --git a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty
index cf3ee93d4df..e74f9bac466 100644
--- a/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty
+++ b/Master/texmf-dist/tex/latex/pdfcomment/pdfcomment.sty
@@ -20,7 +20,7 @@
%% This work consists of all files listed in manifest.txt.
%%
%
-\ProvidesPackage{pdfcomment}[2012/01/25 pdfcomment.sty v2.2a - Josef Kleber (C) 2008-2012]%
+\ProvidesPackage{pdfcomment}[2012/03/13 pdfcomment.sty v2.3 - Josef Kleber (C) 2008-2012]%
%
\RequirePackage{xkeyval}%
%
@@ -162,25 +162,26 @@
\newif\ifpc@annot@secondpage\pc@annot@secondpagefalse%
\newif\ifpc@afterpage\pc@afterpagefalse%
\newif\ifpc@ignorespaces\pc@ignorespacesfalse%
+\newif\ifpc@local\pc@localfalse%
+\newif\ifpc@firstcolumn\pc@firstcolumntrue%
+\newif\ifpc@Sfirstcolumn\pc@Sfirstcolumntrue%
+\newif\ifpc@Efirstcolumn\pc@Efirstcolumntrue%
%
-\newcounter{pc@annot@lines}%
+\newcounter{pc@count@i}%
+\newcounter{pc@count@ii}%
+\newcounter{pc@count@iii}%
+\newcounter{pc@count@iv}%
%
\newbox\pc@mathannot@box%
%
\newlength{\pc@dima}%
\newlength{\pc@dimb}%
-\newlength{\pc@dimc}%
-\newlength{\pc@dimd}%
-\newlength{\pc@dime}%
-\newlength{\pc@dimf}%
-\newlength{\pc@dimg}%
-\newlength{\pc@dimh}%
-\newlength{\pc@dimi}%
%
\newlength{\pc@Sposx}%
\newlength{\pc@Sposy}%
\newlength{\pc@Eposx}%
\newlength{\pc@Eposy}%
+\newlength{\pc@column}%
\newlength{\pc@box@width}%
\newlength{\pc@box@height}%
\newlength{\pc@box@depth}%
@@ -193,22 +194,6 @@
\newcommand{\pc@y@two}{}%
\newcommand{\pc@y@three}{}%
\newcommand{\pc@y@four}{}%
-\newcommand{\pc@anna@x@one}{}%
-\newcommand{\pc@anna@x@two}{}%
-\newcommand{\pc@anna@x@three}{}%
-\newcommand{\pc@anna@x@four}{}%
-\newcommand{\pc@anna@y@one}{}%
-\newcommand{\pc@anna@y@two}{}%
-\newcommand{\pc@anna@y@three}{}%
-\newcommand{\pc@anna@y@four}{}%
-\newcommand{\pc@annb@x@one}{}%
-\newcommand{\pc@annb@x@two}{}%
-\newcommand{\pc@annb@x@three}{}%
-\newcommand{\pc@annb@x@four}{}%
-\newcommand{\pc@annb@y@one}{}%
-\newcommand{\pc@annb@y@two}{}%
-\newcommand{\pc@annb@y@three}{}%
-\newcommand{\pc@annb@y@four}{}%
%
\newcommand{\pc@x@left@text}{}%
\newcommand{\pc@x@right@text}{}%
@@ -1287,20 +1272,20 @@
%
\define@key{pdfcomment.sty}{final}[]%
{%
- \pc@gopt@finaltrue%
+ \global\pc@gopt@finaltrue%
}%
%
\define@key{pdfcomment.sty}{draft}[]%
{%
- \pc@gopt@finalfalse%
+ \global\pc@gopt@finalfalse%
}%
%
\define@choicekey{pdfcomment.sty}{version}[\pc@version\nr]{1,2}[2]%
{%
\ifcase\nr\relax%
- \pc@opt@unskipfalse%
+ \global\pc@opt@unskipfalse%
\or%
- \pc@opt@unskiptrue%
+ \global\pc@opt@unskiptrue%
\fi%
}%
%
@@ -1319,6 +1304,15 @@
\gdef\pc@lopt@replyto{#1}%
}%
%
+\define@choicekey*{pdfcommentsetup}{local}[\pc@local\nr]{true,false}[true]%
+{%
+ \ifcase\nr\relax%
+ \global\pc@localtrue%
+ \or%
+ \global\pc@localfalse%
+ \fi%
+}%
+%
\define@key{listofpdfcomments}{liststyle}[AuthorSubject]%
{%
\gdef\pc@lopt@liststyle{#1}%
@@ -1335,11 +1329,13 @@
%
\RequirePackage{zref-savepos}[2007/04/22]%
\zref@require@unique%
+\RequirePackage{refcount}%
\RequirePackage{ifthen}%
\RequirePackage{calc}%
\RequirePackage{marginnote}%
\RequirePackage{ifpdf}%
\RequirePackage{datetime}%
+\RequirePackage{soulpos}%
%
%hyperref setup
\ifpdf%
@@ -1398,7 +1394,8 @@
}%
\newcommand{\pdfcomment}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1498,7 +1495,8 @@
%
\newcommand{\pdfmargincomment}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1545,7 +1543,7 @@
{%
/Subtype /Text%
\pc@annot@text%
- }
+ }%
\ifthenelse{\equal{\pc@lopt@id}{}}%
{}%
{%
@@ -1606,7 +1604,8 @@
%
\newcommand{\pdffreetextcomment}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1720,7 +1719,8 @@
%
\newcommand{\pdfsquarecomment}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1835,7 +1835,8 @@
%
\newcommand{\pdfcirclecomment}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -1951,7 +1952,8 @@
%
\newcommand{\pdflinecomment}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -2089,14 +2091,14 @@
{%
\gdef\pc@lopt@cdate{/CreationDate (\pc@lopt@date)\space/M (\pc@lopt@date)}%
}%
- \zsavepos{pdfcomment:\thezref@unique}%
- \zref@refused{pdfcomment:\thezref@unique}%
- \setlength{\pc@Sposx}{\zposx{pdfcomment:\thezref@unique}sp}%
- \setlength{\pc@Sposy}{\zposy{pdfcomment:\thezref@unique}sp}%
- \refstepcounter{zref@unique}%
- \setlength{\pc@Eposx}{\zposx{pdfcomment:\thezref@unique}sp}%
- \setlength{\pc@Eposy}{\zposy{pdfcomment:\thezref@unique}sp}%
\ifmmode%
+ \zsavepos{pdfcomment:\thezref@unique}%
+ \zref@refused{pdfcomment:\thezref@unique}%
+ \setlength{\pc@Sposx}{\zposx{pdfcomment:\thezref@unique}sp}%
+ \setlength{\pc@Sposy}{\zposy{pdfcomment:\thezref@unique}sp}%
+ \stepcounter{zref@unique}%
+ \setlength{\pc@Eposx}{\zposx{pdfcomment:\thezref@unique}sp}%
+ \setlength{\pc@Eposy}{\zposy{pdfcomment:\thezref@unique}sp}%
\ifpc@gopt@final\else%
\ifpc@lopt@disable\else%
%changed \pc@encode@PDF, \pdfstringdef does not work in math mode
@@ -2158,6 +2160,9 @@
#2\global\pc@ignorespacesfalse%
\fi%
\fi%
+ \zsavepos{pdfcomment:\thezref@unique}%
+ \zref@refused{pdfcomment:\thezref@unique}%
+ \stepcounter{zref@unique}%
\else%
\pc@encode@PDF{#3}%
\settoheight{\pc@box@height}{#2}%
@@ -2168,45 +2173,27 @@
{%
\settodepth{\pc@box@depth}{#2}%
}%
- \ifdim\pc@Sposy<\pc@Eposy%
- \pc@annot@samepagefalse%
- \else%
- \pc@annot@samepagetrue%
- \fi%
- \ifpc@annot@samepage\else%
- \ifpc@gopt@final\else%
- \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%
- \ifpc@lopt@disable\else%
- \pc@create@lpc%
- \fi%
- \fi%
+ \def\SOUL@preamble%
+ {%
+ \def\ulp@skern{0pt}%
+ \def\ulp@ekern{0pt}%
+ \def\ulp@sgap{0pt}%
+ \def\ulp@egap{0pt}%
+ \def\ulp@pos{\z@}%
+ \def\ulp@draw{\pc@soul@markup}%
+ \ulp@preamble%
+ }%
+ \let\SOUL@postamble\ulp@postamble%
+ \let\SOUL@everyspace\ulp@everyspace%
+ \let\SOUL@everyhyphen\ulp@everyhyphen%
+ \let\SOUL@everyexhyphen\ulp@everyexhyphen%
+ \let\SOUL@everysyllable\@empty%
+ \def\SOUL@everytoken{\the\SOUL@token}%
\ifpc@gopt@final%
\ifthenelse{\equal{\pc@lopt@markup}{StrikeOut}}%
{%
\ifthenelse{\equal{\pc@lopt@printSOfinal}{true}}%
- {#2\global\pc@ignorespacesfalse}%
+ {\SOUL@{#2}\global\pc@ignorespacesfalse}%
{\global\pc@ignorespacestrue}%
}%
{%
@@ -2224,45 +2211,13 @@
#2\global\pc@ignorespacesfalse%
}%
\else%
- #2\global\pc@ignorespacesfalse%
+ \SOUL@{#2}\global\pc@ignorespacesfalse%
\fi%
\fi%
- \zsavepos{pdfcomment:\thezref@unique}%
- \zref@refused{pdfcomment:\thezref@unique}%
- \refstepcounter{zref@unique}%
- \ifpc@gopt@final\else%
- \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
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {%
- \xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,A}%
- }%
- \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%
+ \ifpc@gopt@final\else%
+ \ifpc@lopt@disable\else%
+ \pc@create@lpc%
\fi%
\fi%
%only local!
@@ -2278,7 +2233,8 @@
%
\newenvironment{pdfsidelinecomment}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -2329,59 +2285,155 @@
\gdef\pc@lopt@cp{}%
\gdef\pc@lopt@co{}%
}%
- \zsavepos{pdfcomment:\thezref@unique}%
- \zref@refused{pdfcomment:\thezref@unique}%
- \setlength{\pc@Sposy}{\zposy{pdfcomment:\thezref@unique}sp}%
- \refstepcounter{zref@unique}%
- \setlength{\pc@Eposy}{\zposy{pdfcomment:\thezref@unique}sp}%
+ \zsavepos{pdfcomment:slc:\thepc@count@iv}%
+ \zref@refused{pdfcomment:slc:\thepc@count@iv}%
+ \setlength{\pc@Sposx}{\zposx{pdfcomment:slc:\thepc@count@iv}sp}%
+ \setlength{\pc@Sposy}{\zposy{pdfcomment:slc:\thepc@count@iv}sp}%
+ \stepcounter{pc@count@iv}%
+ \setlength{\pc@Eposx}{\zposx{pdfcomment:slc:\thepc@count@iv}sp}%
+ \setlength{\pc@Eposy}{\zposy{pdfcomment:slc:\thepc@count@iv}sp}%
\settoheight{\pc@box@height}{Tq}%
\settoheight{\pc@box@depth}{Tq}%
- \ifdim\pc@Sposy<\pc@Eposy\relax%
- \pc@annot@samepagefalse%
+ \stepcounter{pc@count@i}%
+ \label{pdfcomment:pageS:\thepc@count@i}%
+ \refused{pdfcomment:pageS:\thepc@count@i}%
+ \gdef\pc@pS{\getpagerefnumber{pdfcomment:pageS:\thepc@count@i}}%
+ \gdef\pc@pE{\getpagerefnumber{pdfcomment:pageE:\thepc@count@i}}%
+ \ifthenelse{\equal{\pc@pS}{\pc@pE}}%
+ {\global\pc@annot@samepagetrue}%
+ {\global\pc@annot@samepagefalse}%
+ \global\pc@firstcolumntrue%
+ \pc@calc@textblockpos%
+ \setlength{\pc@column}{\pc@x@right@text bp}%
+ \addtolength{\pc@column}{3pt}%
+ \ifnum\pc@Sposx<\pc@column%
+ \global\pc@Sfirstcolumntrue%
+ \else%
+ \global\pc@Sfirstcolumnfalse%
+ \fi%
+ \ifnum\pc@Eposx<\pc@column%
+ \global\pc@Efirstcolumntrue%
\else%
- \pc@annot@samepagetrue%
+ \global\pc@Efirstcolumnfalse%
\fi%
\ifpc@annot@samepage\else%
\ifpc@gopt@final\else%
\ifpc@lopt@disable\else%
- \pc@annot@secondpagefalse%
- \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}%
+ % 1st part of annotation on 1st page
+ \if@twocolumn%
+ \ifpc@Sfirstcolumn%
+ \PackageError{pdfcomment}{%
+ \string\pdfsidelinecomment\space supports only one\MessageBreak%
+ column or page break in twocolumn mode!!\MessageBreak%
+ Your comment is too long!}%
+ \else%
+ % start in second column
+ \global\pc@annot@secondpagefalse%
+ \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}%
+ \fi%
+ \else%
+ \global\pc@annot@secondpagefalse%
+ \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%
\fi%
}%
{%
- \zsavepos{pdfcomment:\thezref@unique}%
- \zref@refused{pdfcomment:\thezref@unique}%
- \refstepcounter{zref@unique}%
+ \zsavepos{pdfcomment:slc:\thepc@count@iv}%
+ \zref@refused{pdfcomment:slc:\thepc@count@iv}%
+ \label{pdfcomment:pageE:\thepc@count@i}%
+ \refused{pdfcomment:pageE:\thepc@count@i}%
+ \stepcounter{pc@count@iv}%
\ifpc@gopt@final\else%
\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}%
+ \if@twocolumn%
+ \ifpc@Sfirstcolumn%
+ \ifpc@Efirstcolumn%
+ % complete in first column
+ \global\pc@firstcolumntrue%
+ \pc@calc@sidelinepos%
+ \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@lpc\pc@create@annot@sideline}%
+ \else%
+ % column break
+ \global\pc@firstcolumntrue%
+ \pc@calc@sidelinepos%
+ \renewcommand{\pc@y@two}{\pc@y@bottom@text}%
+ \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@lpc\pc@create@annot@sideline}%
+ \global\pc@firstcolumnfalse%
+ \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}%
+ \fi%
+ \else%
+ \ifpc@Efirstcolumn%
+ % not possible
+ \else%
+ % complete in seconds column
+ \global\pc@firstcolumnfalse%
+ \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}%
+ \fi%
+ \fi%
+ \else%
+ \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}%
+ \fi%
\else%
- \pc@annot@secondpagetrue%
- \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}%
+ % 2nd part of annotation on 2nd page
+ \if@twocolumn%
+ \ifpc@Efirstcolumn%
+ % end in first column
+ \global\pc@firstcolumntrue%
+ \global\pc@annot@secondpagetrue%
+ \pc@calc@sidelinepos%
+ \renewcommand{\pc@y@one}{\pc@y@top@text}%
+ \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}%
+ \else%
+ \PackageError{pdfcomment}{%
+ \string\pdfsidelinecomment\space supports only one\MessageBreak%
+ column or page break in twocolumn mode!\MessageBreak%
+ Your comment is too long!}%
+ \fi%
+ \else%
+ \global\pc@annot@secondpagetrue%
+ \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%
\fi%
@@ -2392,7 +2444,8 @@
%
\newcommand{\pdfreply}[2][]%
{%
- \ifpc@opt@unskip\unskip\fi%
+ \ifhmode\ifpc@opt@unskip\unskip\fi\fi%
+ \ifvmode\leavevmode\fi%
% Copy all global options to local options
\pc@copy@gopt@lopt%
% Change local options if specified
@@ -2420,13 +2473,13 @@
%\pc@create@lpc%
% typeset text annotation (see: PDF Reference)
\xdef\pc@zref@PDFOBJID{\pc@get@PDFOBJID{\pc@lopt@replyto}}%
- \pc@afterpagefalse%
+ \global\pc@afterpagefalse%
\ifpdf%
\@for\pc@for@PDFOBJID:={\pc@zref@PDFOBJID}\do%
{%
\ifthenelse{\equal{\pc@for@PDFOBJID}{A}}%
{%
- \pc@afterpagetrue%
+ \global\pc@afterpagetrue%
\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,A}%
}%
{%
@@ -2490,7 +2543,7 @@
\setkeys{pdftooltip}{#1}%
\ifmmode%
\marginnote{\pc@encode@PDF@math{#3}}%
- \ifpc@lopt@disable
+ \ifpc@lopt@disable%
#2%
\else%
\settowidth{\pc@box@width}{$\pc@lopt@mathstyle#2$}%
@@ -2558,16 +2611,25 @@
\fi%
\fi%
\fi%
- \refstepcounter{zref@unique}%
+ \stepcounter{zref@unique}%
%only local!
\gdef\pc@lopt@mathstyle{}%
}%
%
% reset global options
-\newcommand{\pdfcommentsetup}[1]%
+\newcommand{\pdfcommentsetup}[2][]%
{%
+ \setkeys{pdfcommentsetup}{#1}%
+ \ifpc@local%
+ \edef\pc@local@gd{\the\globaldefs}%
+ \globaldefs=-1%
+ \fi%
% Change global options if specified
- \setkeys{pdfcomment.sty}{#1}%
+ \setkeys{pdfcomment.sty}{#2}%
+ \ifpc@local%
+ \globaldefs=\pc@local@gd%
+ \fi%
+ \global\pc@localfalse%
}%
%
% define predefined set of options (Avatar)
@@ -2657,7 +2719,7 @@
{%
\zref@labelbylist{#1}{pdfcomment}%
}%
-\newcommand*{\pc@get@PDFOBJID}[1]
+\newcommand*{\pc@get@PDFOBJID}[1]%
{%
\zref@extract{#1}{PCPDFOBJID}%
}%
@@ -2706,7 +2768,7 @@
\gdef\pc@lopt@timezone{\pc@gopt@timezone}%
\gdef\pc@lopt@id{}%
\gdef\pc@collect@PDFOBJID{S}%
- \pc@lopt@disablefalse%
+ \global\pc@lopt@disablefalse%
\gdef\pc@lopt@printSOfinal{\pc@gopt@printSOfinal}%
\ifpc@gopt@disable%
\global\pc@lopt@disabletrue%
@@ -2882,7 +2944,7 @@
{%
pdfmark=/ANN,%
Subtype=/\pc@lopt@markup,%
- Raw={
+ Raw={%
/C [\pc@hyenc@color]\space%
\pc@lopt@cdate\space%
/CA \pc@lopt@opacity\space%
@@ -2900,6 +2962,7 @@
{%
/TU (\pc@pdfenc@contents)\space%
/T (tooltip \thezref@unique)\space%
+ /C [0 0 0]\space%
/FT/Btn\space%
/Ff/65536\space%
/H/N\space%
@@ -2940,30 +3003,6 @@
\pc@pdfdate@edef%
}%
%
-\newcommand{\pc@copy@xy@to@anna}%
-{%
- \renewcommand{\pc@anna@x@one}{\pc@x@one}%
- \renewcommand{\pc@anna@x@two}{\pc@x@two}%
- \renewcommand{\pc@anna@x@three}{\pc@x@three}%
- \renewcommand{\pc@anna@x@four}{\pc@x@four}%
- \renewcommand{\pc@anna@y@one}{\pc@y@one}%
- \renewcommand{\pc@anna@y@two}{\pc@y@two}%
- \renewcommand{\pc@anna@y@three}{\pc@y@three}%
- \renewcommand{\pc@anna@y@four}{\pc@y@four}%
-}%
-%
-\newcommand{\pc@copy@anna@to@annb}%
-{%
- \renewcommand{\pc@annb@x@one}{\pc@anna@x@one}%
- \renewcommand{\pc@annb@x@two}{\pc@anna@x@two}%
- \renewcommand{\pc@annb@x@three}{\pc@anna@x@three}%
- \renewcommand{\pc@annb@x@four}{\pc@anna@x@four}%
- \renewcommand{\pc@annb@y@one}{\pc@anna@y@one}%
- \renewcommand{\pc@annb@y@two}{\pc@anna@y@two}%
- \renewcommand{\pc@annb@y@three}{\pc@anna@y@three}%
- \renewcommand{\pc@annb@y@four}{\pc@anna@y@four}%
-}%
-%
\newcommand{\pc@annot@calc@pos}%
{%
\renewcommand{\pc@x@one}{\pc@pttobp{\pc@Sposx}}%
@@ -3070,194 +3109,95 @@
\fi%
}%
%
-\newcommand{\pc@create@annot}%
+\newcommand{\pc@annot@complete}%
{%
- \ifdim\pc@dima=\pc@dimb%
- {% one line
- \pc@copy@anna@to@annb%
- \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@two\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@four}%
- \ifpdf%
- \pc@annot@markup@pdf%
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
+ \renewcommand{\pc@x@one}{\pc@pttobp{\pc@Sposx}}%
+ \renewcommand{\pc@x@two}{\pc@pttobp{\pc@Eposx}}%
+ \renewcommand{\pc@x@three}{\pc@pttobp{\pc@Sposx}}%
+ \renewcommand{\pc@x@four}{\pc@pttobp{\pc@Eposx}}%
+ \renewcommand{\pc@y@one}{\pc@pttobp{\dimexpr \pc@Sposy + \pc@box@height + 1pt\relax}}%
+ \renewcommand{\pc@y@two}{\pc@pttobp{\dimexpr \pc@Eposy + \pc@box@height + 1pt\relax}}%
+ \renewcommand{\pc@y@three}{\pc@pttobp{\dimexpr \pc@Sposy - \pc@box@depth - 1pt\relax}}%
+ \renewcommand{\pc@y@four}{\pc@pttobp{\dimexpr \pc@Eposy - \pc@box@depth - 1pt\relax}}%
+ \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%
+ \ifthenelse{\equal{\pc@lopt@id}{}}%
+ {}%
+ {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
+ \else%
+ \ifpc@gopt@dvipdfmx%
+ \pc@annot@markup@dvipdfmx%
\else%
- \ifpc@gopt@dvipdfmx%
- \pc@annot@markup@dvipdfmx%
- \else%
- \pc@annot@markup@dvips%
- \fi%
+ \pc@annot@markup@dvips%
\fi%
+ \fi%
+}%
+%
+\newcommand*{\pc@soul@markup}%
+{%
+ \stepcounter{pc@count@iii}%
+ \zsavepos{pdfcomment_soul_markup:\thepc@count@iii}%
+ \zref@refused{pdfcomment_soul_markup:\thepc@count@iii}%
+ \setlength{\pc@Sposx}{\zposx{pdfcomment_soul_markup:\thepc@count@iii}sp}%
+ \setlength{\pc@Sposy}{\zposy{pdfcomment_soul_markup:\thepc@count@iii}sp}%
+ \ifthenelse{\equal{\pc@lopt@markup}{StrikeOut}}%
+ {%
+ \addtolength{\pc@Sposy}{1pt}%
}%
- \else%
- {% more lines
- %first line
- \pc@calc@textblockpos%
- \pc@copy@anna@to@annb%
- \setlength{\pc@dimf}{\dimexpr \pc@annb@y@one bp\relax}%
- \setlength{\pc@dimg}{\dimexpr \pc@y@top@text bp\relax}%
- \setlength{\pc@dimh}{\pc@dimg-\pc@dimf}%
- \setlength{\pc@dimi}{\pc@dimb-\pc@dimg+\the\baselineskip+\the\baselineskip}%
- % set new right border only if more than 1 line on second page
- \ifdim\pc@dimi<0pt%
- \ifdim\pc@dimh<\the\baselineskip%
- \renewcommand{\pc@annb@x@two}{\pc@x@right@text}%
- \renewcommand{\pc@annb@x@four}{\pc@x@right@text}%
- \fi%
- \fi%
- \ifpc@annot@samepage%
- \renewcommand{\pc@annb@x@two}{\pc@x@right@text}%
- \renewcommand{\pc@annb@x@four}{\pc@x@right@text}%
- \fi%
- \renewcommand{\pc@annb@y@two}{\pc@anna@y@one}%
- \renewcommand{\pc@annb@y@four}{\pc@anna@y@three}%
- \ifthenelse{\equal{\pc@lopt@markup}{StrikeOut}}%
- {%
- \edef\pc@annb@y@four{\pc@pttobp{\dimexpr \pc@annb@y@four bp + 1.5pt\relax}}%
- \edef\pc@annb@y@three{\pc@pttobp{\dimexpr \pc@annb@y@three bp + 1.5pt \relax}}%
- }%
- {}%
- \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@two\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@four}%
- \ifpdf%
- \pc@annot@markup@pdf%
- \ifpc@annot@samepage%
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
- \else%
- \ifpc@annot@secondpage%
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
+ {}%
+ \setlength{\pc@Eposx}{\pc@Sposx}%
+ \addtolength{\pc@Eposx}{\ulwidth}%
+ \setlength{\pc@Eposy}{\pc@Sposy}%
+ \pc@annot@complete%
+}%
+%
+\newcommand{\pc@calc@textblockpos}%
+{%
+ \if@twoside%
+ \stepcounter{pc@count@ii}%
+ \label{pdfcomment:ts:page:\thepc@count@ii}%
+ \refused{pdfcomment:ts:page:\thepc@count@ii}%
+ \ifodd\getpagerefnumber{pdfcomment:ts:page:\thepc@count@ii}%
+ \if@twocolumn%
+ \ifpc@firstcolumn%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin\relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \columnwidth\relax}}%
\else%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth - \columnwidth\relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth\relax}}%
\fi%
- \fi%
- \else%
- \ifpc@gopt@dvipdfmx%
- \pc@annot@markup@dvipdfmx%
\else%
- \pc@annot@markup@dvips%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin\relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth\relax}}%
\fi%
- \fi%
- %last line
- \pc@copy@anna@to@annb%
- \renewcommand{\pc@annb@x@one}{\pc@x@left@text}%
- \renewcommand{\pc@annb@x@three}{\pc@x@left@text}%
- \renewcommand{\pc@annb@y@one}{\pc@anna@y@two}%
- \renewcommand{\pc@annb@y@three}{\pc@anna@y@four}%
- \ifthenelse{\equal{\pc@lopt@markup}{StrikeOut}}%
- {%
- \edef\pc@annb@y@four{\pc@pttobp{\dimexpr \pc@annb@y@four bp + 1.5pt\relax}}%
- \edef\pc@annb@y@three{\pc@pttobp{\dimexpr \pc@annb@y@three bp + 1.5pt \relax}}%
- }%
- {}%
- \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@two\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@four}%
- \setlength{\pc@dimg}{\dimexpr \pc@annb@y@one bp\relax}%
- \setlength{\pc@dimh}{\pc@dimg-\pc@dimf+3pt}%
- % only 1 line on first page? => no annotation for last line
- \ifdim\pc@dimh<0pt%
- \ifpdf%
- \pc@annot@markup@pdf%
- \ifpc@annot@samepage%
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
+ \else%
+ \if@twocolumn%
+ \ifpc@firstcolumn%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin \relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin + \columnwidth\relax}}%
\else%
- \ifpc@annot@secondpage%
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
- \else%
- \fi%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin + \textwidth - \columnwidth \relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin + \textwidth\relax}}%
\fi%
\else%
- \ifpc@gopt@dvipdfmx%
- \pc@annot@markup@dvipdfmx%
- \else%
- \pc@annot@markup@dvips%
- \fi%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin \relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin + \textwidth\relax}}%
\fi%
\fi%
- %middle lines
- \pc@copy@anna@to@annb%
- \setlength{\pc@dimc}{\dimexpr \pc@annb@y@one bp + 0.1pt\relax}%
- \ifpc@annot@samepage%
- \setlength{\pc@dimd}{\dimexpr \pc@annb@y@two bp\relax}%
- \fi%
- \ifpc@annot@secondpage%
- \setlength{\pc@dimd}{\dimexpr \pc@annb@y@two bp\relax}%
- \fi%
- \setcounter{pc@annot@lines}{0}%
- \setlength{\pc@dime}{\pc@dimc}%
- \addtolength{\pc@dime}{-\pc@dimd}%
- % count lines
- \whiledo{\lengthtest{\pc@dime>0pt}}%
- {%
- \stepcounter{pc@annot@lines}%
- \addtolength{\pc@dime}{-\the\baselineskip}%
- }%
- % subtract first and last line
- \addtocounter{pc@annot@lines}{-2}%
- \renewcommand{\pc@annb@x@one}{\pc@x@left@text}%
- \renewcommand{\pc@annb@x@three}{\pc@x@left@text}%
- \renewcommand{\pc@annb@x@two}{\pc@x@right@text}%
- \renewcommand{\pc@annb@x@four}{\pc@x@right@text}%
- \ifpc@annot@secondpage%
- \ifthenelse{\equal{\pc@lopt@markup}{StrikeOut}}%
- {%
- \edef\pc@annb@y@one{\pc@pttobp{\dimexpr \pc@annb@y@one bp - \the\baselineskip + 1.5pt\relax}}%
- \edef\pc@annb@y@three{\pc@pttobp{\dimexpr \pc@annb@y@one bp - \pc@box@depth - \pc@box@height -0.5pt \relax}}%
- }%
- {%
- \edef\pc@annb@y@one{\pc@pttobp{\dimexpr \pc@annb@y@one bp - \the\baselineskip + 2pt\relax}}%
- \edef\pc@annb@y@three{\pc@pttobp{\dimexpr \pc@annb@y@one bp - \pc@box@depth - \pc@box@height -2pt \relax}}%
- }%
- \fi%
- \whiledo{\value{pc@annot@lines}>0}%
- {%
- \addtocounter{pc@annot@lines}{-1}%
- \edef\pc@annb@y@one{\pc@pttobp{\dimexpr \pc@annb@y@one bp - \the\baselineskip \relax}}%
- \edef\pc@annb@y@three{\pc@pttobp{\dimexpr \pc@annb@y@three bp - \the\baselineskip \relax}}%
- \xdef\pc@annot@quadpoints{\pc@annb@x@one\space\pc@annb@y@one\space\pc@annb@x@two\space\pc@annb@y@one\space\pc@annb@x@three\space\pc@annb@y@three\space\pc@annb@x@four\space\pc@annb@y@three}%
- \ifpdf%
- \pc@annot@markup@pdf%
- \ifpc@annot@samepage%
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
- \else%
- \ifpc@annot@secondpage%
- \ifthenelse{\equal{\pc@lopt@id}{}}%
- {}%
- {\xdef\pc@collect@PDFOBJID{\pc@collect@PDFOBJID,\the\pdflastannot}}%
- \else%
- \fi%
- \fi%
+ \else%
+ \if@twocolumn%
+ \ifpc@firstcolumn%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin \relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \columnwidth\relax}}%
\else%
- \ifpc@gopt@dvipdfmx%
- \pc@annot@markup@dvipdfmx%
- \else%
- \pc@annot@markup@dvips%
- \fi%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth - \columnwidth\relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth\relax}}%
\fi%
- }%
- }%
- \fi%
-}%
-%
-\newcommand{\pc@calc@textblockpos}%
-{%
- \if@twoside%
- \ifodd\arabic{page}%
- \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin\relax}}%
- \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth\relax}}%
\else%
- \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin \relax}}%
- \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \evensidemargin + \textwidth\relax}}%
+ \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin \relax}}%
+ \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth\relax}}%
\fi%
- \else%
- \renewcommand{\pc@x@left@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin \relax}}%
- \renewcommand{\pc@x@right@text}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth\relax}}%
\fi%
\renewcommand{\pc@y@top@text}{\pc@pttobp{\dimexpr \paperheight - \dimexpr 1in\relax - \voffset - \topmargin - \headheight - \headsep\relax}}%
\renewcommand{\pc@y@bottom@text}{\pc@pttobp{\dimexpr \paperheight - \dimexpr 1in\relax - \voffset - \topmargin - \headheight - \headsep - \textheight\relax}}%
@@ -3266,7 +3206,10 @@
\newcommand{\pc@calc@sidelinepos}%
{%
\if@twoside%
- \ifodd\arabic{page}%
+ \stepcounter{pc@count@ii}%
+ \label{pdfcomment:ts:page:\thepc@count@ii}%
+ \refused{pdfcomment:ts:page:\thepc@count@ii}%
+ \ifodd\getpagerefnumber{pdfcomment:ts:page:\thepc@count@ii}%
\renewcommand{\pc@x@one}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin - \dimexpr \pc@lopt@linesep bp \relax\relax}}%
\renewcommand{\pc@x@two}{\pc@pttobp{\dimexpr \dimexpr 1in\relax + \hoffset + \oddsidemargin + \textwidth + \dimexpr \pc@lopt@linesep bp \relax\relax}}%
\else%