[Tex/LaTex] Error exporting from org-mode to beamer

beameremacsexportorg-mode

When trying to export from org to beamer I get this msg:

Processing LaTeX file ./ppt.tex…
org-latex-compile: PDF file ./ppt.pdf wasn't produced: [undefined control sequence]

I don't know what that means. Can someone please help me understand and fix this error? Perhaps I haven't properly configured emacs for this kind of export?

This is part of my .emacs file which I copied from one of the questions here in TeX.SX. I'm not sure if I have AUCTeX configured with shell-escape but I'd like to have the proper code in my .emacs file for when it's time to include some python lines in the final pdf, be it an article or a beamer presentation.

    ;; Org mode and bearmer export
(require 'ox-beamer)
(setq org-latex-to-pdf-process 
  '("pdflatex --shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex --shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex --shell-escape -interaction nonstopmode -output-directory %o %f"))


(defun my-beamer-bold (contents backend info)
 (when (eq backend 'beamer)
  (replace-regexp-in-string "\\`\\\\[A-Za-z0-9]+" "\\\\textbf" contents)))

(add-to-list 'org-export-filter-bold-functions 'my-beamer-bold)

(setq org-src-fontify-natively t)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((python . t)
  (latex . t)))
(setq org-confirm-babel-evaluate nil)
(setq org-babel-python-command "ipython --pylab --pdb --nosep --classic --no-banner --no-confirm-exit")

(setq org-latex-listings 'minted)
(setq org-latex-minted-options
   '(("fontsize" "\\footnotesize")("bgcolor" "black")("obeytabs" "true")))

(require 'ox-latex)
(setq org-src-fontify-natively t)
(setq org-latex-pdf-process
   '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
    "pdflatex -shell-escape -interaction nonstopmode -output-directory %o   %f"
    "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
(setq org-src-preserve-indentation t)

The following is the ppt.org file which I can't translate into pdf!

#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation, smaller]
#+BEAMER_THEME: CambridgeUS
#+BEAMER_FRAME_LEVEL: 2
#+OPTIONS: H:3 email:n |:t
#+TITLE: CNT antennas
#+AUTHOR: W.W.
#+DATE: Dec 2015

* What are CNTs?
** who, what, when, how

* How do antennas work?
** /what/, when, how
 - a short description of a simple antenn
 - what parameters define the quality of an antenna
 - what are the common use of an antenna

* How can CNTs be used as antennas? 
 - how does it work?
   + describe the advantages...
   + ...and the disadvantages
 - any alternative materials?

* Other applications of CNTs to communications
 - self-assembly
see ch.4 of S.F. Bush "Nanoscale Communication Networks"

Best Answer

I've add the code you provide to my emacs setup (could be found on my github sorry for the publicity) with emacs 24.4.1 .

The error come from the sentance /what/, when, how. Beamer don't really enjoy using \emph{} and other command that are used in section title. A way to avoid it is to use LaTeX command for this point: ** \protect\emph{what}, when, how.

Which give as a result:

#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation, smaller]
#+BEAMER_THEME: CambridgeUS
#+BEAMER_FRAME_LEVEL: 2
#+OPTIONS: H:3 email:n |:t
#+TITLE: CNT antennas
#+AUTHOR: W.W.
#+DATE: Dec 2015

* What are CNTs?
** who, what, when, how

* How do antennas work?
** \protect\emph{what}, when, how
 - a short description of a simple antenn
 - what parameters define the quality of an antenna
 - what are the common use of an antenna

* How can CNTs be used as antennas? 
 - how does it work?
   + describe the advantages...
   + ...and the disadvantages
 - any alternative materials?

* Other applications of CNTs to communications
 - self-assembly
see ch.4 of S.F. Bush "Nanoscale Communication Networks"

I haven't found a solution at this point using only org command if someone have it, I'm interested.