註解掉所有在 TeXnical 上不需要的空白行?

註解掉所有在 TeXnical 上不需要的空白行?

這是後續這個關於註解空行與 \noindent 的問題。鑑於我現在已經開始註解掉周圍環境的線條,如下所示:

\documentclass{article}

\begin{document}

Some body text. Let's introduce a quote:%
%
\begin{quote}
Some quote text.
\end{quote}
%
Some text following the quote.

\end{document}

我想知道註解掉有沒有什麼壞處全部在我的原始程式碼中,空行不符合技術目的,如下所示:

\documentclass{article}

\begin{document}
%
Some body text. Let's introduce a quote:%
%
\begin{quote}
Some quote text.
\end{quote}
%
Some text following the quote.
%
\end{document}

我隱約記得不久前讀過一個問題,其中指出您可能會在較長的文檔中遇到諸如評論字符限制之類的問題(也許有人可以再次指出我?),這可能是值得擔心的事情。

在我的原始程式碼中註解掉 TeXnically 不必要的空白行有什麼缺點嗎?

答案1

如果沒有手動插入明確的段落分隔符,空白行上的註解在技術上會連接段落。因此,如果沒有插入明確的段落分隔符號(例如,在某些環境定義中),那麼您將面臨耗盡 TeX 記憶體的風險(如(La)TeX 記憶體使用的組成部分)。也就是說,TeX 只會吞噬輸入流,以便收集段落的內容(最終目標是優化它以進行演示)...但如果該段落「永遠」不會結束,那麼您的耐心也會消失。然而,在大多數情況下這肯定是不可能的,因此非常極端。

請注意,雖然您可能需要看似不必要的空行註釋,但輸出可能會有所不同:

在此輸入影像描述

\documentclass{article}

\begin{document}
%
Some body text. Let's introduce a quote:%
%
\begin{quote}
Some quote text.
\end{quote}
%
Some text following the quote.

\noindent\hrulefill

Some body text. Let's introduce a quote:%
%
\begin{quote}
Some quote text.
\end{quote}

Some text following the quote.
%
\end{document}

在上面的例子中,Some text following the quote被認為是在開始的同一段落中引用是由於 開始的%,因此沒有段落縮排。在第二個中,空白行代表段落分隔符,導致預期的段落縮排。

相關內容