LaTeX で装飾的な枠線付きテキスト スタイルを再現する

LaTeX で装飾的な枠線付きテキスト スタイルを再現する

私は次のアートワークを LaTeX で複製したいと考えています。 ここに画像の説明を入力してください

鉛筆に似た境界線が左側に沿って引かれています。鉛筆は、さまざまな情報に対応する色付きのセクションに分割されています。各テキストには、さまざまな長さの「参照」(サブタイトル)も付けられています。各サブタイトルを囲む色付きの角丸長方形のタブも、サブタイトル全体に収まるように長さが異なります。

これを tikz で実現するにはどうすればよいでしょうか?

Marco Daniel による次のコードは出発点として使用でき、特定のテキストの左側にのみ線が描画される同様の (ただし、かなり簡略化された) 効果を実現します。

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[x11names, svgnames]{xcolor}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{calc}
\usepackage{fourier-orns}
\definecolor{warningColor}{named}{Red3}
\tikzset{
  warningsymbol/.style={
      rectangle,
      draw=warningColor,
      fill=white,
      scale=1,
      overlay}
}

\mdfdefinestyle{warning}{%
 hidealllines=true,leftline=true,
 skipabove=12,skipbelow=12pt,
 innertopmargin=0.4em,%
 innerbottommargin=0.4em,%
 innerrightmargin=0.7em,%
 rightmargin=0.7em,%
 innerleftmargin=1.7em,%
 leftmargin=0.7em,%
 middlelinewidth=.2em,%
 linecolor=warningColor,%
 fontcolor=warningColor,%
 firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$) 
                           node[warningsymbol] {\danger};},%
 secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$) 
                           node[warningsymbol] {\danger};},%
 middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$) 
                           node[warningsymbol] {\danger};},%
 singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$) 
                           node[warningsymbol] {\danger};},%
}

\newmdenv[style=warning]{Warning}

\usepackage{lipsum}


\begin{document}
\begin{Warning}
    \lipsum[1]
\end{Warning}
\lipsum[1]

\begin{Warning}
    \lipsum\lipsum[1]
\end{Warning}

\lipsum[1]


\end{document}

答え1

\documentclass[tikz,border=2.71mm]{standalone}
\usetikzlibrary{decorations.pathmorphing,positioning,shapes.misc}
\begin{document}
\begin{tikzpicture}[font=\sffamily,pics/fancy box/.style={code={
 \path (0,0) coordinate (C0);
 \foreach \Item/\Text [count=\Count starting from 0] in {#1}
 {\pgfmathsetmacro{\mycolor}{{\lstColors}[\Count]}
 \node[rounded rectangle,rounded rectangle left arc=none,fill=\mycolor,anchor=north west] 
 (RR\Count) at (C\Count){\Item};
 \node[anchor=north west,below right=1ex of RR\Count.south west,draw,
 text width=5cm] (T\Count) {\Text};
 \coordinate[below left=1ex of T\Count.south west] (C\the\numexpr\Count+1\relax);
 \fill[\mycolor!50!gray] ([xshift=-1ex]C\Count) rectangle (C\the\numexpr\Count+1\relax);
 \fill[\mycolor] ([xshift=-2ex]C\Count) rectangle ([xshift=-1ex]C\the\numexpr\Count+1\relax);
 \fill[\mycolor!50!gray] ([xshift=-3ex]C\Count) rectangle ([xshift=-2ex]C\the\numexpr\Count+1\relax);
 \ifnum\Count=0
  \path[ball color=\mycolor!50] ([xshift=-3ex]C\Count) to[out=90,in=90]
  (C\Count);
 \fi
 \xdef\myCount{\Count}
 }
 \fill[brown!10,decoration={bumps,segment length=1.96ex}] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) 
  -- ++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) 
  -- (C\the\numexpr\myCount+1\relax) coordinate[pos=0.2] (aux3)
  -- ++ (0,0.1) decorate {-- ([xshift=-3ex,yshift=1mm]C\the\numexpr\myCount+1\relax)};
 \fill[gray] (aux1) -- (aux2) -- (aux3);
 }}]
 \edef\lstColors{"orange","green","purple","cyan"}
 \pic{fancy box={Reference/Text,Another Reference/Text,More/Body of the text,%
 Reference/Body of the text with a lot of details and the usual blablabla}};
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

関連情報