如何在 EMACS 上完全证明 Latex 代码的合理性

发布于 2024-08-07 23:52:06 字数 610 浏览 1 评论 0原文

我想在 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 列。 有人可以给我提示吗?

I want to fully-justify latex code on EMACS so that my latex code will look better. For example, I remember my advisor sending me latex in fully justified way like this:

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}.

I suppose that his column-width is set to 70 columns.
Could someone give me a hint?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

他是夢罘是命 2024-08-14 23:52:06

标准 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 的可编辑性和源代码控制行为,所以我建议不要这样做。

The standard fill.el package includes the command justify-current-line which is part of what you need. From the function help:

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

And other posters have already given you the magicall invokation:

M-x set-justification

As a philosophical side note, the point of fixed-wdith text justification is to fake real typography on a inflexible output device. So applying it to LaTeX source seems a little odd to me. Moreover, I have been using the "one sentence to a line" approach to LaTeX documents for some months now, and find that it really does improves both the editability and the source-control behavior of LaTeX, so I would recommend against doing this.

姜生凉生 2024-08-14 23:52:06

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

If you select the region, and then press Ctrl-u M-x fill-region you get "full justification".

迷途知返 2024-08-14 23:52:06

Mx set-justification-full

之后使用 Refill 模式键入后再次运行该命令。

M-x set-justification-full

Use Refill mode afterwards to not have to run the command again after typing.

断桥再见 2024-08-14 23:52:06

在文件本身中换行(而不是像 longlines-mode 不会改变文件的结构),我使用 auto-fill- mode,自动将 Mq (fill-paragraph) 应用于每个段落。例如,我在邮件模式中使用auto-fill-mode。您可以使用这样的挂钩对 LaTeX 模式执行类似的操作:

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

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

To get line wrap in the file itself (as opposed to something like longlines-mode that does not alter the structure of the file), I use auto-fill-mode, which automatically applies M-q (fill-paragraph) to each paragraph. For example, I use auto-fill-mode in mail-mode. You could do something similar with your LaTeX mode with a hook like this:

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

Assuming your TeX mode's hook is TeX-mode-hook.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文