Compilateur LaTeX en ligne
www.cpierquet.fr
fichiers/test/tcboxforumpost.tex
↓ télécharger
%!TEX pdflatex

\documentclass{article}
\usepackage[margin=1.5cm,]{geometry}
\usepackage{tcolorbox}
\usepackage{openmoji}
\tcbuselibrary{skins}

\usepackage{lipsum}

\newlength\tcboxforumpost
\setlength\tcboxforumpost{4mm}
\newlength\tcboxforumpostoffet
\setlength\tcboxforumpostoffet{\fpeval{sqrt(3)/2*\tcboxforumpost}pt}
\newlength\tcboxforumpostwidthavatar
\setlength\tcboxforumpostwidthavatar{\dimexpr1.5cm-\tcboxforumpostoffet\relax}

\def\tcboxpostavatar{\openmoji[height=\tcboxforumpostwidthavatar]{snake}}

\tcbset{
	forum style post/.style={
		enhanced,
		frame empty,
		boxsep=0pt,
		left skip=1.5cm,
		top=2mm,
		left=2mm,
		right=2mm,
		bottom=2mm,
		opacityfill=0,
		underlay unbroken={%
			\fill[lightgray!5] ([xshift=-\tcboxforumpostoffet]frame.north west) rectangle++ (-\tcboxforumpostwidthavatar,-\tcboxforumpostwidthavatar) ;
			\coordinate (AVATAR-SOUTH-WEST) at ([xshift={-\tcboxforumpostoffet-\tcboxforumpostwidthavatar},yshift=-\tcboxforumpostwidthavatar]frame.north west) ;
			\coordinate (PSEUDO-SOUTH-WEST) at ([xshift={-\tcboxforumpostoffet-\tcboxforumpostwidthavatar},yshift={-\tcboxforumpostwidthavatar-3mm}]frame.north west) ;
			\coordinate (PSEUDO) at ([xshift={0.5\tcboxforumpostwidthavatar},yshift=-1.5mm]AVATAR-SOUTH-WEST) ;
			\coordinate (PSEUDO-ALT) at ([xshift={0.5\tcboxforumpostwidthavatar},yshift=-1.5mm]PSEUDO-SOUTH-WEST) ;
			\begin{scope}
				\clip ([xshift=-\tcboxforumpostoffet]frame.north west) rectangle++ (-\tcboxforumpostwidthavatar,-\tcboxforumpostwidthavatar) ;
				\node at ([xshift={-0.5\tcboxforumpostwidthavatar-\tcboxforumpostoffet},yshift={-0.5\tcboxforumpostwidthavatar}]frame.north west) {\tcboxpostavatar} ;
			\end{scope}
			\draw[gray,line width=0.2mm,] ([xshift=-\tcboxforumpostoffet]frame.north west) rectangle++ (-\tcboxforumpostwidthavatar,-\tcboxforumpostwidthavatar) ;
			\filldraw[gray,line width=0.2mm] (AVATAR-SOUTH-WEST) rectangle++ (\tcboxforumpostwidthavatar,-3mm);
			\begin{scope}
				\clip (AVATAR-SOUTH-WEST) rectangle++ (\tcboxforumpostwidthavatar,-3mm);
				\draw (PSEUDO) node[inner sep=0pt,font=\sffamily\bfseries,text=white] {\resizebox*{!}{3mm}{\vphantom{(qM)}user}} ;
			\end{scope}
			\draw[gray,line width=0.2mm] (PSEUDO-SOUTH-WEST) rectangle++ (\tcboxforumpostwidthavatar,-3mm);
			\begin{scope}
				\clip (PSEUDO-SOUTH-WEST) rectangle++ (\tcboxforumpostwidthavatar,-3mm);
				\draw (PSEUDO-ALT) node[inner sep=0pt,font=\sffamily,text=darkgray] {\resizebox*{!}{1.75mm}{\vphantom{(qM)}débutant}} ;
			\end{scope}
			%bulle
			\draw[fill=lightgray!10,line width=0.2mm,line join=round,rounded corners=0.4mm] (frame.north west) -- (frame.north east) -- (frame.south east) -- (frame.south west) -- ([yshift=-6mm]frame.north west) --++ (150:\tcboxforumpost) --++ (30:\tcboxforumpost) -- cycle ;
		}
	}
}

\begin{document}

\begin{tcolorbox}[forum style post]
\lipsum[1]
\end{tcolorbox}
\end{document}