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

Bernhard Barkow bb at creativeeyes.at
Sat Apr 29 09:05:47 CEST 2006


Hi again,

On 29.04.2006, at 08:32, Bernhard Barkow wrote:
> On 29.04.2006, at 00:27, Victor Ivrii wrote:
>>> I asked a little while ago about this topic and was pointed  
>>> towards using the class memoir. However, it turns out that that  
>>> will not work in practice so I've decided instead to use the  
>>> original document in the following way:
>>>
>>> 1) create individual pdfs of each page of the original document
>>> 2) include them as graphics as the right hand page (ie alternating)
>>> 3) add my commentary on the left.
>>
>> I use the following approach when I am getting pdf document for
>> reviewing (since Acrobat
>> notes are clearly unable to handle math). Using eso-pic package to
>> include document
>> \begin{minipage}{0.35\paperwidth}
>> \color{red}
>> \title{My remarks}
>>
>> \maketitle
>> Neumann Laplacian is a very special animal, deeply different in the
>> irregular domains from  Dirichlet Laplacian and this must be  
>> explained
>> in details.
>>
>> \bigskip
>>
>> great paper but.
>>
>> \bigskip
>> I suggest to ....
>>
>> \bigskip\bigskip
>> Not clear what ``less stringent estimate'' means.
>>
>> \smallskip
>> real BS
>>
>> \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...

I don't know if anyone will be using this, but forget about the  
previous post: here is a corrected version.

	Bernhard

%!TEX TS-program = pdflatex
\documentclass{article}
\usepackage{pdfpages}

\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/




More information about the macostex-archives mailing list