2

I'm trying to vertically center a tcolorbox on a page, but with the code below the box isn't exactly at the middle of the page.

So far I've tried this:

\documentclass[12pt]{article}

\usepackage{geometry}
\geometry{paper=letterpaper,margin=2cm}

\usepackage[autostyle]{csquotes}

\usepackage[dvipsnames]{xcolor}
\definecolor{marronMedio}{HTML}{AB8000}
\definecolor{amariClaro}{HTML}{FFFFCA}
\definecolor{grisMedio}{HTML}{999999}

\usepackage[many]{tcolorbox}

\newtcolorbox{phrasebox}{
  %fuzzy shadow={0.25cm}{-0.25cm}{0cm}{0.25mm}{fill=grisMedio},
  sharp corners=downhill,
  arc=7mm,
  width=12cm,
  height=5cm,
  enhanced jigsaw,
  before upper=\Large,
  halign=flush center,
  valign=center,
  colframe=marronMedio,
  boxrule=0.7mm,
  colback=amariClaro
}

\begin{document}
  \pagenumbering{gobble}
  \centering
  \vspace*{\fill}
  \begin{phrasebox}
    \enquote{Everything you can imagine is real.}\\[0.5cm]
    \textit{--- Pablo Picasso}
  \end{phrasebox}
  \vspace*{\fill}
\end{document}

And the result is here:

Output of compiling the given code.

As you can see, there is slightly more space at the top of the page than at the bottom.

How can I get rid of this problem?

Any help will be appreciated.

4

Jsut add an empty boxes at the end of the page:

\documentclass[12pt]{article}

\usepackage{geometry}
\geometry{paper=letterpaper,margin=2cm, showframe}

\usepackage[autostyle]{csquotes}

\usepackage[dvipsnames]{xcolor}
\definecolor{marronMedio}{HTML}{AB8000}
\definecolor{amariClaro}{HTML}{FFFFCA}
\definecolor{grisMedio}{HTML}{999999}

\usepackage[many]{tcolorbox}

\newtcolorbox{phrasebox}{
  %fuzzy shadow={0.25cm}{-0.25cm}{0cm}{0.25mm}{fill=grisMedio},
  sharp corners=downhill, arc=7mm, width=12cm, height=5cm, enhanced jigsaw, before upper=\Large, halign=flush center, valign=center, colframe=marronMedio, boxrule=0.7mm, colback=amariClaro
}

\begin{document}
  \pagenumbering{gobble}
  \centering
  \vspace*{\fill}
  \begin{phrasebox}
    \enquote{Everything you can imagine is real.}\\[0.5cm]
    \textit{--- Pablo Picasso}
  \end{phrasebox}
  \vspace*{\fill}\mbox{}

\end{document} 

enter image description here

| improve this answer | |
  • Wow. .-. This community is suprising me more and more. Thanks a lot! It worked! =) – user101590 May 29 '16 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy