我曾用它tcolorbox
作为突出显示某些内容的项目。总体来说效果不错。
梅威瑟:
\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{adjustbox}
\usepackage[most]{tcolorbox}
%
\begin{document}
%
\begin{itemize}
\item[\textcolor{DarkGreen}{\textbullet}]\adjustbox{valign=t}{%
\begin{tcolorbox}[width=0.934\textwidth,colback={white},title={Title},colbacktitle={DarkGreen},coltitle=white,colframe={DarkGreen}]
\parskip=5pt
Some text
\end{tcolorbox}
}
\item Some Item
\end{itemize}
\end{document}
但是,每当我必须使用另一个列表环境或居中表格/图形时,项目点就会被推入框内。我希望该项目点保持在框外。请告诉我如何解决这个问题。
\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{adjustbox}
\usepackage[most]{tcolorbox}
%
\begin{document}
%
\begin{itemize}
\item[\textcolor{DarkGreen}{\textbullet}]\adjustbox{valign=t}{%
\begin{tcolorbox}[width=0.934\textwidth,colback={white},title={Title},colbacktitle={DarkGreen},coltitle=white,colframe={DarkGreen}]
\parskip=5pt
Some text
\begin{enumerate}
\item A
\item B
\end{enumerate}
\end{tcolorbox}
}
\item Some Item
\end{itemize}
\end{document}
答案1
在插入框之前开始以下段落:
\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{adjustbox}
\usepackage[most]{tcolorbox}
%
\begin{document}
%
\begin{itemize}
\item[\textcolor{DarkGreen}{\textbullet}]
\leavevmode %<--------------
\adjustbox{valign=t}{%
\begin{tcolorbox}[width=0.934\textwidth,colback={white},title={Title},colbacktitle={DarkGreen},coltitle=white,colframe={DarkGreen}]
\parskip=5pt
Some text
\begin{enumerate}
\item A
\item B
\end{enumerate}
\end{tcolorbox}
}
\item Some Item
\end{itemize}
\end{document}