paracol
与 一起使用时tcolorbox
,tcolorboxes 之间的间隙比正常情况较大。
MWE 是
\documentclass{article}
\usepackage{paracol}
\columnratio{.67}
\usepackage[most]{tcolorbox}
\tcbset{
common/.style={
blanker,
left=3mm,
toprule=.3em,
bottomrule=.3em,
bottomtitle=.75\baselineskip,
fonttitle=\bfseries,
borderline west={1.5pt}{0mm}{teal},
coltitle=teal}
}
\usepackage{lipsum}
\begin{document}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\begin{paracol}{2}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\switchcolumn
\centering
\includegraphics[height=4em]{example-image-a.jpg}
\end{paracol}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\end{document}
答案1
您可以完全避免使用 paracol 而使用 tcolorbox 键sidebyside
。
\documentclass{article}
\usepackage[most]{tcolorbox}
\tcbset{
common/.style={
blanker,
left=3mm,
toprule=.3em,
bottomrule=.3em,
bottomtitle=.75\baselineskip,
fonttitle=\bfseries,
borderline west={1.5pt}{0mm}{teal},
coltitle=teal}
}
\usepackage{lipsum}
\begin{document}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\begin{tcolorbox}[common,sidebyside,righthand width=2.5cm]
\lipsum[2]
\tcblower
\includegraphics[height=4em]{example-image-a.jpg}
\end{tcolorbox}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\end{document}
答案2
您可以使用before skip=0pt,after skip=0pt
两列环境中的 tcolorbox 选项来消除 tcolorbox 前后的空间。并使用命令\vfill
前后\includegraphics
将图形垂直居中。
以下是代码:
\documentclass{article}
\usepackage{paracol}
\columnratio{.67}
\usepackage[most]{tcolorbox}
\tcbset{
common/.style={
blanker,
left=3mm,
toprule=.3em,
bottomrule=.3em,
bottomtitle=.75\baselineskip,
fonttitle=\bfseries,
borderline west={1.5pt}{0mm}{teal},
coltitle=teal}
}
\usepackage{lipsum}
\begin{document}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\begin{paracol}{2}
\begin{tcolorbox}[common,before skip=0pt,after skip=0pt]
\lipsum[2]
\end{tcolorbox}
\switchcolumn
\centering\vfill
\includegraphics[height=4em]{example-image-a.jpg}\vfill
\end{paracol}
\begin{tcolorbox}[common]
\lipsum[2]
\end{tcolorbox}
\end{document}