我使用浮点数[h]
。当我使用此命令时:
\setlength{\intextsep}{0pt plus 0pt minus 0pt}
它确实将上面的文本和图形之间的间隔设置为 0,但没有将图形和后面的段落之间的间隔设置为 0。我也尝试不做任何更改并加载包parskip
。没有用。我看到了很多关于这个主题的问题,但没有真正的答案……我的图形没有很好地居中在文本之间……
\documentclass[11pt,a4paper,addpoints]{exam}
\unframedsolutions
%\printanswers
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{calc}
\usepackage{blindtext}
\newgeometry{left=2cm,top=2cm,right=2cm,bottom=2cm}
\begin{document}
\begin{questions}
This is the upper paragraph which has less space between this text and lower figure.
\begin{figure*}[h]
\begin{tikzpicture}[rounded corners=5mm]
\path node[rectangle,draw=green,fill=green!8,inner sep=.70cm] {\parbox{\textwidth-1.4cm-\fboxrule}{
\question[2] What is the first question?
\begin{solutionorlines}[4cm]
This box is smaller than when the solutions are not printed. How do I make this the same dimension as when answers are not printed?
\end{solutionorlines}
}};
\end{tikzpicture}
\end{figure*}
This is the lower paragraph which has more space between this text and above figure.
\end{questions}
\end{document}
答案1
没有 MWE 的情况下进行推测,但我们开始吧...
如果设置\intextsep
为零,图形后仍会出现行间空格。可以通过设置\prevdepth
为来取消此设置-1000pt
(请参阅第 15 章TeX 按主题分类)。
\documentclass{article}
\usepackage{lipsum}
\setlength\intextsep{0pt plus 0pt minus 0pt}
\begin{document}
\lipsum[1]
\begin{figure}[h]
\rule{4cm}{4cm}
\end{figure}
\prevdepth=-1000pt
\lipsum[2]
\end{document}
很难想出这样做的充分理由。