mdframed 환경 내에서 \vspace{\stretch{1}}가 작동하지 않는 문제

mdframed 환경 내에서 \vspace{\stretch{1}}가 작동하지 않는 문제

mdframed 환경 내에서 \vspace{\stretch{1}}를 사용하는 데 문제가 발생했습니다. 프레임 내부의 정리 뒤에 수직 공간을 추가하려고 하는데 \vspace{\stretch{1}} 명령이 예상대로 작동하지 않는 것 같습니다.

\vspace{x cm}를 사용할 수 있다는 것을 알고 있지만 사용하고 싶지 않습니다. 페이지를 균등하게 나누고 싶습니다.

나는 가지고있다

내가 가지고 있는 최소한의 예는 다음과 같습니다.

\documentclass{article}
\usepackage{amsthm}
\usepackage{mdframed}
\usepackage{xcolor}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}

\begin{document}

\begin{mdframed}[
    linecolor=blue,
    linewidth=2pt,
    backgroundcolor=orange!20,
]
\begin{theorem}
  Some subtheorem.
\end{theorem}
\vspace{\stretch{1}}
\end{mdframed}

\end{document}

답변1

x\par\vfill x 이는 미니페이지나 \parbox에서 사용하는 것과 동일한 문제입니다 . 다음 제품에서는 작동하지 않습니다:

\fbox{\begin{minipage}{3cm} x\par\vfill x \end{minipage}} 

왜냐하면, 좋아요, 상자를 채우고 싶으시겠지만... 얼마나 멀리요? 상자에는 미리 정의된 높이가 없습니다.

페이지에 강제 높이가 있으므로 본문에서 작동합니다. 뭔가로 늘려야만 늘어납니다. 미니페이지에서는 상자 높이를 고정할 수 있습니다.

\fbox{\begin{minipage}[c][3cm][c]{3cm} x\par\vfill x \end{minipage}} 

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

tcolorboxmdframed 대신 높이 수정 옵션을 허용하는 a를 사용하는 경우 에도 작동하지 않습니다.

\begin{tcolorbox}[height=3cm]  x\par  \vfill x \end{tcolorbox}

(버그가 아니라 기능이에요!)

페이지를 균등하게 나누고 싶어요

동일한 상자를 원한다면 tcolorbox의 래스터 라이브러리를 사용할 수 있으므로 모든 상자의 높이는 높이가 더 높은 상자로 고정됩니다.

mwe2

\documentclass[twocolumn]{article}
\usepackage[raster]{tcolorbox}
\begin{document}

\begin{tcbraster}[raster columns=1, size=small, title={\sffamily\bfseries Free  height box No. \thetcbrasternum}]
\begin{tcolorbox}First box\end{tcolorbox}
\begin{tcolorbox}Second box\end{tcolorbox}
\begin{tcolorbox}This is a box\\with a second line \\ with a third line \\ with a fourth line  \end{tcolorbox}
\begin{tcolorbox}Another box\end{tcolorbox}
\begin{tcolorbox}A box\par \vspace{.3 cm} again\end{tcolorbox}
\end{tcbraster}

\newpage

\begin{tcbraster}[raster columns=1, size=small, raster equal height,
size=small,colframe=red!50!black,colback=red!10!white,colbacktitle=red!50!white,coltitle=black,
title={\sffamily\bfseries Evenlized box No. \thetcbrasternum}]
\begin{tcolorbox}First box\end{tcolorbox}
\begin{tcolorbox}Second box\end{tcolorbox}
\begin{tcolorbox}This is a box\\with a second line \\ with a third line \\ with a fourth line  \end{tcolorbox}
\begin{tcolorbox}Another box\end{tcolorbox}
\begin{tcolorbox}A box\par \vspace{.3 cm} again\end{tcolorbox}
\end{tcbraster}
\end{document}

관련 정보