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

Maarten Sneep maarten.sneep at xs4all.nl
Fri Apr 28 23:38:58 CEST 2006

On 28 Apr 2006, at 23:02, Jason Davies wrote:

> 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 think you should approach this differently:

- create a document with your commentary, making sure that the pages
are synchronous.
- create a third document that consists of alternating pages.

The third document can be created in BBEdit with Applescript without
too much trouble. (see the pdfpages package)

Because the docs get merged after the pages are numbered, this should
create much less of a headache for you.

> One reason for asking is that I have chronic RSI and manipulating
> the mouse to print out to pdf and change the page number will wreck
> my arm (the mouse work is worst). An applescript can be run (even
> if I have to repeat it page by page) via iListen, so it won't
> produce any strain.

After creating the document with commentary (a skeleton document can
be created with BBEdit + AppleScript or python), the third document
should be a doodle.

> Secondly, my limited experince of inserting graphics is that I
> often get a blank page afterwards. Is that normal? (ie should
> inserting a single page pdf into a TeX document also force a blank
> effect by some other means, by accident, and therefore should see
> if it simply doesn't happen)?

The normal \includegraphics command can do this if the image is
taller than the text area.

Maarten

% skeleton for the second document
\documentclass{article}
\begin{document}
% page 1

\clearpage
% page 2

\clearpage
% page 3

\end{document}

% skeleton for the third document
\documentclass{article}
\usepackage{pdfpages}
\pagestyle{empty}
\newcommand{\insertdoublepage}[1]{\includepdfmerge{\sourcedoc, #1,
\commentdoc, #1}}
\begin{document}
% for loop over the number of pages here. In applescript is probably
most robust
% don't forget to deal with the first page correctly (some titlepage?)
\insertdoublepage{1}
\insertdoublepage{2}
\end{document}

--
It is no good to try to stop knowledge from going forward.  Ignorance
is never better than knowledge. -- Enrico Fermi

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