I have created an environment for my excercises. The problem now is, that if I have different excercises (Excercise 1, Excercise 2 and so on) there is always a little space between them. I have a background color and this is interrupted, so it looks quite stupid. I want to have no interruption so the color is not interrupted. How can I do this? I do not know how to modify the definition of my environment to teach LaTeX to not do any spaces between it....
Here is my code:
\documentclass{book}
\usepackage{geometry}
\geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}
\usepackage[ngerman]{babel}
\usepackage[final]{pdfpages}
\usepackage{xcolor,bookmark}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage[bottom]{footmisc}
\usepackage{shadethm}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{paralist}
\usepackage{amssymb}
\usepackage[framemethod=tikz]{mdframed}
\definecolor{aufgaben}{rgb}{0.9333,0.93333,0.933333}
\newtheoremstyle{mystyle2}
{\topsep}{\topsep}{}{}%
{\bfseries}{}{.5em}{}%
\theoremstyle{mystyle2}
\newmdtheoremenv[hidealllines=true,
backgroundcolor=aufgaben,skipabove=\topsep,
skipbelow=\topsep]{aufgabe}{Aufgabe}
\begin{document}
text\\ a lot of text\\
\begin{aufgabe}
the excercise
\end{aufgabe}
%no space here! please!
\begin{aufgabe}
the next excercise
\end{aufgabe}
text\\
ext\\
ext\\ really a lot of text\\ text\\ text\\
ext\\ text\\ text\\
\end{document}
(I know that LaTeX sets the excercises dependend on how much text there is, but also, if the page is full of text there is still a bit space between it, I do not want to have any space between it!)
skipabove
andskipbelow
.\topsep
in four places, any of which could have the effect of inserting space above or below the theorem. in particular, theskipabove
andskipbelow
insert space outside the shaded area; i don't know why @HarishKumar deleted his answer, because it would solve at least part of the problem.