3

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:
enter image description here

Why the box is not 5cm long?

Thank you!

0

1 Answer 1

7

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} 

enter image description here

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .