그림이 단락 사이 중앙에 제대로 배치되지 않았습니다.

그림이 단락 사이 중앙에 제대로 배치되지 않았습니다.

나는 수레를 [h]. 이 명령을 사용할 때:

\setlength{\intextsep}{0pt plus 0pt minus 0pt}

위의 텍스트와 그림 사이의 구분을 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 없이 추측했지만 이제 시작됩니다...

0으로 설정하면 \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}

공간 없음

이렇게 하는 타당한 이유를 생각하기는 어렵습니다.

관련 정보