这是我尝试过的代码:
\begin{figure}[h]
\renewcommand{\arraystretch}{1.5}
\centering
\scalebox{.8}
{
\begin{tabular}{>{\center}p{10cm}}
\framebox[10cm]{Some text here} \\
\framebox[10cm]{\{Some text here\}} \\
\framebox[10cm]{Some text here} \\
\framebox[10cm]{Some text here} \\
\framebox[10cm]{Some text here} \\
%\framebox[8cm]{\colorbox{BlueGreen}{Some text here}} \\
%\colorbox{BurntOrange}{Some text here} \\
\end{tabular}
}
\caption{User registration phase of proposed scheme}
\label{fig:User registration phase}
\end{figure}
答案1
在该包的帮助下tcolorbox
:
\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{tcolorbox}
\newtcolorbox{mybox}[2]{
arc=0pt,
boxrule=#2pt,
colback=#1,
width=10cm,
halign=center,
}
\begin{document}
\begin{figure}
\centering
\begin{mybox}{green}{0}
Some text
\end{mybox}
\begin{mybox}{white}{1}
some text
\end{mybox}
\begin{mybox}{yellow}{0}
some text
\end{mybox}
\begin{mybox}{white}{1}
some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text
\end{mybox}
\caption{User registration phase of proposed scheme}
\label{fig:User registration phase}
\end{figure}
\end{document}