jgm/pandoc-templates — pull request #28 by bwl21 (2013-05-10 12:10:54+00:00)
Title: Fix includegraphics

Retain options for \includegraphics (solution by Dr. Reinhard Jahraus)

Problem: "beamer" changes within \begin{document} the behavior of many standard commands, amongst others also \includegraphics. This removed the option to scale the included image. In addition to this, "beamer" ignores everything in \begin{document} which is not \begin{frame}. This os not that easy to find. However the solution looks more easy than one can expect based on the problem analysis. The solution is to wrap the redefinition into \AtBeginDocument. This should work in the other latex classes as well.

For sake of consistency, I ported the solution also to default.latex. As Reinhard pointed out, it really works.

Thanks a lot to Reinhard Jahraus. He is a real TeX expert. In the past 2 decades, I never experienced a TeX issue which Reinhard could not solve.