% create a new file handle \newwrite\pdfpcnotesfile % open file on \begin{document} \AtBeginDocument{% \immediate\openout\pdfpcnotesfile\jobname-Notizen.txt.tmp\relax \immediate\write\pdfpcnotesfile{} } % define a # https://tex.stackexchange.com/a/37757/10327 \begingroup \catcode`\#=12 \gdef\hashchar{#}% \endgroup % define command \pnote{} that works exactly like \note but % additionally writes notes to file in pdfpc readable format \newcommand{\spnote}[1]{% % keep normal notes working \note{#1}% % write notes to file \begingroup \let\#\hashchar %\immediate\write\pdfpcnotesfile{\#\theframenumber\#\unexpanded{#1}}% \immediate\write\pdfpcnotesfile{\#\thepage\#\unexpanded{#1}}% \endgroup } % close file on \end{document} \AtEndDocument{% \immediate\closeout\pdfpcnotesfile }