[OS X TeX] producing a commentary in TeX of an existing PDF document (various particular items)

Victor Ivrii vivrii at gmail.com
Sat Apr 29 15:18:07 CEST 2006


On 4/29/06, Bernhard Barkow <bb at creativeeyes.at> wrote:
> > On 29.04.2006, at 00:27, Victor Ivrii wrote:
> >>  Using eso-pic package to
> >> include document
> >> \begin{minipage}{0.35\paperwidth}
> >> \color{red}
> >> \title{My remarks}
> >>
> >> BLAH BLAH BLAH
> >> \end{minipage}
> >>
> >> \AddToShipoutPicture*{ \put(200,0){%
> >>   \parbox[b][\paperheight]{\paperwidth}{%
> >>     \vfill
> >>     \centering
> >>    {\includegraphics[width=\paperwidth,height=\paperheight,page=5,%
> >>                      keepaspectratio]{ThatGuyDoc.pdf}}%
> >>     \vfill
> >> }}}
> >
> > below is a quick implementation automating this task a little bit;
> > actually, using LaTeX for such a task seems like a very practicable
> > approach (which never occurred to me), so I might improve this
> > functionality and package this into a style file one day...
>

While automatisation is rather universal, my goal was to provide
comment on the same
page as the original one; to do not just include some page but place
it maximum to the right to have its right margin cut almost completely
leaving me with minipage on the left
to put my comments. An extra page should be added if needed.

Also eso-pic allows me to place a colored writing even on the
commented document.
However since I have a very little control over ThisGuyDoc (just to
move the page or scale it; flipping or rotation does not seem to have
much sense :-) there is a lot of hand-work.

BTW, search and copy-paste cover the in the included document.




> \newcommand{\commentedDocument}{}
> % \setDocName{doc.pdf} defines the external document's name
> \newcommand{\setDocName}[1]{\renewcommand{\commentedDocument}{#1}}
> % currently treated page number
> \newcounter{curpage}
> \setcounter{curpage}{1}
> % \shippage includes the current page
> % and takes care of page numbering issues
> \newcommand{\shippage}{%
>         \setcounter{page}{\thecurpage}%
>         \includeCurPage\addtocounter{curpage}{1}%
>         \addtocounter{page}{-1}%
> }
> \newcommand{\includeCurPage}{%
>         \includepdf[pages=\thecurpage]{\commentedDocument}%
>         \clearpage%
> }
> % \begin{commentedPage}{pageno.} comments \end{commentedPage}
> \newenvironment{commentedPage}[1]{\setcounter{curpage}{#1}\clearpage}%
> {\shippage}
>
> \begin{document}
> % define the name of the included document:
> % this way, commenting on multiple documents is possible
> % (although of questionable feasibility)
> \setDocName{xyz.pdf}
>
> \section{Adding comments to a document}
>
> Here I start my comments.
>
> etc.\ etc.
>
> \shippage
>
> The first page of the original document should now have been
> included; here are the comments regarding the next page, which is
> chosen automatically.
> Setting the counter \verb+curpage+ enables one to choose a specific
> page: e.g., \verb+\setcounter{curpage}{10}+ will select page 10 of
> the original document.
>
> \setcounter{curpage}{10}
>
> \shippage
>
> \begin{commentedPage}{17}
> Some comments to an arbitrarily chosen page (page 17 in this case),
> using an alternative form (using an environment).
> \end{commentedPage}
>
> \end{document}
>
>
> ____________________________________________________
> _________________________________ Bernhard Barkow __
> ___________________ gpg key ID _ A89F09C45921020D __
>
>
>
>
> ------------------------- Info --------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>           & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
>
>


--
========================
Victor Ivrii, Department of Mathematics, University of Toronto
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list