如何将 LaTeX 源代码拆分成多行?

如何将 LaTeX 源代码拆分成多行?

我想分割 LaTeX 源代码行

Some text I would like to have in one line~\footnote{
  something explained
}

变成类似这样:

Some text I would like to have in one line\
~\footnote{
  something explained
}

但编译后的输出相同。有什么方法可以指示 LaTeX 忽略换行符吗?

答案1

换行符与空格相同,因此您可以在任何有空格的地方进行拆分,也可以使用以下方法注释掉换行符%

您将原件显示为

Some text I would like to have in one line~\footnote{
  something explained
}

其中已经有两个换行符被用作可能的虚假空格(您依靠\footnote修剪空格,但这并不适用于所有命令。我会把它写成

Some text I would like to have in one line~\footnote{%
  something explained%
}

(除了我不想~在脚注标记前加一个,但这是一个样式选择而不是文本问题)

所以你可以有

Some text I would like to have in one line%
~\footnote{%
  something explained%
}

或者

Some text I would like to have in one line%
~\footnote
  {something explained}

或者

Some text I would like to have in one line~\footnote
  {something explained}

ETC

相关内容