TransWikia.com

Why does a columnbreak between equation environments insert vertical space?

TeX - LaTeX Asked on December 6, 2020

documentclass{article}
usepackage{lipsum}
usepackage{multicol}
usepackage{nccmath}
begin{document}
    setlength{columnseprule}{0.4pt}
    begin{multicols}{2}
        begin{equation} a = a end{equation}
        columnbreak % why does this columnbreak insert vspace?
        begin{equation} a = a end{equation}
    end{multicols}
    begin{multicols}{2}
        begin{equation} a = a end{equation}
        begin{equation} a = a end{equation}
    end{multicols}
end{document}

rendered MWE

2 Answers

Inserting an empty line in-front of the columnbreak makes it look the same.

Answered by josh on December 6, 2020

You can set, locally, multicolsep to 0pt. However, it would be simpler to use tabularx: I propose to define a newcolumn type with cells contents automatically in the equation environment, making the typing very simple:

documentclass{article}
usepackage{lipsum}
usepackage{multicol}
usepackage{nccmath}
usepackage{tabularx}
makeatletter
newcommand*{compress}{@minipagetrue}
makeatother

newcolumntype{E}{@{}>{compressequation}X<{endequation}@{}}

begin{document}
lipsum[11]
  setlength{columnseprule}{0.4pt}
 {setlength{multicolsep}{0pt}
    begin{multicols}{2}
        begin{equation} a = a end{equation}
        columnbreak % why does this columnbreak insert vspace?
        begin{equation} a = a end{equation}
    end{multicols}
    begin{multicols}{2}
        begin{equation} a = a end{equation}
        begin{equation} a = a end{equation}
    end{multicols}
}
vspace{4ex}

   {centeringbelowdisplayskip=0pt
    begin{tabularx}{textwidth}{@{}E@{enspace}|@{enspace}E@{}}
    a = a & a = a [-1ex]
     a = a & a = a
    end{tabularx}
}
end{document} 

enter image description here

Answered by Bernard on December 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP