멀티콜에 의해 도입된 허위 수직 공간(추가 사례)

멀티콜에 의해 도입된 허위 수직 공간(추가 사례)

다음과 중복된 것 같습니다.다중 열로 인해 발생하는 허위 [?] 수직 공간, 그러나 거기의 솔루션이 나에게 도움이 되지 않는 것 같습니다. 기본적으로 나는 multicols다음을 사용하는 경우를 원합니다 .~ 아니다소개 텍스트와 목록 사이의 세로 간격을 변경합니다. 오른쪽의 출력은 다음을 사용하고 있습니다 multicols.

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

환경 뒤에는 추가 공간도 있습니다 multicols.

노트:

  • minipage문제를 설명하기 위해 환경이 사용되었습니다 . 나는~ 아니다이것이 추가 수직 공간 문제에 영향을 미치고 있다고 생각합니다.
  • 패키지 tikz가 사용됩니다.오직간격 문제를 강조합니다.

암호:

\documentclass{article} 
\usepackage{tikz}
\usepackage{enumitem}

\usepackage{multicol}
\raggedcolumns

%\setlength{\multicolbaselineskip}{0pt}% Seems to have no effect


\begin{document} 
\begin{minipage}[t]{0.44\linewidth}
    The following are examples of numbers:
        \begin{itemize}
            \item 0ne,
            \item $\pi$,
            \item $2+3i$,
            and
            \item $0$.
        \end{itemize}%
    Some text following.
\end{minipage}%
\hfill%-------------------------
\begin{minipage}[t]{0.44\linewidth}
    %% https://tex.stackexchange.com/questions/161966/spurious-vertical-space-introduced-by-multicols
    %\setlength{\topskip}{\fontcharht\font`B }% Seems to have no effect
    The following are examples of numbers:
    \begin{multicols}{2}
        \begin{itemize}
            \item 0ne,
            \item $\pi$,
            \item $2+3i$,
            \item $0$.
            \item Two,
            \item $e$,
            \item $2-3i$,
            and
            \item $-0$.
        \end{itemize}%
    \end{multicols}
    Some text following.
\end{minipage}%
% Following manually tweaked to show the problem.
\begin{tikzpicture}[overlay, remember picture]
    \draw [red]  (-11.5cm,-1.16cm) -- ++(4.8in,0);
    \draw [blue] (-11.5cm,-1.86cm) -- ++(4.8in,0);
    \draw [orange] (-11.5cm,-3.95cm) -- ++(4.8in,0);
\end{tikzpicture}
\end{document} 

결과 (2014-08-25)

다음은 Frank Mittelbach의 MWE에서 얻은 결과입니다(다음 텍스트의 간격이 올바르지 않음).

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

\listfiles의 출력:

방금 업데이트했어요모두테스트를 실행하기 전에 TeXLive2014의 패키지를 다운로드하세요. 그렇다면 내 패키지 중 하나가 오래된 것인가요, 아니면 TeXLive2014 릴리스에 문제가 있는 것인가요?

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/05/08 v1.15 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
enumitem.sty    2011/09/28 v3.5.2 Customized lists
multicol.sty    2014/04/23 v1.8e multicolumn formatting (FMi)
etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
supp-pdf.mkii
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
  omscmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions

답변1

와 같은 목록이 itemize미니페이지 시작 부분에 배치되면 목록 앞의 일반적인 수직 간격은 생략됩니다.

당신이 한 방식을 추가하면 미니페이지처럼 목록 multicols주위에 상자가 생성되므로 이 추가되지 않습니다. 대신에 표시되는 것은 환경 전후에 추가된 것 입니다 .itemize\topsep\multicolsepmulticol

기사 클래스(10pt)는 \topsep8pt + 2pt - 4pt 값을 가지며, \multicolsep경험한 차이의 대부분을 설명하는 12pt와 같은 값을 갖습니다. 따라서

\setlength\multicolsep{\topsep}

이론적으로는 문제를 해결해야 합니다.

\prevdepth그러나 귀하의 예에서는 환경 이후에 1.9994pt 정렬 불량을 설명하는 다중 열 처리의 결함도 보여주었습니다 ("박스형" 모드에서만 발생합니다. 즉, 환경이 미니페이지 또는 이와 유사한 내에 나타나는 경우).

따라서 추가로 지금은 다중 콜 내부 기능 중 하나를 패치해야 합니다.

\usepackage{etoolbox}

\makeatletter

\patchcmd\page@sofar{\kern-\dimen\tw@ \ifdim\dimen\tw@}
  {\kern-\dimen\tw@  \prevdepth\z@ \ifdim\dimen\tw@}
  {\typeout{Success!}}{\ERRORpatching}

\makeatother

이 두 가지 조정을 통해 다음이 표시됩니다.

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

여기에 요청한 대로 전체 MWE가 있습니다. 이것이 작동하지 않으면 multicol아마도 이전 버전이 있을 수 있습니다. 이 버전은 2014/06/19 v1.8f 버전에서 실행되었습니다.

\documentclass{article} 
\usepackage{tikz}
\usepackage{enumitem}


\usepackage{multicol}
\raggedcolumns

\usepackage{etoolbox}

\setlength\multicolsep{\topsep}

\makeatletter

\patchcmd\page@sofar{\kern-\dimen\tw@ \ifdim\dimen\tw@}
  {\kern-\dimen\tw@  \prevdepth\z@ \ifdim\dimen\tw@}
  {\typeout{Success!}}{\ERRORpatching}

\makeatother


\begin{document} 
\begin{minipage}[t]{0.44\linewidth}
    The following are examples of numbers:
        \begin{itemize}
            \item 0ne,
            \item $\pi$,
            \item $2+3i$,
            and
            \item $0$.
        \end{itemize}%
    Some text following.
\end{minipage}%
\hfill%-------------------------
\begin{minipage}[t]{0.44\linewidth}
    %% http://tex.stackexchange.com/questions/161966/spurious-vertical-space-introduced-by-multicols
    %\setlength{\topskip}{\fontcharht\font`B }% Seems to have no effect
    The following are examples of numbers:
    \begin{multicols}{2}
        \begin{itemize}
            \item 0ne,
            \item $\pi$,
            \item $2+3i$,
            \item $0$.
            \item Two,
            \item $e$,
            \item $2-3i$,
            and
            \item $-0$.
        \end{itemize}%
    \end{multicols}%
    Some text following.
\end{minipage}%
% Following manually tweaked to show the problem.
\begin{tikzpicture}[overlay, remember picture]
    \draw [red]  (-11.5cm,-1.16cm) -- ++(4.8in,0);
    \draw [blue] (-11.5cm,-1.86cm) -- ++(4.8in,0);
    \draw [orange] (-11.5cm,-3.95cm) -- ++(4.8in,0);
\end{tikzpicture}
\end{document} 

업데이트

이 문제에 대한 수정 사항이 1.8g에 추가되었습니다 multicol. 새 버전은 이제 CTAN에 있으며 며칠 안에 업데이트 기능이 있는 배포판에 표시될 것입니다(Heiko가 tls 패키지를 제공하면).

에 대한 적절한 설정은 \multicolsep여전히 ​​필요합니다(항상 그럴 것입니다).

관련 정보