
我使用我的浮標[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}
很難想出這樣做的充分理由。