# Strange interaction of minipage, multicol and xcolor

I'm not a big expert of LaTeX (and I know almost nothing of the underlying TeX engine), so sorry if the answer is more obvious than what appears to me.

Can someone tell me why simply loading the xcolor package changes the appearance of the PDF created compiling the following snippet (cut down from real code in order to provide a MWE):

\documentclass{report}

\usepackage{ multicol }
\usepackage{ xcolor }

\begin{document}

\begin{minipage}{\textwidth}
Inside Minpage:
\begin{multicols}{3}
\begin{enumerate}
\item item1
\item item2
\item item3
\item item4
\item item5
\item item6
\end{enumerate}
\end{multicols}
\end{minipage}

\vspace{4 em}

Outside Minipage:
\begin{multicols}{3}
\begin{enumerate}
\item item1
\item item2
\item item3
\item item4
\item item5
\item item6
\end{enumerate}
\end{multicols}

\end{document}


See the result here, and in particular the misalignment of item6 inside the minipage:

However, if I comment out the \usepackage{ xcolor } line I get this result:

I'm using pdflatex command of TexLive-2014 (32 bit edition), under Windows7-64bit.

To be clearer, the problem is the vertical misalignment that the mere inclusion of xcolor generates. Is this a known problem? Is there a possible workaround which is easily applicable? With easy I mean not messing with the TexLive installation in any way. Possibly it should involve simple LaTeX settings (I have a complex setup where Lua code generates LaTeX code which is eventually compiled to PDF, so I'd like to avoid changing too much of that LaTeX-generating code).

At worst I'll ditch xcolor, but then I'd need a replacement for coloring text: no need to do complex things, but must be available in TeXLive.

Any help greatly appreciated!

EDIT

Trying to find out the problem I discovered that the same happens with the color package. Could this give hints to track down the source of the problem?

Moreover, since a Linux user in a comment said it wasn't reproducible, I also re-tested changing end-of-line characters to simple LF, instead of the canonical Windows CR-LF, but to no avail. I also switched the .tex file encoding to plain ASCII (before it was UTF-8), but it shouldn't matter since in the MWE there are no non-ASCII character, but you never know. Anyway, no luck, the problem is still there.

In case it might be useful, this is the command line I use (automatically generated by my text editor, SciTE):

"G:\root\prg\office\tex\app\texlive/bin/win32/pdflatex.exe" -shell-escape -halt-on-error "bug_xcolor.tex"


And these are the first lines logged by the program:

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014/W32TeX) (preloaded format=pdflatex)
\write18 enabled.
entering extended mode
(./bug_xcolor.tex
LaTeX2e <2014/05/01>


EDIT (prompted by a comment of @cfr)

Here are the lists of files output using \listfiles.

This is when neither color nor xcolor is loaded:

 *File List*
report.cls    2007/10/19 v1.4h Standard LaTeX document class
size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
multicol.sty    2014/04/23 v1.8e multicolumn formatting (FMi)
***********


When using color:

 *File List*
report.cls    2007/10/19 v1.4h Standard LaTeX document class
size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
multicol.sty    2014/04/23 v1.8e multicolumn formatting (FMi)
color.sty    2014/04/23 v1.1a Standard LaTeX Color (DPC)
color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
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)
supp-pdf.mkii
***********


When using xcolor:

*File List*
report.cls    2007/10/19 v1.4h Standard LaTeX document class
size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
multicol.sty    2014/04/23 v1.8e multicolumn formatting (FMi)
xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
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)
supp-pdf.mkii
***********


EDIT

Problem solved thanks to the help of @cfr. It appears that the TL2014 distribution I've installed introduced a bug (switching back to an older TL2010 distribution made the problem disappear).

Issue fixed by updating the file multicol.sty in the distribution to the latest available version on CTAN (v1.8m).

• I can't reproduce this with TeX Live 2015. Here's my output with the code posted (i.e. with xcolor): results. Maybe a simple update of your TL installation would work? Then again, I can't reproduce with TL 2014 or 2013 either. This is using pdfLaTeX on GNU/Linux (64 bit). – cfr Aug 23 '15 at 19:03
• @cfr Sadly I cannot touch the installation at all (various reasons). BTW, could posting the command line arguments I use be of help in diagnosing the problem (assuming it's not installation related - maybe a Windows issue)? – Lorenzo Donati -- Codidact.com Aug 23 '15 at 21:36
• Yes, especially if you are using something non-standard. Check, too, that you do not have any forgotten versions of old packages or stale configuration files in your personal TEXMF tree (assuming you have one) as these can also cause oddities. – cfr Aug 23 '15 at 22:43
• You can also put \listfiles before \documentclass and post the list of files and versions here for people to compare. \listfiles should tell us exactly what you're using. – cfr Aug 23 '15 at 22:44
• @cfr I never touched anything inside the TeXLive dir tree. I don't know if pdflatex creates some configuration files in that tree, but I never touched anything myself. It is just as it was when I run the TL installer (bar modifications pdflatex could have done behind my back, if any). Thanks for that \listfiles hint, I didn't even know it existed! Question updated. – Lorenzo Donati -- Codidact.com Aug 23 '15 at 22:58

Note that in the following comparisons, I have filtered out perfect matches i.e. I only show lines where my output differs from yours.

My results for the MWE case with TL 2015:

  report.cls    2014/09/29 v1.4h Standard LaTeX document class
size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
multicol.sty    2015/03/31 v1.8m multicolumn formatting (FMi)


compared with yours:

 report.cls    2007/10/19 v1.4h Standard LaTeX document class
size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
multicol.sty    2014/04/23 v1.8e multicolumn formatting (FMi)


With TL 2014, I get:

  report.cls    2014/09/29 v1.4h Standard LaTeX document class
size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
multicol.sty    2014/10/28 v1.8i multicolumn formatting (FMi)


This suggests that your installation of TeX Live may never have been updated - certainly not to the final pre-2015 version.

With TL 2013:

  report.cls    2007/10/19 v1.4h Standard LaTeX document class
size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
multicol.sty    2011/06/27 v1.7a multicolumn formatting (FMi)


This suggests that the problem is essentially that you have a copy of multicol.sty which is either too new or too old but, unfortunately, not 'just right'. (I wonder if OverLeaf are using the same version of multicol - might explain some things.)

I would try the following but note that it may fail horribly, so be prepared for your document not to compile at all. Download a current copy of multicol from CTAN and place the .sty file in your working directory, with your .tex file. If this spawns mayhem, you can just delete the file.

Alternatively, if you can get hold of an old copy of multicol, it might also work. In fact, it should work in that case. But the updates may have fixed other bugs, so try updating it first.

• – cfr Aug 24 '15 at 1:32
• @LorenzoDonati Great! I'm going to delete some of my comments here to keep the system happy. I suggest you do the same. (Comments moved to chat have been deleted but are available via the link to the chat room.) – cfr Aug 24 '15 at 1:48