问题是文本和框之间的垂直空间比我想要的要大。我试图缩短框和文本之间的间隙,但没有用。我认为这可能是由于环境的某些方面,multicols
因为没有环境,间隙会短得多。
以下是代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{enumitem}
\RequirePackage{xcolor}
\RequirePackage{tikz}
\usepackage{framed}
\usepackage{xspace}
\RequirePackage{geometry}
\geometry{footskip=2cm,left=2.2cm,right=2cm,top=2cm,bottom=4.3cm,rmargin=4cm}
\begin{document}
\newenvironment{notes}
{\def\FrameCommand{\fboxsep=\FrameSep\fcolorbox{black}{white}}%
\MakeFramed {\advance\hsize-\width \FrameRestore}
\noindent{ }\begin{multicols}{3}\raggedcolumns%
\vspace{0.1cm}
\noindent\hspace{-0.15cm}}
{\end{multicols}\vspace{0.2cm}\endMakeFramed}
\begin{notes}
tehah sa d jsa dsah fdksa f djs afhd safds ahf dsaf dsa hfd sa
sdakjf dskjafjdsjka fjdsjkafjdsjafjdjs fak djsafkd sj afjdsja fd sjafdsa
fd safd kjsafkjdsafkjd sjaf jd fd sa fd sajf kds af jds akj fdsa
fd skja fkjd sfa jds afjds ak sha dhs aj ds afd sa ds shDSAD sa HCDSH CDhj hjds ahd sa ds a ds ah dsa jd hsa d sa ds avjlfd hld sahf dlsa fhd saf dsahfdshfadsf dhs f jds jf dsfhd sf dh fsfh ds fd s fjds f dh hs fh ds fjds f hdfsdshfd h fds fd s f djs hafd kfadjsahfdnbafds a df di ff f r fh frhuf hrf fr fiu hfe fhfdsfds hfds kj kjfd fs kdfsf jds f ds js ks jfkd sds
\end{notes}
\end{document}
答案1
RTFM?multicols
插入到\multicolsep
环境主体之前和之后。
\newenvironment{notes}
{\def\FrameCommand{\fboxsep=\FrameSep\fcolorbox{black}{white}}%
\MakeFramed {\advance\hsize-\width \FrameRestore}%
\setlength\multicolsep{0pt}%
\begin{multicols}{3}\raggedcolumns
% \vspace{0.1cm} % what is this doing?
% \noindent\hspace{-0.15cm}% what is this supposed to achieve? I guess this
% should have been
\noindent\ignorespaces
}
{\end{multicols}\endMakeFramed}