我想问一个问题。如何制作这样的模板乳胶?
答案1
两个盒子可以设计多种包装:bclogo
,mdframed
,tcolorbox
;左侧带有蜡笔装饰的那个对应于bclogo
包中的预定义样式,因此我使用这个包为这个盒子定义了一个新环境;对于另一个,我决定使用tcolorbox
:
\documentclass[dvipsnames]{article}
\usepackage[tikz]{bclogo}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\newtcolorbox{framedex}{
boxrule=0.8pt,
enhanced,
colframe=Maroon,
colback=white,
arc=2pt,
top=10pt,
attach boxed title to top center={yshift=-2ex},
boxed title style={
colback=Maroon,
arc=2pt,
},
title={The title},
}
\newenvironment{framedcrayon}[2][]
{\begin{bclogo}[
logo=\bccrayon,
couleur=yellow!15,
arrondi=0.1,
couleurBord=Maroon,#1]{#2}
}
{\end{bclogo}}
\begin{document}
\begin{framedex}
\lipsum[4]
\end{framedex}
\begin{framedcrayon}{Title}
\lipsum[4]
\end{framedcrayon}
\end{document}
仅作为示例,下面是使用以下命令生成两个框架所需的代码bclogo
:
\documentclass[dvipsnames]{article}
\usepackage[tikz]{bclogo}
\usepackage{lipsum}
\newenvironment{framedcrayon}[2][]
{\begin{bclogo}[
logo=\bccrayon,
couleur=yellow!15,
arrondi=0.1,
couleurBord=Maroon,#1]{#2}
}
{\end{bclogo}}
\newenvironment{framedanswer}[2][]
{\renewcommand\bcStyleTitre[1]{
\hfill\tikz[overlay]\node[fill=Maroon,align=center,text=white,rounded corners=2pt,yshift=15pt] {\strut##1};\hfill}
\renewcommand\logowidth{0pt}
\begin{bclogo}[
logo=\bccrayon,
arrondi=0.1,
epBarre=0,
couleurBord=Maroon,#1]{#2}
}
{\end{bclogo}}
\begin{document}
\begin{framedanswer}{The title}
\lipsum[4]
\end{framedanswer}
\begin{framedcrayon}{Title}
\lipsum[4]
\end{framedcrayon}
\end{document}