pdfpcnotes.sty (953B)
1 \ProvidesPackage{pdfpcnotes} 2 3 % create a new file handle 4 \newwrite\pdfpcnotesfile 5 6 % open file on \begin{document} 7 \AtBeginDocument{% 8 \immediate\openout\pdfpcnotesfile\jobname.pdfpc\relax 9 \immediate\write\pdfpcnotesfile{[notes]} 10 } 11 % define a # http://tex.stackexchange.com/a/37757/10327 12 \begingroup 13 \catcode`\#=12 14 \gdef\hashchar{#}% 15 \endgroup 16 17 18 \def\lastframenumber{0} 19 20 % define command \pnote{} that works like note but 21 % additionally writes notes to file in pdfpc readable format 22 \newcommand{\pnote}[1]{% 23 % keep normal notes working 24 \note{#1}% 25 26 % if frame changed - write a new header 27 \ifdim\theframenumber pt>\lastframenumber pt 28 \let\lastframenumber\theframenumber 29 \begingroup 30 \let\#\hashchar 31 \immediate\write\pdfpcnotesfile{\#\#\# \theframenumber}% 32 \endgroup 33 \fi 34 35 % write note to file 36 \immediate\write\pdfpcnotesfile{\unexpanded{#1}}% 37 } 38 % close file on \begin{document} 39 \AtEndDocument{% 40 \immediate\closeout\pdfpcnotesfile 41 } 42