插入图形后如何开始新行,且新行开头不缩进?

插入图形后如何开始新行,且新行开头不缩进?
\section{last paragraph}
Here are some words in the last paragraph. Now a figure is inserted below.
\begin{figure}[H]
\centering
\includegraphics[width=5cm]{...jpg}
\caption[Example .]{.,,}
\label{...}
\end{figure}
Now I want to start a new line after this figure. But there is always indentation at the begining. How to delete this indentation?

编译结果如下: 在此处输入图片描述

我添加了使用示例:

\documentclass[a4paper,12pt]{article}

\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{float}

\begin{document}
\section{Paragraph}
Here are some words in the last paragraph. Now a figure is inserted below.
\begin{figure}[H]
\caption{A picture of a gull.}
\centering
\includegraphics[width=0.5\textwidth]{Penguins.jpg}
\end{figure}
Now I want to start a new line after this figure. But there is always indentation at the begining. How to delete this indentation?
\end{document}

编译结果如下:

在此处输入图片描述

答案1

您需要将其包含\noindent在第一行的开头。

\documentclass[a4paper,12pt,demo]{article}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{float}

\begin{document}
\section{Paragraph}
Here are some words in the last paragraph. Now a figure is inserted below.
\begin{figure}[H]
\caption{A picture of a gull.}
\centering
\includegraphics[width=0.5\textwidth]{Penguins.jpg}
\end{figure}
\noindent Now I want to start a new line after this figure. But there is always indentation at the begining. How to delete this indentation?
\end{document}

这导致:

在此处输入图片描述

答案2

这看起来像是 float 包中的一个错误,这里是修复的开始,我展示了包含和不包含空行的图像

在此处输入图片描述

\documentclass[a4paper,12pt]{article}

\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{float}

\makeatletter

\renewcommand\float@endH{\@endfloatbox\vskip\intextsep
  \if@flstyle\setbox\@currbox\float@makebox\columnwidth\fi
  \box\@currbox\vskip\intextsep\relax\@doendpe}

\makeatother
\begin{document}
\section{Paragraph}

xx

Here are some words in the last paragraph. Now a figure is inserted below.
\begin{figure}[H]
\caption{A picture of a gull.}
\centering
\includegraphics[width=0.5\textwidth]{example-image}
\end{figure}
Now I want to start a new line after this figure. But there is always indentation at the begining. How to delete this indentation?

Here are some words in the last paragraph. Now a figure is inserted below.
\begin{figure}[H]
\caption{A picture of a gull.}
\centering
\includegraphics[width=0.5\textwidth]{example-image}
\end{figure}

Now I want to start a new line after this figure. But there is always indentation at the begining. How to delete this indentation?






\end{document}

答案3

实际上您不需要\noindent每次都手动添加。

定义每个figure环境之后发生的情况就足够了:

\AfterEndEnvironment{figure}{\noindent\ignorespaces}

记得删除\end{figure}段落开头和段落之间的所有空白行。

在此处输入图片描述

提示:您也可以在其他类型的环境之后执行相同的操作,例如在定义之后:

\AfterEndEnvironment{definition}{\noindent\ignorespaces}

相关内容