[Tex/LaTex] Output Beamer notes to a separate PDF file

beamernotespdf

Is there a simple way to have Beamer output the presentation notes to a separate PDF file whenever compiling the presentation? I know one way is to create two master files, one for the presentation and one for the notes, and compile them both every time, but I find this somewhat awkward.

Best Answer

There is an option called \setbeameroption{show only notes}

\documentclass{beamer}

%\setbeameroption{show notes}
\setbeameroption{show only notes}
\begin{document}
\frame{\frametitle{FIRST}
On slide
\note{Whatever}
}



\end{document}

Compile, copy the pdf (another name!), comment out the second setbeameroption as well and compile again. Sure you could write a makefile (depending on your OS), but if you donĀ“t need the two files after every run it is much easier (or less to code) this way. For the writing process i recommend to work with the show notes option on (remove %).

Edit

Here comes a one compilation (one click) solution. It makes use of \write18 so pdflatex needs the --shell-escape option.

\write18{./file.sh }

\documentclass{beamer}


\input{out.out}
\begin{document}
\frame{\frametitle{FIRST}
On slide one.
\note{Whatever you want}
}

\end{document} 

While file.sh is

#! /bin/bash
echo  > out.out
pdflatex yourname
cp yourname.pdf nonotes.pdf
echo \\setbeameroption{show only notes} > out.out

this file must be executable with e.g. chmod 777 file.sh an it must be in the same directory as the yourname.tex. This is of course bash so it will only work on unix-like systems.

Replace yourname with the actual name of your tex-file.

What does it do? First pdflatex will call file.sh which executes pdflatex then copies the resulting pdf into nonotes.pdf. Afterwards it fills out.out with the show only notes option. write18 is finish and the parent pdflatex process will continue. But now that out.out is filled, the parent process will produce a pdf with that option on.

Related Question