我有以下 MWE。在第一个quote
环境中,我希望文本和其正下方的标题之间的垂直间距与后续图中的文本和标题相同。我该如何实现这一点?
\documentclass{article}
\usepackage{caption}
\usepackage{float}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{quote}
\lipsum[1]
\begin{center}
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\begin{minipage}{\linewidth}
\captionof{figure}{A caption}
\end{minipage}
\end{center}
\end{quote}
\lipsum[1]
\begin{quote}
\lipsum[1]
\begin{figure}[H]
\centering
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\caption{A caption}
\end{figure}
\end{quote}
\lipsum[1]
\end{document}
答案1
这些应该表现得完全相同。您可以尝试添加一\hrule
两个以获得更高的准确性(仅限 MWE)。
\documentclass{article}
\usepackage{caption}
\usepackage{float}
\usepackage{lipsum}
\usepackage{tikz}
\begin{document}
\lipsum[1]
\begin{quote}
\lipsum[1]
\par\vskip\intextsep
\noindent\hskip-\leftmargin\vbox{\centering
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\captionof{figure}{A caption}
}\par\vskip\intextsep
\end{quote}
\lipsum[1]
\begin{quote}
\lipsum[1]
\begin{figure}[H]
\centering
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\caption{A caption}
\end{figure}
\end{quote}
\lipsum[1]
\end{document}
这适合引文而不是页面。
\documentclass{article}
\usepackage{caption}
\usepackage{float}
\usepackage{blindtext}
\usepackage{tikz}
\begin{document}
\blindtext
\begin{quote}
\blindtext
\par\vskip\intextsep
\noindent\parbox{\linewidth}{\centering
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\captionof{figure}{\blindtext}
}\par\vskip\intextsep
\end{quote}
\blindtext
\begin{quote}
\blindtext
\begin{figure}[H]
\centering
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\caption{\blindtext}
\end{figure}
\end{quote}
\blindtext
\end{document}
答案2
这是你想要的吗?我添加了tikzpicture
s 以供演示。(你可以用任何你喜欢的数字替换它们。)你的小页面中没有标题的数字。如果你添加一个,你也会在引用环境中获得相同的垂直空间。
\documentclass{article}
\usepackage{tikz}
\usepackage{capt-of}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
\begin{figure}[h!]
\centering
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\caption{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat}
\end{figure}
\begin{quote}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
\vspace{\baselineskip}
\begin{minipage}{\linewidth}
\centering
\begin{tikzpicture}
\draw (0,0) circle[radius=1cm];
\end{tikzpicture}
\captionof{figure}{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat}
\end{minipage}
\vspace{\baselineskip}
\end{quote}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
\end{document}