Emacs+muse 使用

安装和配置


安装emacs必须的muse-el: apt-get install muse-el


发布pdf文件所需依赖

muse发布pdf的时候需要安装几个必须的文件

apt-get install latex-cjk-all
apt-get install texlive-latex-recommended
apt-get install texlive-latex-extra


在~/.emacs中配置如下:

;;muse
(require 'muse-mode)     ; load authoring mode

(require 'muse-html)     ; load publishing styles I use
(require 'muse-latex)
(require 'muse-texinfo)
(require 'muse-docbook)

(require 'muse-project)  ; publish files in projects
(setq process-path "~/Documents/process")
(setq process-html-path (concat process-path "/html"))
(setq process-pdf-path (concat process-path "/pdf"))
(setq muse-project-alist
   `(("website" ( ,process-path :default "index");;很奇怪,必须用反引号和,process-path提前求值才行
    (:base "html" :path process-html-path)
    (:base "pdf" :path process-pdf-path))))

最后是创建了一个project 名叫process,位于~/Documents目录下。

运行muse-project-publish命令,将html文件和pdf文件发布到html和pdf目录下。


访问当前编辑的muse文件发布后的文件,比如正在打开的是index.muse文件。

C-c C-v 之后,会询问需要访问那种风格,回答Html,将打开浏览器显示html目录下的index.html.


css

muse编写html的时候可以指定CSS文件,

在.emacs上可以配置一下默认的CSS文件:

(setq muse-html-style-sheet "<link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\"/>")


main.css前面也可以有相对路径。不过要注意,如果发布到html目录后,相对路径位置会变,所以要手动调整一下。

audo apt-get install muse-el安装的路径可以通过dpkg -L muse-el找出来。

很快就能看到一些预定义的css文件位于:/usr/share/doc/muse-el/examples/mwolson/stylesheets

经过我的实验,common.css比较好看。可以用来作为自己不写css的默认选择。



文档目录

在文档中通过header自动产生目录索引是很方便的功能。

在需要的地方使用

<contents>
文档中说使用 muse - publish - contents -<wbr style="color: rgb(34, 34, 34); font-family: arial, sans-serif; line-height: 16px;font-size:12px; "><span style="color: rgb(221, 75, 57); font-style: normal; font-family: arial, sans-serif; line-height: 16px;font-size:12px; ">depth </span><span style="font-style: normal; font-family: arial, sans-serif; line-height: 16px;font-size:12px; "><span style="color:#333333;">可以控制目录深度,但是我没有成功。现在是三层目录都能显示出来。</span></span><br><p><br></p> <p><strong>链接到其他文章</strong></p> <p>可以用下面的标记:</p> <p></p> <pre class="example">[[link target][link description]]</pre>比如<p></p> <p>[[code][代码管理]]</p> <p>将在生成的html页面上出现代码管理字样,点击后跳转到code.html页面。前提是code.muse文件是存在的。</p> <p></p> <p><strong>直接插入原始标记</strong></p> <p>这个功能非常有用,特别时如果想插入javascript,css和html标记,让网页变得更加丰富一些的时候。</p> <p>用&lt;literal&gt;&lt;/literal&gt;包起来就行了。以前没有体会到这个功能的强大,今天试了一下,直接插入一个按钮很方便。</p> <p>意味着我可以将我的muse文档编成web2.0的网页,直接写程序了。</p> <p><br></p></wbr>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值