我想制作一个两部分之间没有空格的 tcolorbox,但我无法使用middle
键来管理。我希望 A 和 B 粘在红线上。中间似乎没有任何效果。
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usepackage[table,x11names]{xcolor}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\begin{document}
\begin{tcolorbox}[enhanced, title=test 1,
colframe=black!50, sidebyside=true,
boxsep=0pt, right=0mm, left=0pt, toptitle=1mm, bottomtitle=1mm,
top=0mm, bottom=0mm, left=0mm, lefttitle=4mm, middle=0mm,
segmentation style={solid, red},]
\hfill A
\tcblower
B
\end{tcolorbox}
\begin{tcolorbox}[enhanced, title=test 1,
colframe=black!50, sidebyside=true,
boxsep=0pt, right=0mm, left=0pt, toptitle=1mm, bottomtitle=1mm,
top=0mm, bottom=0mm, left=0mm, lefttitle=4mm, middle=10mm,
segmentation style={solid, red},]
\hfill A
\tcblower
B
\end{tcolorbox}
\begin{tcolorbox}[enhanced, title=test 1,
colframe=black!50, sidebyside=true,
boxsep=0pt, right=0mm, left=0pt, toptitle=1mm, bottomtitle=1mm,
top=0mm, bottom=0mm, left=0mm, lefttitle=4mm, middle=40mm,
segmentation style={solid, red},]
\hfill A
\tcblower
B
\end{tcolorbox}
\end{document}
答案1
您正在寻找sidebyside gap=0mm
:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usepackage[table,x11names]{xcolor}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\begin{document}
\begin{tcolorbox}[enhanced, title=test 1,
colframe=black!50, sidebyside=true,
boxsep=0pt, right=0mm, left=0pt, toptitle=1mm, bottomtitle=1mm,
top=0mm, bottom=0mm, left=0mm, lefttitle=4mm,sidebyside gap=0mm,
segmentation style={solid, red},]
\hfill A
\tcblower
B
\end{tcolorbox}
\end{document}