tcolorbox 中间键被误解

tcolorbox 中间键被误解

我想制作一个两部分之间没有空格的 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}

在此处输入图片描述

相关内容