我们遇到了有关 mdframed 后面紧接着 minipages 的垂直对齐问题。Latex 不会将对象直接放在彼此后面。它会将它们分布在整个页面上,并最大化它们之间的垂直空间。以下代码显示了问题(在 mdframed 之后)。有人知道如何让下一个 minipage 紧挨着 mdframed 的末尾吗?
谢谢!
沃尔克
\documentclass[a4paper,12pt, twoside, bibliography=totocnumbered]{scrreprt}
\usepackage{ngerman}
\usepackage[utf8]{inputenc}
\usepackage{xspace}
\usepackage{mdframed}
\usepackage{xifthen}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[math]{iwona}
\textwidth165mm
\setlength{\marginparsep}{0cm}
\setlength{\marginparwidth}{1.5cm}
\setlength{\oddsidemargin}{-0.5cm}
\setlength{\evensidemargin}{-1.5cm}
\setlength{\topmargin}{-2cm}
\setlength{\textheight}{25cm}
\mdfdefinestyle{plainstyle}{%
backgroundcolor=lightgray,
hidealllines=true,
}
\setcounter{secnumdepth}{1}
\setcounter{tocdepth}{1}
\newcommand{\negation}[1]{\underline{\textbf{#1}}}
\newcommand{\highlightened}[1]{\textit{#1}}
\newcommand{\examIntroduction}[0]{}
\newcommand{\sectionDescription}[0]{}
\newcommand{\itemVignette}[0]{}
\newcommand{\questionVignette}[1]{\ifthenelse{\isempty{#1}}{#1}{#1\vspace{3mm}}}
\newcommand{\questionText}[0]{}
\newcounter{itemobject}
\renewcommand\theitemobject{\arabic{itemobject}}
\newcounter{questionobjectcase}[itemobject]
\renewcommand\thequestionobjectcase{
\stepcounter{questionobject}
\hfill\textbf{\arabic{questionobject}}\ \ \newline
{\normalfont\footnotesize{\ \ (Fall \arabic{itemobject})}}
}
\newcounter{questionobject}
\renewcommand\thequestionobject{\arabic{questionobject}}
\newcommand\testquestion{
\begin{minipage}[t]{15mm}
\begin{flushright}
\textbf{\stepcounter{questionobject}
\thequestionobject} \ \hspace{3mm}
\end{flushright}
\end{minipage}
\hfill
\begin{minipage}[t]{15cm}
\questionVignette{The quick brown fox jumps over the lazy dog. Jeder wackere Bayer vertilgt bequem zwo Pfund Kalbshaxen. Heavy boxes perform waltzes and jigs. The five boxing wizards jump quickly. Five quacking Zephyrs jolt my wax bed. A quick movement of the enemy will jeopardize six gunboats. Portez ce vieux whisky au juge blond qui fume. Zornig und gequält rügen jeweils Pontifex und Volk die maßlose bischöfliche Hybris. Die heiße Zypernsonne quälte Max und Victoria ja böse auf dem Weg bis zur Küste.}\par
\questionText{What is the correct answer?}\par
\begin{enumerate}[label=(\Alph*)]
\item Nothing
\item Everything
\item Nearly nothing
\item All of them
\item I don't know
\end{enumerate}
\vspace{10mm}
\end{minipage}
}
\begin{document}
\testquestion
\testquestion
\testquestion
\pagebreak
\begin{addmargin}{1.5cm}
\setcounter{questionobjectcase} {0}
Fallstudie Nr. \stepcounter{itemobject}
\theitemobject
\begin{mdframed}[style=plainstyle,userdefinedwidth=15cm]
\itemVignette{\lipsum}
\end{mdframed}
\end{addmargin}
\testquestion
\testquestion
\testquestion
\end{document}