Hey this answer solved my similar problem. A bit late but I had the same issue today.
As mentioned, I add the following code snipped to my .spacemacs
/.emacs
config:
(require 'org)
(require 'ox-latex)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
(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-fontify-natively t)
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)
(latex . t)))
To use Minted, you need to install the companion program pygments
. You can do this with pip install pygments
.