我想减少 mdframed 环境中两行之间的空间。
\mdfdefinestyle{round}{
innertopmargin=0pt,innerbottommargin=10pt,innerleftmargin=1pt,innerrightmargin=1pt,
middlelinewidth=3pt,innerlinewidth=0.4pt,outerlinewidth=0.4pt}
\begin{table}[tbp]
\label{tab:Liste}
\begin{mdframed}[style=round]
\caption{XXX}
\begin{multicols}{2}
{\RaggedRight
\begin{enumerate}
\item 1
\item 2
\item ...
\end{enumerate}}
\end{multicols}
\end{mdframed}
\end{table}
我已经尝试过,,skipbelow
但skipabove
都没有用。
提前致谢
答案1
该空间归因于\multicolsep
:
\documentclass{article}
\usepackage{mdframed,multicol,ragged2e}
\mdfdefinestyle{round}{
innertopmargin=0pt,
innerbottommargin=10pt,
innerleftmargin=1pt,
innerrightmargin=1pt,
middlelinewidth=3pt,
innerlinewidth=0.4pt,
outerlinewidth=0.4pt
}
\begin{document}
\begin{table}
\begin{mdframed}[style=round]
\setlength\multicolsep{0pt} % <--- added; here it's a local setting
\caption{XXX}\label{X}
\begin{multicols}{2}
\begin{enumerate}
\RaggedRight
\item some text that should go across three lines
in order to show that they are set ragged right
\item 2
\item ...
\end{enumerate}
\end{multicols}
\end{mdframed}
\end{table}
\end{document}
请注意,\RaggedRight
可以将其放在后面\begin{enumerate}
,从而避免使用额外的括号,从而简化输入。还请注意\label
必须追赶\caption
。