这是当前版本:
\documentclass{scrartcl}
\usepackage[margin=1.2cm]{geometry}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{tikz}
\usetikzlibrary{angles,
babel,
calc,
positioning,
quotes,
shadings, shapes.geometric,
3d}
\tikzset{baseline=(current bounding box.center),
my angle/.style = {draw, font=\small,
angle eccentricity=1.75, angle radius=3mm},
base/.style = {draw, thick},
dashline/.style = {densely dashed, very thick},
every edge quotes/.style = {auto=right, inner sep=1pt, font=\small},
Trapezium/.style = {base, trapezium,
trapezium left angle=60, trapezium right angle=120,
minimum width=30mm}
}
\usepackage{tcolorbox}
\tcbset{fonttitle=\Large\bfseries, coltitle=white, colback=white,
colframe=black,nobeforeafter,
sidebyside, sidebyside gap=3mm,
lower separated=true,
sharp corners
}
\usepackage{amsmath}
\usepackage{sfmath}
\usepackage{tabularray}
\usepackage{lipsum}
\usepackage{siunitx}
\begin{document}
\noindent
\begin{tcolorbox}[title=Title]
\begin{tblr}{%width=0.49\textwidth,
hline{1,2,Z} = 1pt, vline{1,Z} = 1pt,
hline{even[3-X]} = {dashed, fg=gray, 0.5pt},
colspec = {Q[l, bg=gray!10, font=\bfseries]
Q[l, bg=gray!10, mode=math]
Q[c]},
colsep = 3pt,
cell{even[2]}{2,3} = {r=2}{},
row{1} = {bg=gray!30},
row{2-Z}= {rowsep = 4pt}
}
\SetCell[c=3]{l} Drawing 1 & & \\
Area & A=g\cdot h &
\tikz{[scale=0.2
]
\def\a{1.5}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\a);
\coordinate (D) at (\a,\a);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) -- node [midway,below] {\scriptsize a} (B);
} \\
& & \\
Circumference
& u=4\cdot a &
\tikz{[scale=0.2
]
\def\a{1.5}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\a);
\coordinate (D) at (\a,\a);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) -- node [midway,below] {\scriptsize a} (B);} \\
& & \\
\end{tblr}
\tcblower % right side of box
\begin{tblr}{%width=0.49\textwidth,
hline{1,2,Z} = 1pt, vline{1,Z} = 1pt,
hline{even[3-X]} = {dashed, fg=gray, 0.5pt},
colspec = {Q[l, bg=gray!10, font=\bfseries]
Q[l, bg=gray!10, mode=math]
Q[c]},
colsep = 3pt,
cell{even[2]}{2,3} = {r=2}{},
row{1} = {bg=gray!30},
row{2-Z}= {rowsep = 4pt}
}
\SetCell[c=3]{l} Drawing 2 & & \\
Area & A=g\cdot h &
\tikz{ [scale=0.2,very thick
]
\def\a{3}
\def\b{1}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\b);
\coordinate (D) at (\a,\b);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) -- node [midway,below] {\scriptsize a} (B);
\path (B) -- node [midway,right] {\scriptsize b} (D);
} \\
& & \\
Circumference
& u=2\cdot a+2\cdot b &
\tikz{ [scale=0.2,very thick
]
\def\a{3}
\def\b{1}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\b);
\coordinate (D) at (\a,\b);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) -- node [midway,below] {\scriptsize a} (B);
\path (B) -- node [midway,right] {\scriptsize b} (D);
} \\
& & \\
\end{tblr}
\begin{tblr}{%width=0.49\textwidth,
hline{1,2,Z} = 1pt, vline{1,Z} = 1pt,
hline{even[3-X]} = {dashed, fg=gray, 0.5pt},
colspec = {Q[l, bg=gray!10, font=\bfseries]
Q[l, bg=gray!10, mode=math]
Q[c]},
colsep = 3pt,
cell{even[2]}{2,3} = {r=2}{},
row{1} = {bg=gray!30},
row{2-Z}= {rowsep = 4pt}
}
\SetCell[c=3]{l} Drawing 3 & & \\
Area & A=g\cdot h &
\tikz{ [my angle/.style={font=\small, draw, angle eccentricity=1.75, angle radius=3mm},very thick]
\node (a) [trapezium, trapezium angle=50, minimum width=30mm, draw, very thick, label=above:\scriptsize c, label=below:\scriptsize a, label=right:\scriptsize b, label=left:\scriptsize d] {};
\draw [densely dashed] (a.north west) coordinate (a nw) -- (a nw |- a.south) node [midway,right] {$\scriptstyle h$} ;
% \draw (a nw |- a.south) ++(0,1.5mm) -| ++(-1.5mm,-1.5mm) (a ne |- a.south) +%+(0,1.5mm) -| ++(1.5mm,-1.5mm);
\coordinate (a blc) at (a.bottom left corner);
\coordinate (a brc) at (a.bottom right corner);
%\pic [my angle, "$\alpha$"] {angle=a1--a blc--a nw};
%\pic [my angle, "$\alpha$"] {angle=a ne--a brc--a1};
%\pic [my angle, "$\beta$"] {angle=a blc--a nw--a1};
%\pic [my angle, "$\beta$"] {angle=a2--a ne--a brc};
} \\
& & \\
Circumference
& u=2\cdot a+2\cdot b &
\tikz{ [my angle/.style={font=\small, draw, angle eccentricity=1.75, angle radius=3mm},very thick]
\node (a) [trapezium, trapezium angle=50, minimum width=30mm, draw, very thick, label=above:\scriptsize c, label=below:\scriptsize a, label=right:\scriptsize b, label=left:\scriptsize d] {};
%\draw [densely dashed] (a.north west) coordinate (a nw) -- (a nw |- a.south) node [midway,right] {$\scriptstyle h$} ;
% \draw (a nw |- a.south) ++(0,1.5mm) -| ++(-1.5mm,-1.5mm) (a ne |- a.south) +%+(0,1.5mm) -| ++(1.5mm,-1.5mm);
\coordinate (a blc) at (a.bottom left corner);
\coordinate (a brc) at (a.bottom right corner);
%\pic [my angle, "$\alpha$"] {angle=a1--a blc--a nw};
%\pic [my angle, "$\alpha$"] {angle=a ne--a brc--a1};
%\pic [my angle, "$\beta$"] {angle=a blc--a nw--a1};
%\pic [my angle, "$\beta$"] {angle=a2--a ne--a brc};
} \\
& & \\
\end{tblr}
\begin{tblr}{%width=0.49\textwidth,
hline{1,2,Z} = 1pt, vline{1,Z} = 1pt,
hline{even[3-X]} = {dashed, fg=gray, 0.5pt},
colspec = {Q[l, bg=gray!10, font=\bfseries]
Q[l, bg=gray!10, mode=math]
Q[c]},
colsep = 3pt,
cell{even[2]}{2,3} = {r=2}{},
row{1} = {bg=gray!30},
row{2-Z}= {rowsep = 4pt}
}
\SetCell[c=3]{l} Drawing 4 & & \\
Area & A=g\cdot h &
\tikz{ \node (a) [Trapezium] {};
\draw [dashline] (a.north west) to["$h$" '] (a.south west);
\path (a.bottom left corner) to["$g$"] (a.bottom right corner);
} \\
& & \\
Circumference
& u=2\cdot a+2\cdot b &
\tikz{ \node (a) [Trapezium] {};
\path (a.top left corner) to["$a$" ] (a.bottom left corner)
(a.bottom left corner) to["$b$"] (a.bottom right corner);;
} \\
& & \\
\end{tblr}
\end{tcolorbox}
\end{document}
附录:您知道如何固定框的宽度,以便图 1 可以与图 2-4 一样宽吗?
答案1
如果要在 的右侧放置两个表格,在 的左侧放置两个表格tcolorbox
,则需要tblr
在 之前放置两个环境\tcblower
,在 之后放置另外两个环境\tcblower
。目前,你只有一个 之前\tcblower
。
除此之外,我还有一些建议(也解决了有关表格宽度的问题):
- 创建自定义
tblr
环境以避免重复代码。Ti 也是如此钾您使用的 Z 样式。您甚至可以为此环境定义所需的列跨度。 - 为了避免表格太宽,我会将“面积”和“周长”放在另一行,并将相关单元格跨两列。您还应该删除每个表格中最后一行的空白行。——您可能应该明确设置单元格的高度和宽度(使用
ht
和wd
选项),以使四个表格的外观相等。 - 我会坚持在 Ti 中使用统一的语法钾Z 图以确保它们确实看起来相似:您
to["$a$"]
在最后一张图中使用,那么为什么不在其他图中也使用这种放置标签的方式呢? \tikz{[scale=0.2] ...
语法不正确。您需要将全局选项放在左花括号前面(例如\tikz[scale=0.2]{ ...
。但实际上,这里根本不需要使用此类选项。
完整的 MWE 包括上述建议和一些其他改进:
\documentclass{scrartcl}
\usepackage[margin=1.2cm]{geometry}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{tikz}
\usetikzlibrary{quotes, shapes.geometric}
\tikzset{
baseline = (current bounding box.center),
base/.style = {
draw,
very thick
},
dashline/.style = {
densely dashed,
very thick
},
every edge quotes/.style = {
auto = right,
font = \small
},
TrapeziumA/.style = {
base,
trapezium,
trapezium angle=50,
minimum width=30mm
},
TrapeziumB/.style = {
base,
trapezium,
trapezium left angle = 60,
trapezium right angle = 120,
minimum width = 30mm
}
}
\usepackage{tcolorbox}
\tcbset{
fonttitle = \Large\bfseries,
coltitle = white,
colback = white,
colframe = black,
nobeforeafter,
sidebyside,
sidebyside gap = 3mm,
lower separated = true,
sharp corners
}
\usepackage{sfmath}
\usepackage{tabularray}
\NewTblrEnviron{mytblr}
\SetTblrInner[mytblr]{
hline{1,2,Z} = 1pt,
vline{1,Z} = 1pt,
hline{even[3-X]} = {dashed, fg=gray, 0.5pt},
colspec = {Q[l, wd=0.5cm, bg=gray!10, font=\bfseries]
Q[l, wd=3.25cm, bg=gray!10, mode=math]
Q[c, wd=3.75cm]},
colsep = 3pt,
row{1} = {bg = gray!30},
row{odd[3-Z]} = {ht = 2cm},
cell{1}{1} = {c = 3}{l},
cell{even}{1} = {c = 2}{l}
}
\begin{document}
\noindent
\begin{tcolorbox}[title = Title]
\centering
\begin{mytblr}{}
Drawing 1 & & \\
Area & & \\
& A = a^2
& \tikz{
\def\a{1.5}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\a);
\coordinate (D) at (\a,\a);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
} \\
Circumference & & \\
& u = 4 \cdot a
& \tikz{
\def\a{1.5}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\a);
\coordinate (D) at (\a,\a);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
} \\
\end{mytblr}
\begin{mytblr}{}
Drawing 2 & & \\
Area & & \\
& A = a \cdot b
& \tikz{
\def\a{3}
\def\b{1}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\b);
\coordinate (D) at (\a,\b);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
\path (B) to["$b$"] (D);
} \\
Circumference & & \\
& u = 2 \cdot a + 2 \cdot b
& \tikz{
\def\a{3}
\def\b{1}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\b);
\coordinate (D) at (\a,\b);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
\path (B) to["$b$"] (D);
} \\
\end{mytblr}
\tcblower % right side of box
\centering
\begin{mytblr}{}
Drawing 3 & & \\
Area & & \\
& A = \frac{1}{2} \cdot (a + c) \cdot h
& \tikz{
\node (a) [TrapeziumA] {};
\path (a.bottom left corner) to["$a$"] (a.bottom right corner)
(a.bottom right corner) to["$b$"] (a.top right corner)
(a.top left corner) to["$c$" '] (a.top right corner)
(a.top left corner) to["$d$"] (a.bottom left corner);
\draw[dashline] (a.north west) to["$h$" '] (a.north west |- a.south);
} \\
Circumference & & \\
& u = a + b + c + d
& \tikz{
\node (a) [TrapeziumA] {};
\path (a.bottom left corner) to["$a$"] (a.bottom right corner)
(a.bottom right corner) to["$b$"] (a.top right corner)
(a.top left corner) to["$c$" '] (a.top right corner)
(a.top left corner) to["$d$"] (a.bottom left corner);
} \\
\end{mytblr}
\begin{mytblr}{}
Drawing 4 & & \\
Area & & \\
& A = g \cdot h
& \tikz{
\node (a) [TrapeziumB] {};
\draw[dashline] (a.north west) to["$h$" '] (a.south west);
\path (a.bottom left corner) to["$g$"] (a.bottom right corner);
} \\
Circumference & & \\
& u = 2 \cdot a + 2 \cdot b
& \tikz{
\node (a) [TrapeziumB] {};
\path (a.top left corner) to["$a$"] (a.bottom left corner)
(a.bottom left corner) to["$b$"] (a.bottom right corner);
} \\
\end{mytblr}
\end{tcolorbox}
\end{document}
答案2
与@Jasper Habicht 的回答类似,但是表格没有多行单元格,并且对 OP 上一个问题的回答中的 s 的tikzpicture
样式进行了一点点修改:\tikzpicture
\documentclass{scrartcl}
\usepackage[margin=1.2cm]{geometry}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{tikz}
\usetikzlibrary{angles,
positioning,
quotes,
shapes.geometric,
}
\tikzset{baseline=(current bounding box.center),
my angle/.style = {draw, font=\small,
angle eccentricity=1.75, angle radius=3mm},
base/.style = {draw, thick},
dashline/.style = {densely dashed, very thick},
every edge quotes/.style = {auto=right, inner sep=1pt, font=\small},
Rect/.style args = {#1/#2}{base, minimum height=#1, minimum width=#2},
Trap/.style args = {#1/#2}{base, trapezium,
trapezium left angle=#1, trapezium right angle=#2,
minimum width=30mm}
}
\usepackage{tcolorbox}
\tcbset{fonttitle=\Large\bfseries, coltitle=white, colback=white,
colframe=cyan,nobeforeafter,
sidebyside, sidebyside gap=3mm,
lower separated=false
}
\usepackage{sfmath}
\usepackage{tabularray}
\NewTblrEnviron{mytblr} % <--- added by @Jasper Habicht
\SetTblrInner[mytblr]{
hline{1,2,Z} = 1pt, vline{1,Z} = 1pt,
hline{even[3-X]} = {dashed, fg=gray, 0.5pt},
colspec = {Q[l, bg=gray!10, font=\bfseries]
X[c, bg=gray!10]
Q[c, wd=33mm]},
colsep = 3pt,
cell{1}{1} = {c=3}{l},
cell{odd[3]}{1} = {c=2}{c, fg=red, mode=math},
row{1} = {bg=gray!30, mode=text},
row{2-Z}= {belowsep=4pt},
row{odd[3-Z]} = {ht = 19mm}
}
\begin{document}
\noindent
\begin{tcolorbox}[title = Title]
\begin{mytblr}{}
Drawing & & \\
Area & & \\
A=a\cdot a = a^2 & &
\tikz{\node (a) [Rect=13mm/13mm] {};
\path (a.south west) to["$a$"] (a.south east)
(a.south east) to["$a$"] (a.north east);
} \\
Circumference & & \\
u=4\cdot a & &
\tikz{\node (a) [Rect=13mm/13mm] {};
\path (a.south west) to["$a$"] (a.south east)
(a.south east) to["$a$"] (a.north east);
} \\
\end{mytblr}
\medskip
\begin{mytblr}{}
Drawing & & \\
Area & & \\
A=a\cdot b & &
\tikz{\node (a) [Rect=13mm/26mm] {};
\path (a.south west) to["$a$"] (a.south east)
(a.south east) to["$b$"] (a.north east);
} \\
Circumference & & \\
u=2\cdot a+2\cdot b & &
\tikz{\node (a) [Rect=13mm/26mm] {};
\path (a.south west) to["$a$"] (a.south east)
(a.south east) to["$b$"] (a.north east);
} \\
\end{mytblr}
%---------------------------------------------------------------%
\tcblower % right side of box
%---------------------------------------------------------------%
\begin{mytblr}{}
Drawing & & \\
Area & & \\
A=g\cdot h & &
\tikz{\node (a) [Trap=60/120] {};
\draw [dashline] (a.north west) to["$h$" '] (a.south west);
\path (a.bottom left corner) to["$g$"] (a.bottom right corner);
} \\
Circumference & & \\
u=2\cdot a+2\cdot b & & \
\tikz{\node (a) [Trap=60/120] {};
\path (a.top left corner) to["$a$" ] (a.bottom left corner)
(a.bottom left corner) to["$b$"] (a.bottom right corner);;
} \\
\end{mytblr}
\medskip
\begin{mytblr}{}
Drawing & & \\
Area & & \\
A=\frac{1}{2}(a+c)\cdot h & &
\tikz{\node (a) [Trap=60/60] {};
\draw [dashline] (a.north west) to["$h$" '] (a.south west);
\path (a.bottom left corner) to["$a$" ] (a.bottom right corner)
(a.bottom right corner) to["$b$"] (a.top right corner)
(a.top right corner) to["$c$"] (a.top left corner)
(a.top left corner) to["$d$"] (a.bottom left corner);
} \\
Circumference & & \\
u=a+b+c+d & &
\tikz{\node (a) [Trap=60/60] {};
\path (a.bottom left corner) to["$a$" ] (a.bottom right corner)
(a.bottom right corner) to["$b$"] (a.top right corner)
(a.top right corner) to["$c$"] (a.top left corner)
(a.top left corner) to["$d$"] (a.bottom left corner);
} \\
\end{mytblr}
\end{tcolorbox}
\end{document}
答案3
这是一个尚未完成的提案。与上一个答案一样,它使用了,tcolorbox
但所有结构都是使用 组织的tcboxedraster
。每个Drawing
也是一个,boxedraster
其中包含两个框,一个用于area
,一个用于circumference
。每个框都是一个,bicolor, sidebyside
带有一个tikz lower
选项。
未完成的部分是如何强制下行高度相等。如果可能的话,我需要更多时间来解决它们。
\documentclass{article}
\usepackage[margin=1.2cm]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{tikz}
\usetikzlibrary{quotes, shapes.geometric}
\renewcommand{\familydefault}{\sfdefault}
\tikzset{
baseline = (current bounding box.center),
base/.style = {
draw,
very thick
},
dashline/.style = {
densely dashed,
very thick
},
every edge quotes/.style = {
auto = right,
font = \small
},
TrapeziumA/.style = {
base,
trapezium,
trapezium angle=50,
minimum width=30mm
},
TrapeziumB/.style = {
base,
trapezium,
trapezium left angle = 60,
trapezium right angle = 120,
minimum width = 30mm
}
}
\tcbset{
outerraster/.style={raster columns=2, raster equal height=rows},
outerrasterstyle/.style={sharp corners, fonttitle=\sffamily\bfseries, title=#1, colback=yellow!10, top=1mm, left=1mm, right=1mm, bottom=1mm},
drawingraster/.style={raster columns=1, sharp corners, raster row skip=-0.25pt,},
drawingrasterstyle/.style={sharp corners, colbacktitle=black!30, title=Drawing~\thetcbrasternum, coltitle=black, left=0pt, right=0pt, top=0pt, bottom=0pt, enhanced,},
drawingbox/.style={enhanced, bicolor, sidebyside, tikz lower, boxrule=0.5pt,
raster odd row/.style={overlay={\node[anchor=north west, outer sep=1mm, font=\bfseries] at (frame.north west) {Area};}},
raster even row/.style={overlay={\node[anchor=north west, outer sep=1mm, font=\bfseries] at (frame.north west) {Circumference};}}
}
}
\begin{document}
\begin{tcboxeditemize}[outerraster]{outerrasterstyle=Main title}
\tcbitem[blankest]
%Drawing 1
\begin{tcboxeditemize}[drawingraster, drawingbox]{drawingrasterstyle}
\tcbitem
\[A = a^2\]
\tcblower
\def\a{1.5}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\a);
\coordinate (D) at (\a,\a);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
\tcbitem \[u = 4 \cdot a\]
\tcblower
\def\a{1.5}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\a);
\coordinate (D) at (\a,\a);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
\end{tcboxeditemize}
%Drawing 2
\tcbitem[blankest]
\begin{tcboxeditemize}[drawingraster, drawingbox]{drawingrasterstyle}
\tcbitem \[A = \frac{1}{2}\cdot(a+c)\cdot h\]
\tcblower
\node (a) [TrapeziumA] {};
\path (a.bottom left corner) to["$a$"] (a.bottom right corner)
(a.bottom right corner) to["$b$"] (a.top right corner)
(a.top left corner) to["$c$" '] (a.top right corner)
(a.top left corner) to["$d$"] (a.bottom left corner);
\draw[dashline] (a.north west) to["$h$" '] (a.north west |- a.south);
\tcbitem \[u = a+b+c+d\]
\tcblower
\node (a) [TrapeziumA] {};
\path (a.bottom left corner) to["$a$"] (a.bottom right corner)
(a.bottom right corner) to["$b$"] (a.top right corner)
(a.top left corner) to["$c$" '] (a.top right corner)
(a.top left corner) to["$d$"] (a.bottom left corner);
\end{tcboxeditemize}
%Drawing 3
\tcbitem[blankest]
\begin{tcboxeditemize}[drawingraster, drawingbox]{drawingrasterstyle}
\tcbitem \[A = a\cdot b\]
\tcblower
\def\a{3}
\def\b{1}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\b);
\coordinate (D) at (\a,\b);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
\path (B) to["$b$"] (D);
\tcbitem \[u = 2\cdot a+2\cdot b\]
\tcblower
\def\a{3}
\def\b{1}
\coordinate (A) at (0,0);
\coordinate (B) at (\a,0) ;
\coordinate (C) at (0,\b);
\coordinate (D) at (\a,\b);
\draw[very thick] (A) -- (B) -- (D) -- (C) -- cycle;
\path (A) to["$a$"] (B);
\path (B) to["$b$"] (D);
\end{tcboxeditemize}
%Drawing 4
\tcbitem[blankest]
\begin{tcboxeditemize}[drawingraster, drawingbox]{drawingrasterstyle}
\tcbitem \[A = g\cdot h\]
\tcblower
\node (a) [TrapeziumB] {};
\draw[dashline] (a.north west) to["$h$" '] (a.south west);
\path (a.bottom left corner) to["$g$"] (a.bottom right corner);
\tcbitem \[u = 2\cdot a+2\cdot b\]
\tcblower
\node (a) [TrapeziumB] {};
\path (a.top left corner) to["$a$"] (a.bottom left corner)
(a.bottom left corner) to["$b$"] (a.bottom right corner);
\end{tcboxeditemize}
\end{tcboxeditemize}
\end{document}