# Different spacing for same enumerate in and out the tcolorbox

Here in the MWE:

\documentclass{article}
\usepackage[a4paper, portrait, margin=1in, top=.25in, bottom=1.75in]{geometry}
\usepackage{%
fontspec,
parskip,
lastpage,
booktabs,
polyglossia,
graphicx,
fancyhdr,
lato
}

\usepackage[many]{tcolorbox}

\usepackage[shortlabels]{enumitem}

\setmainfont{Lato}

\usepackage{hyperref}

\renewcommand{\footrulewidth}{1pt}
\rfoot{}
\pagestyle{fancy}

\setcounter{secnumdepth}{-1}

\begin{document}
\begin{center}
\begin{tcolorbox}[enhanced jigsaw,opacityback=0,sharp corners]
\begin{enumerate}
\item This is 1
\item This is 2
\end{enumerate}
\end{tcolorbox}
\end{center}
\begin{enumerate}
\item This is 1
\item This is 2
\end{enumerate}

\end{document}


The enumerate spacing between items in and out the tcolorbox is different.

How do I get the spacing in tcolorbox to be the same as that out the tcolorbox (the default spacing between items)?

• So which spacing do you want? The inner can be achieved by setting noitemsep for lists. For the outer you would have to set \itemsep. Btw: Do not use center around a tcolorbox. – TeXnician Nov 4 '17 at 8:21
• Sorry I thought I had commented in your other question about this but I must have got distracted and then forgot. – Ulrike Fischer Nov 4 '17 at 9:52
• @UlrikeFischer Not a problem. I thought a new question would be useful, anyway. And thanks for your reply here. Works perfectly. – deshmukh Nov 5 '17 at 11:19
• @TeXnician I could have explicitly mentioned it. But I was aiming to get the 'default' spacing in the lists, i.e. out the tcolorbox. I have edited the question to include this. And thanks for pointing out redundant center environment. – deshmukh Nov 5 '17 at 11:22

You are using the parskip package but tcolorbox uses internally a minipage which resets parskip. If you want as spacing the one you get outside the box you can avoid the change of the inner spacing with the parbox=false option:

\documentclass{article}
\usepackage[a4paper, portrait, margin=1in, top=.25in, bottom=1.75in]{geometry}
\usepackage{%
fontspec,
parskip,
lastpage,
booktabs,
polyglossia,
graphicx,
fancyhdr,
lato
}

\usepackage[many]{tcolorbox}

\usepackage[shortlabels]{enumitem}

\setmainfont{Lato}

\usepackage{hyperref}

\renewcommand{\footrulewidth}{1pt}
\rfoot{}
\pagestyle{fancy}

\setcounter{secnumdepth}{-1}

\begin{document}
\begin{center}
\begin{tcolorbox}[enhanced jigsaw,opacityback=0,sharp corners,parbox=false]
\begin{enumerate}
\item This is 1
\item This is 2
\end{enumerate}
\end{tcolorbox}
\end{center}
\begin{enumerate}
\item This is 1
\item This is 2
\end{enumerate}

\end{document}


You can simply achieve the inner spacing by setting noitemsep using enumitem. (Btw: I've removed the unnecessary center environment.)

\documentclass{article}
\usepackage[a4paper, portrait, margin=1in, top=.25in, bottom=1.75in]{geometry}
\usepackage{%
fontspec,
parskip,
lastpage,
booktabs,
polyglossia,
graphicx,
fancyhdr,
lato
}

\usepackage[many]{tcolorbox}

\usepackage[shortlabels]{enumitem}

\setmainfont{Lato}

\usepackage{hyperref}

\renewcommand{\footrulewidth}{1pt}
\rfoot{}
\pagestyle{fancy}

\setcounter{secnumdepth}{-1}
\setlist[enumerate]{noitemsep}

\begin{document}
\begin{tcolorbox}[enhanced jigsaw,opacityback=0,sharp corners]
\begin{enumerate}
\item This is 1
\item This is 2
\end{enumerate}
\end{tcolorbox}
\begin{enumerate}
\item This is 1
\item This is 2
\end{enumerate}

\end{document}