# Why I don't get the wanted width of tcbox?

Here is a MWE:

\documentclass{scrartcl}
\usepackage[svgnames,x11names]{xcolor}
\usepackage{fancyhdr,tcolorbox}
\pagestyle{fancy}
\cfoot{\tcbox[colback=Khaki1!25!white,colframe=DarkGoldenrod2!75!black,arc=1mm,width=5cm]{\textit{\emph{\thepage}}}}

\begin{document}

abc

\end{document}


The result at the bottom of the page is:

Why the box is not 5cm long?

Thank you!

You need to change the capture mode, if you want the box not to fit to the contents:

\documentclass{scrartcl}
\usepackage[svgnames,x11names]{xcolor}
\usepackage{fancyhdr,tcolorbox}
\pagestyle{fancy}
\cfoot{\tcbox[capture=minipage,colback=Khaki1!25!white,colframe=DarkGoldenrod2!75!black,arc=1mm,width=5cm]{\textit{\emph{\thepage}}}}

\begin{document}

abc

\end{document}


• My compliments. I was trying to read the manual :-) – Sebastiano Mar 18 at 22:57
• When I tried to add shadow - it's not added, do you now why? Thank you!! – heblyx Mar 18 at 23:01
• shadows need the enhanced skin. – Ulrike Fischer Mar 18 at 23:02
• Yes, I put \tcbuselibrary{skins} but still there is no shadow... – heblyx Mar 18 at 23:03
• Works fine for me, enhanced,drop shadow=blue, gives a shadow. – Ulrike Fischer Mar 18 at 23:06