자체 정의된 환경의 두 인스턴스 사이의 공간

자체 정의된 환경의 두 인스턴스 사이의 공간

운동할 수 있는 환경을 만들어 봤습니다. 이제 문제는 다른 운동(운동 1, 운동 2 등)이 있는 경우 항상 그 사이에 약간의 공간이 있다는 것입니다. 배경색이 있는데 이게 중단되어서 꽤 멍청해 보이네요. 방해가 되지 않도록 색상이 중단되지 않도록 하고 싶습니다. 어떻게 해야 하나요? LaTeX가 환경 사이에 공백을 넣지 않도록 가르치기 위해 환경 정의를 수정하는 방법을 모르겠습니다....

내 코드는 다음과 같습니다.

\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}

(LaTeX는 텍스트 양에 따라 연습을 설정한다는 것을 알고 있지만, 페이지가 텍스트로 가득 차 있으면 페이지 사이에 약간의 공백이 있으므로 페이지 사이에 공백을 두기를 원하지 않습니다!)

답변1

\topsepBarbara가 알아차렸듯이 코드에서 4번을 사용하고 있습니다 . 두 개를 제거해야 \newtheoremstyle얻을 수 있습니다.

\newtheoremstyle{mystyle2}
  {}{}{}{}%
  {\bfseries}{}{.5em}{}%

따라서 불필요한 공간(음영 영역 내부)이 생기지 않습니다. 또한 의 다른 두 인스턴스에서는 like 와 같아야 합니다 \newmdtheoremenv.skipaboveskipbelow0pt

\newmdtheoremenv[hidealllines=true,
backgroundcolor=aufgaben,skipabove=0pt,
skipbelow=0pt]{aufgabe}{Aufgabe}

그리고 그것은 작동합니다.

여기에 이미지 설명을 입력하세요

관련 정보