复制一个盒子 | 第 2 部分

复制一个盒子 | 第 2 部分

您可以关注第一部分这里

至于第 2 部分,我想知道如何复制您在下面看到的图像。

在此处输入图片描述

答案1

这可以通过库来完成raster

在此处输入图片描述

代码:

\documentclass{article}
\usepackage[many]{tcolorbox}

\definecolor{titlebg}{RGB}{194,103,14}
\definecolor{subtitlebg}{RGB}{225,125,0}

\newtcolorbox{verbs}[2][]{
  enhanced,
  arc=0pt,
  outer arc=0pt,
  left=0pt,
  right=0pt,
  top=1pt,
  bottom=0pt,
  boxsep=0pt,
  toptitle=3pt,
  lefttitle=4mm,
  bottomtitle=3pt,
  colbacktitle=titlebg,
  colframe=titlebg,
  colback=white,
  fonttitle=\itshape\bfseries,
  title=\strut #2,
  #1
}

\newcommand\MyVerb[5]{%
\begin{verbs}{#1}
\begin{tcbitemize}[
  boxsep=0pt,
  enhanced,
  sharp corners,
  colback=white,
  colframe=subtitlebg,
  halign=left,
  valign=top,
  arc=5mm,
  raster width=\textwidth,
  raster column skip=0pt,
  raster row skip=0pt,
  raster halign=center,
  raster valign=top,
  raster equal height=rows,
  toptitle=2pt,
  bottomtitle=1pt,
  ]
\tcbitem[rightrule=0.4pt,leftrule=0pt,toprule=0pt,bottomrule=0pt,title=\strut\bfseries\sffamily affirmative]
  #2
\tcbitem[leftrule=0.4pt,rightrule=0pt,toprule=0pt,bottomrule=0pt,title=\strut\bfseries\sffamily negative]
  #3
\tcbitem[rightrule=0.4pt,leftrule=0pt,toprule=0pt,bottomrule=0pt,title=\strut\bfseries\sffamily interrogative]
  #4
\tcbitem[leftrule=0.4pt,rightrule=0pt,toprule=0pt,bottomrule=0pt,title=\strut\bfseries\sffamily short answers]
  #5
\end{tcbitemize}
\end{verbs}%
}

\begin{document}

\MyVerb{be}
  {Some test text goes here to see the alignment when line breaks are present.}
  {Some test text}
  {Some test text}
  {\begin{enumerate}
    \item A test list.
    \item Second.
    \item Third.
    \end{enumerate}
  }

\end{document}

主命令有\MyVerb五个强制参数:

\MyVerb{<general title>}{<text for box1>}{<text for box3>}{<text for box3>}{<text for box4>}

答案2

没有tcolorbox,因为这是一个简单的彩色表格:

平均能量损失

\documentclass[11pt]{article}
\usepackage{xcolor,colortbl}
\begin{document}

\renewcommand{\arraystretch}{1.5}
\arrayrulecolor{red!25!yellow}
\sffamily
\begin{tabular}{|m{5cm}|m{5cm}|}
\hline
\rowcolor{red!60!yellow}\multicolumn{2}{|l|}{\color{white}be}\\\hline
\rowcolor{red!40!yellow}\color{white}affirmative &\color{white}affirmative\\\hline
\rowcolor{white}
Bla \rule{1cm}{1pt} \ldots\par
Bla bla \rule{1cm}{1pt} \ldots\par
Bla bla bla \rule{1cm}{1pt} \ldots
& 
Bla \rule{1cm}{1pt} \ldots\par
Bla bla \rule{1cm}{1pt} \ldots\par
Bla bla bla \rule{1cm}{1pt} \ldots
\\\hline
\rowcolor{red!40!yellow}    \color{white}interrogative & \color{white}short answers\\\hline
Bla \rule{1cm}{1pt} \ldots\par
Bla bla \rule{1cm}{1pt} \ldots\par
Bla bla bla \rule{1cm}{1pt} \ldots\par
& 
Bla \rule{1cm}{1pt} \ldots\par
Bla bla \rule{1cm}{1pt} \ldots\par
Bla bla bla \rule{1cm}{1pt} \ldots\par
\\\hline

\end{tabular}

\end{document}

相关内容