emacs org-mode: how to choose font when exporting to HTML?

十年热恋 提交于 2019-12-11 06:28:46

问题


A file under org-mode can be exported to HTML using this:

C-c C-e h o

or

(org-export-dispatch) h o

And you'll get that ugly looking times font...

Is there a simple way to set another font?

Also interested in what is the proper (complicated) way :)


回答1:


You have different options, depending on how elaborate you want to get... Easiest:

#+HTML_HEAD_EXTRA: <style>*{font-family: serif !important}</style>

More advanced:

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="myStyleSheet.css"/>

You can also put it all into a setup file and include it in your org-file:

#+SETUPFILE: ~/.emacs.d/org-templates/level-0.org

In that file there could be stuff like this (in this case, Charset, your stylesheet, Mathjax for nice Latex-style formulars):

#+HTML_HEAD_EXTRA: <meta charset="utf-8">
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="static/myStyle.css" />
#+HTML_HEAD_EXTRA: <script async type="text/javascript" src="https://cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


来源:https://stackoverflow.com/questions/51415911/emacs-org-mode-how-to-choose-font-when-exporting-to-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!