我的代码大致如下:
\clearpage
\subsubsection{mySubSubSection}
\paragraph{because SubSubSubSections don't exist}
\begin{figure}[H]\includegraphics[]{fig1}\end{figure}
\begin{figure}[H]\includegraphics[]{fig2}\end{figure}
但打印出来却是这样的:
子部分
[图1]
[图 2]
因为 SubSubSubSections 不存在
我希望它被打印为
子部分
因为 SubSubSubSections 不存在
[图1]
[图 2]
我已经尽我所能尝试了一切办法,\clearpage
带有float
图形[H]
选项的包,裸露的\includegraphics
(不起作用,因为那样我就不能使用标题),...
有什么建议吗?这应该不难。我正在使用 LuaLaTex
答案1
请始终提供测试文件。
由于您使用的[H]
浮动不会浮动,但\paragraph
它是排队标题,所以它会推迟到段落的开始,所以您需要给它一个空的\mbox{}
附加值。
\documentclass{article}
\usepackage{float}
\usepackage{graphicx}
\begin{document}
\subsubsection{mySubSubSection}
\paragraph{because SubSubSubSections don't exist}
\mbox{}
\begin{figure}[H]\includegraphics[height=1cm]{example-image}\end{figure}
\begin{figure}[H]\includegraphics[height=2cm]{example-image-a}\end{figure}
\end{document}
答案2
您只需使用包中的命令\includegraphics
提供的标题即可。\captionof
caption
% figplaceprob.tex SE 588524
\documentclass{article}
\usepackage{graphicx} % for \includegraphics and provides the example images
\usepackage{caption}
\begin{document}
\listoffigures
\section{A section}
\subsection{A subsection}
\clearpage
\subsubsection{mySubSubSection}
\paragraph{because SubSubSubSections don't exist}
%\begin{figure}[H]\includegraphics[]{fig1}\end{figure}
%\begin{figure}[H]\includegraphics[]{fig2}\end{figure}
\begin{center}
\includegraphics[scale=0.5]{example-image}
\captionof{figure}{First}
\end{center}
\begin{center}
\includegraphics[scale=0.3]{example-image-a}
\captionof{figure}{Second}
\end{center}
Followed, perhaps by some text.
\end{document}