【问题标题】:when using vim-latex gq causes overhangs in captions使用 vim-latex gq 时会导致字幕出现悬垂
【发布时间】:2016-02-22 05:21:10
【问题描述】:

当我使用 Vim-LaTeX 编辑 LaTeX 文件并想重新格式化 \caption{} 中的一段文本时,我会遇到悬垂或悬垂 - 我不知道该怎么称呼它们。我首先选择标题中的文本,然后使用“gq”重新格式化它。重新格式化后的标题如下:

    \caption{The problem is that when I reformat the text
         in a caption the text on each successive line
      begins further and further to the left until it begins 
   at the first space of the line.}

我希望结果会是这样的:

    \caption{The problem is that when I reformat the text
         in a caption the text on each successive line
         begins further and further to the left until it 
         begins at the first space of the line.}

我希望这篇文章中的格式与我输入的内容保持一致,但我试图在第一个示例标题中描述问题。第二个应该左对齐。

有人知道我需要做什么来解决这个问题吗?我假设有一个设置需要更改,但我无法弄清楚它是什么。

【问题讨论】:

    标签: vim latex reformat


    【解决方案1】:

    gq 命令格式基于'formatexpr''formatprg'。您可以先使用:se fex?:se fp? 检查这些选项的值。

    通过查看vim-latex 插件,它从不设置这些选项,因此这很可能是由您的其他插件或vimrc 设置的。您可以使用:verbose 准确了解选项的设置位置。

    【讨论】:

    • 首先是迟到的感谢,我会赞成,但显然我的设置中没有设置 'formatexpr''formatprg',所以这无济于事。一个后续问题可能会推动这一点。我发现如果移动文本使其与 {} 不在同一行,那么它的格式正确 - 不幸的是,我不知道如何通过在此处提供一个很好的示例来澄清。但是,如果我从\caption{some text} 更改为\caption{ - 然后我把"some text" 放在一个新行上,然后在另一行上我放}。我可以选择文本,gq 将正确格式化。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-11
    • 2012-07-01
    • 2014-06-13
    • 2011-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多