
のボックス タイトルをフォアグラウンドに移動するにはどうすればよいでしょうかtcolorbox
(ボックスの前面に移動するには)? スクリーンショット (赤い四角形、ハイライト部分) でわかるように、グリッドがタイトルと重なっていますが、この動作は望ましくありません。
\documentclass[]{article}
\usepackage[most]{tcolorbox}
\NewTColorBox{solution}{+O{}}{%
breakable,
enhanced,
sharpish corners,
colframe=blue!50,
colback=white,
coltitle=blue!50,
parbox = false,
fonttitle=\bfseries,
title={Solution},
attach boxed title to top center ={yshift=-\tcboxedtitleheight/2,yshifttext=-\tcboxedtitleheight/2},
halign title=flush center,
boxed title style={%
colback=white,
},
boxrule=0.5mm,top=0mm,bottom=0mm,
underlay={%
\draw[help lines,step=5mm,blue!20!white,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
},
lowerbox=ignored,
#1
}
\begin{document}
\begin{solution}
Some text
\end{solution}
\end{document}
答え1
underlay boxed title
の代わりに、ボックスunderlay
タイトルが追加される前にグリッドが描画され、ボックス タイトルが最前面に表示されます (マニュアルの 200 ページも参照tcolorbox
)。
\documentclass[]{article}
\usepackage[most]{tcolorbox}
\NewTColorBox{solution}{+O{}}{%
breakable,
enhanced,
sharpish corners,
colframe=blue!50,
colback=white,
coltitle=blue!50,
parbox = false,
fonttitle=\bfseries,
title={Solution},
attach boxed title to top center ={yshift=-\tcboxedtitleheight/2,yshifttext=-\tcboxedtitleheight/2},
halign title=flush center,
boxed title style={%
colback=white,
},
boxrule=0.5mm,top=0mm,bottom=0mm,
underlay boxed title={%
\draw[help lines,step=5mm,blue!20!white,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
},
lowerbox=ignored,
#1
}
\begin{document}
\begin{solution}
Some text
\end{solution}
\end{document}