With the following .emacs
(on bleeding-edge GNU Emacs 30.0.50 and Org mode 9.6.1 in 2023)
;; Org -> LaTeX
(require 'ox-latex)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
(setq org-latex-pdf-process '("latexmk -shell-escape -f -pdf %f"))
;; Org -> HTML
(setq org-src-fontify-natively t)
I can see both the effect of font-lock-fontify-buffer
in Emacs (left) and the result of minted
in the LaTeX/PDF export (center), but no fontification following exporting to HTML.
How do I export font-lock from Org to HTML?
Here is the sample source file.
#+LATEX_HEADER: \usemintedstyle{default}
#+BEGIN_SRC c++
// Mean == (Sum / Count)
template<typename Sample>
struct mean_accumulator : accumulator_base
{
typedef Sample result_type;
mean_accumulator(dont_care) {}
template<typename Args>
result_type result(Args const &args) const
{
return sum(args[accumulator]) /
count(args[accumulator]);
}
};
#+END_SRC
htmlize
is installed. Search the Org manual forhtmlize
and/or search the package list for it.