我想创建一个如图所示的迷你页面。有什么想法可以做吗?谢谢!
答案1
这里有一种方法可以允许分页符tcolorbox
:
\documentclass{article}
\usepackage[skins,many]{tcolorbox}
\usepackage{lipsum}
\definecolor{myblue}{RGB}{32,92,195}
\newtcolorbox{mybox}[1]{
freelance,
breakable,
title=#1,
left=0pt,
right=0pt,
width=.9\textwidth,
enlarge left by=.1\textwidth,
coltitle=black,
frame code={},
interior titled code={
\draw[myblue,ultra thick]
([yshift=5pt]frame.south west) |- ([xshift=60pt,yshift=-4pt]title.south west);
}
}
\begin{document}
\lipsum[4]
\begin{mybox}{The title}
\lipsum[4]
\end{mybox}
\lipsum[4]
\end{document}
与mdframed
:
答案2
带有表格的解决方案:
%\PassOptionsToPackage{table}{xcolor}%% maybe needed if you have a special class
\documentclass{article}
\usepackage[table]{xcolor}%%% Delete it if your special class alread loads it
\usepackage{tabularx,booktabs}
\usepackage{blindtext}
\definecolor{myblue}{RGB}{32,92,195}
\newenvironment{mybox}[1]
{\par\medskip\noindent\arrayrulewidth=2pt\arrayrulecolor{myblue}%
\hfill\tabularx{0.8\linewidth}{!{\color{myblue}\vrule width 2pt} X @{}}
\multicolumn{1}{@{}l}{\tabular{@{}l}\kern\tabcolsep\textbf{#1}\\\hline\endtabular}\\}
{\endtabularx\par\medskip}
\begin{document}
\begin{mybox}{The title with some more text in the title}
Onyl some text here
\end{mybox}
\blindtext
\begin{mybox}{The title}
\blindtext
\end{mybox}
\blindtext
\end{document}