梅威瑟:
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\begin{document}
\section{Some Section}
First (long) paragraph. \\
Second (long) paragraph. \\
\input{some_figure}
Third (long) paragraph. \\
Fourth (long) paragraph.
\end{document}
其中some_figure.txt
包含
\begin{figure}[t]
\includegraphics[width=3cm]{example-image}
\end{figure}
“第二(长)段”之后的换行\\
会导致后续行“第三(长)段”自动缩进,如下图所示。
有没有办法(自动)避免/禁用这些缩进?
我通常会\input{some_figure}
在章节的开头/结尾处移动以规避此问题。但是,如果文本变得太大,这实际上不是一个选择。
答案1
如果您指的是实际的“段落”,那么请听取 egreg 的建议(“不要使用\\
来结束段落,而要使用空白行”)。但是,如果您只是强制换行,那么问题就不是缩进,而是杂散空格。
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx,filecontents}
\begin{filecontents*}{some_figure}
\begin{figure}[t]
\includegraphics[width=3cm]{example-image}
\end{figure}
\end{filecontents*}
\begin{document}
\section{Some Section}
First (long) paragraph. \\
Second (long) paragraph. \\
\input some_figure \unskip
Third (long) paragraph. \\
Fourth (long) paragraph.
\end{document}
交替,
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx,filecontents}
\begin{filecontents*}{some_figure}
\begin{figure}[t]
\includegraphics[width=3cm]{example-image}
\end{figure}
\end{filecontents*}
\begin{document}
\section{Some Section}
First (long) paragraph. \\
Second (long) paragraph.
\input some_figure \\
Third (long) paragraph. \\
Fourth (long) paragraph.
\end{document}