Just including the hyperref package seems to be inserting spurious space before a minipage and before a list. The MWE below produces the image on the right, but if the
\usepackage[colorlinks,breaklinks=true]{hyperref}
line is commented out, we get the spacing on the left.
Note that additional space is inserted
- before the
minipageand - before the first list item.
I would like to eliminate both of these.
Update: 2019-05-08
Using
\vspace*{-\topskip}%
\nointerlineskip\noindent
as per Heiko's answer, indeed remove the excess space before the minipage (second MWE), but does not remove the excess vertical space before the first list \item:
By commenting out the \usepackage[colorlinks,breaklinks=true]{hyperref} in the second MWE you can see the desired spacing before the first \item.
Note:
- Using
being{NoHyper}... \end{NoHyper}is not really an option as I have links within the text. I don't need to be able to link back to the list\itemthough (in case that helps).
Listfiles
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
enumitem.sty 2011/09/28 v3.5.2 Customized lists
geometry.sty 2010/09/12 v5.6 Page Geometry
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
ifpdf.sty 2017/03/15 v3.2 Provides the ifpdf switch
ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
showframe.sty 2011/02/24 v0.1i showframe (new impl., RN)
eso-pic.sty 2015/07/21 v2.0g eso-pic (RN)
atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
hyperref.sty 2018/02/06 v6.86b Hypertext links for LaTeX
hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
pdftexcmds.sty 2018/01/21 v0.26 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty 2016/05/16 xcolor patch
atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
pd1enc.def 2018/02/06 v6.86b Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
hpdftex.def 2018/02/06 v6.86b Hyperref driver for pdfTeX
rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
supp-pdf.mkii
nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
Code: Original
\documentclass{article}
\usepackage{enumitem}
\usepackage[textwidth=4.5cm]{geometry}% For better images to compare
\usepackage{showframe}
%% Correct spacing if this is commented out
\usepackage[colorlinks,breaklinks=true]{hyperref}
\begin{document}%
\noindent
\fbox{%
\begin{minipage}[t][3.0cm][t]{3.5cm}
\begin{enumerate}
\item First Item
\item Second Item
\item Third Item
\item Fourth Item
\end{enumerate}%
\end{minipage}%
}%
\end{document}%
Updated Code: Fixes spacing before minipage
\documentclass{article}
\usepackage{enumitem}
\usepackage[textwidth=4.5cm]{geometry}% For better images to compare
\usepackage{showframe}
%% Correct spacing if this is commented out
\usepackage[colorlinks,breaklinks=true]{hyperref}
\begin{document}%
\vspace*{-\topskip}%
\nointerlineskip\noindent
\fbox{%
\begin{minipage}[t][3.0cm][t]{3.5cm}
\begin{enumerate}
\item First Item
\item Second Item
\item Third Item
\item Fourth Item
\end{enumerate}%
\end{minipage}%
}%
\end{document}%




\parbox{3.5cm}however – Mar 24 '18 at 22:29parbox, but still has additional space before the list. – Peter Grill Mar 24 '18 at 22:31tis important for the problem here, try\parbox[t]{3.5cm}. – Heiko Oberdiek Mar 24 '18 at 22:38hyperrefpackage or when creating a new environment. – Peter Grill Mar 11 '20 at 20:37