当图形包含在附加小页中时,后面的空格会发生变化

当图形包含在附加小页中时,后面的空格会发生变化

有人能告诉我这种行为的根源是什么吗?

我有以下 MVE

\documentclass[a4paper,10pt,notitlepage]{article}
\usepackage{geometry} 
\geometry{
    a4paper,
    head=20mm,
    left=20mm,
    right=10mm,
    top=25mm,
    bottom=25mm,
    foot=8mm
}
\usepackage[default,scale=0.95]{opensans} %Schriftart FEHLER

\usepackage{graphicx} 
\usepackage{caption}
\usepackage{subcaption} 
\usepackage{xcolor}
\usepackage{setspace}   
\usepackage{floatflt,epsfig} 
\usepackage{blindtext}

\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{1pt}%
\setlength{\abovecaptionskip}{7pt}
\setlength{\belowcaptionskip}{7pt}
\setlength{\textfloatsep}{10pt}

\linespread{1.0}   
\setlength{\parindent}{0pt}                 % verhindert Absatzeinrueckung nach Bildern

\usepackage[framemethod=tikz]{mdframed}

% CAPTION STYLE
\DeclareCaptionFormat{labelstyle}{% <- needed
\setlength\fboxsep{3pt}% <- needed
\colorbox{blue}{{#1}}#2#3%
} 
\definecolor{blue}{HTML}{336699}
\captionsetup[table]{singlelinecheck=false, labelfont={color=white}}    % Rechtsbündige Tabellen und Bildbeschreibung
\captionsetup[figure]{format=labelstyle, labelfont={color=white}, 
justification=raggedright,% <- only needed if longer captions should not be justified
singlelinecheck=false% <- added
}

\newcommand{\midpict}[4]{%
\begin{center}
    \begin{minipage}{#2\textwidth}
        \includegraphics[width=\linewidth]{#1}
        \captionof{figure}{#3}\label{#4}
    \end{minipage}
\end{center}%
}
\newmdenv[nobreak=true,backgroundcolor=white!20,linecolor=black,skipabove=10,skipbelow=10]{whitebox}

\begin{document}
%\input{./doc-config.tex}


\begin{minipage}{\textwidth} %<--- It's about this one
    \blindtext
    \midpict{./content/figures/placeholder.png}{0.5}{Caption}{fig:A}
\end{minipage}
\blindtext
\midpict{./content/figures/placeholder.png}{0.5}{Caption2}{fig:A}
\blindtext % <- Here the skip is as expected
\end{document}

我经常将图像与一些说明性文字配对,如果我不想让 Latex 在图像和文本之间包含分页符,我会将两者放在一个附加minipage环境中。但这会将图像后的空间更改为下一个元素。为什么这个附加元素minipage会产生影响,我必须操纵什么参数才能使图像和后面的文本/另一个图像之间的间距与没有另一个图像时相同minipage

相关内容