There is a nice presenter tool I am using called pdfpc.

Sadly it does not show notes I put in my latex presentation with \note{}.

Is there a way to extract the content of all my \note{} tags to a file that I can convert to a format readable by pdfpc then?

  • Hmm, I suppose this is less a TeX question and more a "programming" question (probably best asked on stack overflow). Anyhow, which OS are you using? Grep (Linux/Windows) can probably handle this with ease. Jun 14, 2013 at 22:48
  • It is not possible to achive this with grep because grep uses regular expressions who are not able to deal with nested brackets like this: \note{\begin{itemize}\item ...\end{itemize}} you would need a parser to remember the state of nesting while reading the input. Thats why I thought there maybe is a latex way as latex is already parsing this an may be able to just ouput the note content to a file.
    – cebe
    Jun 15, 2013 at 4:58
  • Just noticed that even if I am able to do it with grep I still need the number of the current frame to be able to show the correct nodes on the right slide.
    – cebe
    Jun 15, 2013 at 5:42
  • 1
    Btw: regex can work in this situation but it is limited for nested brackets. This regex matches all notes in a tex document that do not have a nesting deeper than 2: \\note\{(?:[^}]*?(\{[^}]*?(\{[^}]*?\})?\})?)+\}
    – cebe
    Jun 15, 2013 at 5:43
  • 3
    You should know that if you compile your beamer presentation with the notes on the side, pdfpc can now handle this large presentation format and show you the notes in your laptop. This is available in the github version of pdfpc, using the --notes option. Dec 6, 2013 at 21:39

1 Answer 1


I came up with a quite nice solution I created based on these two questions on file IO:

Here is the code to put before \begin{document}:

% create a new file handle

% open file on \begin{document}
% define a # https://tex.stackexchange.com/a/37757/10327
% define command \pnote{} that works exactly like \note but
% additionally writes notes to file in pdfpc readable format
    % keep normal notes working
    % write notes to file
        \immediate\write\pdfpcnotesfile{\#\#\# \theframenumber}%
% close file on \end{document}

You can then use the \pnote{} command like you used \note{} before. The behavior will be the same but it will additionally write notes to file in pdfpc readable format.

There are a few thing not yet working:

  • It does not preserve newlines, so everything in a \pnote will end up in one line of the output file. To replace newlines and pars you may use the following commands:

    • sed -i "s/\\\\\\\\/\n/g" slides.pdfpc
    • sed -i "s/\\\\par/\n\n/g" slides.pdfpc
  • Multiple \pnote{} commands per frame are not working right now.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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