Bala's Blog

Syntax Highlighting in Beamer Presentations

August 17 2018
87 words, ~1 min. read
beamer,  org-mode,  highlight,  python,  tex 

The following steps helped me to colorize beamer presentations with syntax highlighting.

  1. Install python package - pygments (Hint: use easy_install Pygments or pip install Pygments)
  2. Install TeX package - minted
  3. Use/refer minted package either by adding #+LATEX_HEADER: \usepackage{minted} in the Org file or by adding the following in Emacs startup file, init.el,
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
(setq org-latex-minted-options
	    '(
		  ("breaklines=true")
		  ("obeytabs=true")
		  ("tabsize=4")
		  ))

Note: minted options could be provided in org-latex-minted-options variable.

Now, export the file to beamer presentation using C-c C-e l P.