Retext安装配置
目录
Retext安装
sudo add-apt-repository ppa:mitya57
sudo apt-get update
sudo get-apt install retext
系统环境:Ubuntu14.04
Retext样式配置
新装好的引用和代码和正文的区分并不明显,而且整个文档的字体显示也不好看。之所以会出现这种情况,是因为[没有给ReText指定相应的CSS文件][1]。唯一的遗憾是ReText的某些配置无法通过菜单来完成,必须手动修改[配置文件][2].
~/.config/ReText project/ReText.conf
内容修改为
[General]
styleSheet=path/github.css
useWebKit=true
autoSave=true
github参考样式:https://github.com/nicolashery/markdownpad-github
PS:path最好设置为绝对路径1.
Retext样式配置文件
基础语法:
[General]
Setting1=Value1
Setting2=Value2
内容设置
- font, fontSize: Default font used in the resulting text, this doesn’t affect editor.
- editorFont, editorFontSize: The same for editor.
- styleSheet, appStyleSheet: Load CSS styles from file, provide canonical file name. appStyleSheet is used for +configuring the application window’s style. See the documentation for details.
autoSave: Auto-save files. Value should be either true or false. - autoPlainText: Set to false if you don’t want ReText to automatically enable plain text mode on unknown file formats.
- restorePreviewState: Restore live preview if it was enabled on last close.
- spellCheck, spellCheckLocale: Enable spell checking by default, spellCheck should be either true or false, spellCheckLocale is language code (example: en_US).
- useWebKit: Use QtWebKit engine for text rendering.
- iconTheme: Force ReText to use the given icon theme (works only on X11 systems, on other systems you should use the icons pack or create your own).
- tabWidth: number of spaces the Tab key inserts.
- tabInsertsSpaces: whether Tab key should insert spaces instead of the tabulation character (on by default).
- rightMargin: number of characters to display a margin line after.
- handleWebLinks: (WebKit mode only) whether links should be opened in an external web browser (on by default).
- saveWindowGeometry: set to true if you want ReText to save your window geometry and restore it on startup.
- defaultMarkup: default markup name (usually Markdown or reStructuredText; case insensitive).
- defaultCodec: default files encoding (mostly useful for Windows users). See the documentation for the list of possible encodings.
更多配置请参考这儿.
Retext功能扩展配置
MathJax是如此的出名和优秀,所以ReText也有相应的MathJax扩展,不过这次修改的配置文件是
~/.config/markdown-extensions.txt
数学公式支持添加:
mathjax
代码高亮
codehilite
环境配置 →
sudo apt-get install python-pygments
重新启动即可。
参考文献
[1] http://www.cnblogs.com/youxia/p/linux014.html
[2] http://sourceforge.net/p/retext/wiki/Configuration%20file/
- 在我的电脑上只能用绝对路径才有效果,可以试试其他方法。 ↩