emacs org-mode:导出为HTML时如何选择字体? [英] emacs org-mode: how to choose font when exporting to HTML?

查看:203
本文介绍了emacs org-mode:导出为HTML时如何选择字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下命令可以将 org-mode 下的文件导出为HTML:

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

C-c C-e h o

(org-export-dispatch) h o

是否有简单方式来设置另一种字体?

Is there a simple way to set another font?

也对什么是正确(复杂)方式感兴趣:)

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

推荐答案

您有不同的选择,具体取决于您希望获得的精心设计...
最简单:

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

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

更高级:

#+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

在该文件中可能会有类似的内容(在这种情况下,为Charset,您的样式表,Mathjax(用于漂亮的Latex样式的公式化器)):

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>

这篇关于emacs org-mode:导出为HTML时如何选择字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆