When I insert C code block inside an org-mode file, the syntax highlight and indentation of the source code are customized as I wanted.
When I export it into a html file, the syntax highlight in the html file is exactly the same as in Emacs. But the syntax highlight works better with the color-theme of my Emacs. For instance, the
{
symbol is white in my C code block, but my color-theme is dark, if I export it into html, the background of the html file is white too, it means, you cannot see{
in the source code block of exported html even thought it is there.The indentation of the source code is normal in my Emacs (as I customized it), but the indentation of the source code in exported html file will be different, it adds more spaces for indentation.
If I export the same org file in
emacs -q
, they are normal in the exported html file, but the syntax highlight and indentation of the source code will be thedefault
configuration of Emacs. So it means font-faces configurations ininit.el
will affectorg-export
.
So my question is: when I export an org-mode file which contains source code block into html file (or maybe other formats such as PDF as well), is it possible to get rid of all my own configuration of font-faces about the source code and do it as in emacs -q
?
Update:
The second problem is solved by setting (setq org-src-preserve-indentation t)
either in init file or by running it through M-:
(eval-expression
).
Update2:
The first problem is solved by Set the background of org-exported <code> blocks according to theme.
The third problem is not important if 1st and 2nd problems are solved.
emacs -q
style instead of thecustom/theme.css
? – CodyChan Jan 22 '15 at 18:10emacs_default_theme.css
– Kaushal Modi Jan 22 '15 at 18:25org-html-fontify-code
such that it sets the default theme before fontification and then restores the earlier theme. – Kaushal Modi Jan 22 '15 at 18:28no-theme-inherit
argument to #+BEGIN_SRC , e.g.#+BEGIN_SRC haskell no-theme-inherit .. #+END_SRC
that just used the emacs default fontification information for the code, in this case Haskell. – Rob Stewart Oct 11 '15 at 14:57