Consider the MWE below. I would like to add some vertical space above the blue square, inside the framebox
(indicated by red arrow).
Why is \vspace
ignored? Which command should I use?
MWE:
\documentclass[twocolumn,a5paper]{article}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{tikz}
\begin{document}
\begin{figure}[t]
\centerline{\framebox{
\begin{tikzpicture}
\filldraw[blue] (0,0) |- (1,2) |- cycle;
\end{tikzpicture}
}}
\caption{Rectangle}
\end{figure}
\lipsum[1]
\begin{figure}[t]
\centerline{\framebox{
\vspace{2cm} %Why ignored?
\begin{tikzpicture}
\filldraw[blue] (0,0) |- (1,1) |- cycle;
\end{tikzpicture}
}}
\caption{Square}
\end{figure}
\lipsum[2]
\end{document}
Best Answer
I'm not sure why
\vspace
is ignored;\vspace*
, which preserves space at the top of a page is ignored as well.But inserting the equivalent of a strut at the top of the box will leave the white space you are looking for: