Possible Duplicate:
How to annotate PDF files generated by pdflatex?

Is there a way to annotate pdfs with LaTeX annotations? I mean a pdf that I do not have the source code for (or may not have even been written in LaTeX itself, for that matter).

The motivation behind my question is that I would really like to annotate my lecture notes digitally to stop me losing important notes, but the lecturer does not like the idea of releasing the source code to his notes to students. (i.e. I don't think asking for the source code went down well and I would like to not feel the need to ask another lecturer the same question if I can avoid it :-))

I could try to type them out myself but when time is limited it would be ambitious at best, to try it when there are more urgent work I need to prioritise.

I use linux, my pdf viewer is okular and it mainly for maths/physics type work if that is useful information to add. It would be handy to be able to do it one way or another so I am open to any suggestions that might help out!

  • 1
    Two possibilities: if doing "real time" (ie in the lecture) then I wouldn't bother with LaTeX annotations and would just annotated the PDF directly using a PDF annotation tool (my favourites are xournal for Linux and GoodNotes for iPad). If afterwards, simply load the PDF with something like pdfpages and "write on top" using normal LaTeX commands. – Andrew Stacey Dec 5 '12 at 17:40
  • 2
    This question is very similar to tex.stackexchange.com/questions/6306/…. Please take a look at it as the information there might help you. If so, that's great, and we'll probably close this question as a duplicate just to keep the place tidy and to help people find answers quickly. If not, please edit your question here to explain why so that people can better focus their attention to help you. – doncherry Dec 5 '12 at 17:42
  • pdf pages? Can you elaborate? @AndrewStacey – Magpie Dec 5 '12 at 17:43
  • 2
    There's a package on CTAN called pdfpages: ctan.org/pkg/pdfpages and it defines a command where you include pages from a PDF as the background to some pages which you can then draw on top of using normal LaTeX commands. I use it for filling in PDF forms and I use TikZ to place the text at specific points relative to the form. The documentation for pdfpages is worth a look to see if it would do what you want. – Andrew Stacey Dec 5 '12 at 17:48
  • 2
    @Magpie That is a difference, of course. It looks to me like the OP over there was looking for a way to annotate finished PDFs as well, so the top answer (pdfcomment) actually doesn't address the problem. Many of the other answers address that problem though, it seems. I guess @Andrew could add his answer over there as well. (Btw, Kurt's edit was perfectly valid, perhaps except for the conversion of British spelling to American, but I'm sure that was an honest mistake on his side.) – doncherry Dec 5 '12 at 17:52

Here's an example using pdfpages to load the PDF as a background with TikZ to draw on top of it. The following code will complain about a missing image (tikzmark_example.pdf) but hopefully will give you the idea of what I was saying in the comments. I've left the grid in place as that's how I figure out the coordinates. This is adapted from code I use to "fill in" PDF forms by writing on top of them - in other situations I'd probably end up with a different set of helper macros to make it easier to place the annotations.


  every node/.style={
    anchor=mid west,

\pgfkeys{/form field/.code 2 args={\expandafter\global\expandafter\def\csname field@#1\expandafter\endcsname\expandafter{#2}}}

\newcommand{\place}[3][]{\node[#1] at (#2) {\csname field@#3\endcsname};}

\newcommand{\xmark}[1]{\node at (#1) {X};}


\foreach \mykey/\myvalue in {
  ctsfn/{Defined in Week 1},
  metsp/{Defined in Week 3},
} {
  \pgfkeys{/form field={\mykey}{\myvalue}}

    \begin{tikzpicture}[remember picture,overlay]
%%% The next lines draw a useful grid - get rid of them (comment them out) on the final version
    \draw[gray] (current page.south west) grid (current page.north east);
\foreach \k in {1,...,28} {
      \path (current page.south east) ++(-2,\k) node {\k};
\foreach \k in {1,...,20} {
      \path (current page.south west) ++(\k,2) node {\k};
%%% grid code ends here
\tikzset{every node/.append style={fill=Honeydew,font=\large}}
\draw[ultra thick,blue,->] (ctsfn) to[out=135,in=90] (9cm,17.3cm);
\draw[ultra thick,blue,->] (metsp) to[out=155,in=70] (6cm,9cm);


The result of the above is:

lecture slide with annotations

| improve this answer | |
  • That looks like the sort of thing I need! Thanks. Can you advise how to get rid of the square grid though? – Magpie Dec 5 '12 at 22:35
  • 2
    @Magpie I've added some comments to the code as to where the grid bit is. – Andrew Stacey Dec 5 '12 at 22:47
  • For equations: It seems that the above solution does not work for the \begin{equation} E=mc^2 \end{equation} environment - but you can at least write comments of the form $\displaystyle a=\frac{b}{c}$ where displaystyle helps to render the equation bigger. – exchange May 20 at 14:06

Although there might be a way to comment third party PDFs by using LaTeX, this is not a usefull way.

There are lots of software to deal with your needs, but more on the windows side. Under Linux, I employ flpsed, http://flpsed.org/flpsed.html.

| improve this answer | |
  • As of 0.7.3, currently in Debian unstable (20th August 2016), I can confirm that PDF annotation works with flpsed. I've installed it on Debian stable (jessie). – Faheem Mitha Aug 20 '16 at 19:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.