4

I have some books and .pdf files that I would like to make some notes (particularly adding equations with LaTeX). I have seen the following post:

Overlay LaTeX/TeX coding easily on PDF with 300 pages

But, one thing which I am looking for a method around is that the answer posted some notes in a .pdf with some generous spacing. Sometimes I may not have that much space (i.e.: just adding a sample picture below - to give an idea)

example

So how could I do it without overwriting some text? For instance, in the following code:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
\setlength{\parindent}{1in}
\makeatother

\usepackage{babel}
\documentclass{article}
\usepackage{pdfpages}% http://ctan.org/pkg/pdfpages
\usepackage{eso-pic}% http://ctan.org/pkg/eso-pic
\pagestyle{empty}
\begin{document}
% Add pages before
\AddToShipoutPictureFG*{%
  \AtPageCenter{%
    \vspace{2cm}
    \makebox[0pt][c]{\Huge HERE IS SOME TEXT aasdfasdfadsfasd.}
  }
}%
\includepdf[pages=1]{hw1.pdf}
% Add pages after
\end{document}

Which creates:

output

But how would this work if I were to add multiple notes (which I would imagine to be quite messy) so is this a way to organize such that it is similar to \pdfcomment but still be able to type math equations (I am not fully sure about this feature so if someone could explain or provide some advice that would be great). Also, if someone could provide an example of how I could use the pdfpages package to write on the next line and specify how exactly to layout the box would also be nice.

Lastly, just to provide an example of what I had in mind, I was thinking of something along the lines of this

application1

which then shrinks to this when I click it

application2

But I am also open to other alternatives as well.

Ruben
  • 13,448
PutsandCalls
  • 605
  • 7
  • 21
  • 2
    With \AddToShipoutPictureFG* you can add any box to any place, and you can decide which size and form has the added box, so what's the problem? – Ignasi Mar 23 '16 at 07:42
  • So how would I add a new line of notes and how exactly would I determine which place to locate the box ? Would it be possible to get an example please, Sorry I am relatively new to this part of annotations. – PutsandCalls Mar 23 '16 at 07:47
  • @Ignasi this is the best solution, please elaborate. – touhami Mar 23 '16 at 07:52
  • 1
    For pop-ups with LaTeX formatted text see http://tex.stackexchange.com/a/164186/ – AlexG Mar 23 '16 at 11:22
  • 1
    @alexG For the answer that you posted in tex.stackexchange.com/a/164186, could you provide an example of using such a method on a pdf document that is already written (ie: a book or something). I seem to be having a trouble of exactly implementing it on some already finished pdf page that I dont have the .tex file to. But this is exactly what im looking for – PutsandCalls Mar 23 '16 at 19:22
  • 1
    @AlexG I would also appreciate the latter demand since I am in the same context, a non Latex pdf (a scanned one in fact). – user1771398 Mar 28 '16 at 17:39

1 Answers1

3

This is a little example with eso-pic using picture commands to place notes.

The problem about where to place notes can be solved with grid command from eso-pic. This class option draw a grid on background with enumerated units which can be used as reference. Once notes are written, grid=false will supres it.

\AddToShipoutPictureFG* is used because pdfpages already uses \AddToShipoutPictureBG for page insertion and inserted text covers added notes. With FG notes are written after (over) inserted page.

\documentclass[a4paper]{article}
\usepackage[grid, gridcolor=red!50,subgridcolor=green!20,gridunit=pt]{eso-pic}
\usepackage{pdfpages,picture}

\begin{document}
\AddToShipoutPictureFG*{
    \AtPageLowerLeft{
        \setlength{\fboxrule}{3pt}  
        \setlength{\fboxsep}{5pt}
        \put(450pt,405pt){
            \makebox(0,0){%
            \fcolorbox{red}{yellow!30}{%
                \begin{minipage}{5cm}
                    This is my comment
                \end{minipage}}
            }%
        }
    }
}
\includepdf[pages=1]{blind}    

\AddToShipoutPictureFG*{
    \AtPageLowerLeft{
        \setlength{\fboxrule}{3pt}  
        \setlength{\fboxsep}{10pt}
        \put(300pt,550pt){
            \makebox(0,0){%
            \fcolorbox{blue}{red!30}{%
                \begin{minipage}{3cm}
                    This is my second comment which is longer than the first one
                \end{minipage}}
            }%
        }
    }
}
\includepdf[pages=2]{blind}      

\end{document}

enter image description here

Ignasi
  • 136,588