I have the following situation, where I have produced two boxes with text inside using the package tcolorbox
:
\documentclass[a4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcolorbox}[colback=black!8!white,colframe=black, width=3cm]
\centering Males
\end{tcolorbox}
\begin{tcolorbox}[colback=black!8!white,colframe=black, width=3cm]
\centering Females
\end{tcolorbox}
\end{document}
However, with this code both boxes appear in different lines, and I would like to have them on the same line and to be able to adjust the distance between them using \hspace*{}
.
How can this be done, preferably in a simple way?
Edit: the answers I received here are way more helpful, short and elegant than those provided in the related question that caused the close votes. For this reason, I don't believe the question should be closed.
Best Answer
You can use the
before
andafter
options: