如何在EMACS上完全证明乳胶代码

时间:2009-10-17 12:23:24

标签: emacs latex

我想在EMACS上完全证明乳胶代码,以便我的乳胶代码看起来更好。例如,我记得我的顾问以完全合理的方式向我发送胶乳:

In ~\cite{Hummel2004},  authors described  an approach  for harvesting
software components from the Web. The basic  idea is to use the Web as
the  underlying repository,  and to  utilize standard  search engines,
such  as Google,  as  the means  of  discovering appropriate  software
assets.  Other  researchers  have crawled  through  Internet  publicly
available  CVS repositories  to  build their  own  source code  search
engines (e.g., SPARS-J)~\cite{Matsushita2005}.

我认为他的列宽设置为70列。 有人能给我一个暗示吗?

4 个答案:

答案 0 :(得分:6)

标准fill.el包中包含命令justify-current-line,它是您需要的一部分。从功能帮助:

Do some kind of justification on this line.
Normally does full justification: adds spaces to the line to make it end at
the column given by `current-fill-column'.
Optional first argument how specifies alternate type of justification:
it can be `left', `right', `full', `center', or `none'.
If how is t, will justify however the `current-justification' function says to

其他海报已经给你神奇的邀请:

M-x set-justification

作为一个哲学的侧面说明,固定的文本证明的理由是在不灵活的输出设备上伪造真正的排版。因此将它应用于LaTeX源对我来说似乎有点奇怪。此外,我几个月来一直使用“一句话到一行”的方法来处理LaTeX文档,并发现它确实改善了LaTeX的可编辑性和源代码控制行为,因此我建议不要这样做。

答案 1 :(得分:3)

如果选择区域,然后按 Ctrl-u M-x fill-region ,您将获得“完全对齐”。

答案 2 :(得分:1)

M-x set-justification-full

之后使用Refill mode不必在输入后再次运行命令。

答案 3 :(得分:1)

要在文件本身中获取换行(而不是像longlines-mode那样不会改变文件结构的东西),我使用auto-fill-mode,它会自动应用M-qfill-paragraph)每个段落。例如,我在auto-fill-mode中使用mail-mode。您可以使用这样的钩子在LaTeX模式下执行类似的操作:

(add-hook 'TeX-mode-hook 'turn-on-auto-fill)

假设您的TeX模式挂钩为TeX-mode-hook

相关问题