答案1
我在框架西边界添加了一个tcolorbox
带有形状节点,但只绘制了一条边界线。diamond
菱形的内容作为第二个参数给出,这里是 a \bccrayon
。
边界线的间距和定位可以根据“钻石含量”的大小进行调整。
\documentclass{article}
\usepackage{blindtext}
\usepackage[tikz]{bclogo}
\usepackage[most]{tcolorbox}
\usetikzlibrary{calc,shapes}
\makeatletter
\NewTColorBox{quotebox}{+O{}+m}{%
enhanced,
sharp corners,
frame hidden,
borderline west={\kvtcb@left@rule}{-2pt}{tcbcol@frame,},
colback = white,
left=15pt,
#1,
overlay={%
\node[inner sep=0pt,diamond,line width=\kvtcb@left@rule,draw,tcbcol@frame, fill=white, % some more options here eventually]
](framenode) at ($(frame.west)+(-2pt+\kvtcb@left@rule/2,0)$) {#2};
}
}
\makeatother
\begin{document}
\begin{quotebox}{\bccrayon}
\blindtext
\end{quotebox}
\begin{quotebox}[colframe=blue]{\bccrayon}
\blindtext
\end{quotebox}
\end{document}
答案2
\startuseMPgraphic{FunnyFrame}
path p ; numeric w, h, o ;
w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ;
draw (0,h) -- (0,0) ;
p := unitsquare scaled o shifted (-o/2,(h-o)/2) ;
fill p rotatedaround (center p, 45) withcolor white ;
draw p rotatedaround (center p, 45) withpen pencircle scaled 2pt ;
setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic
\defineoverlay
[FunnyFrame]
[\useMPgraphic{FunnyFrame}]
\defineframedtext
[FunnyText]
[align=flushleft,
frame=off,
background=FunnyFrame]
\setupbodyfont[antykwa]
\starttext
\startFunnyText
\input lorem
\stopFunnyText
\stoptext