I am using the text box with title, which was replied by @Alenanno at Inspired beautiful box from Indesign.
In this title is designed as right-justified. Can somebody make it left-justified.
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amsmath,amssymb}% pour les maths
\usepackage{enumitem}
\usepackage[svgnames]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage{tikz}
\tcbset{
lemmastyle/.style={enhanced, colback=white, colframe=blue!20, arc=0pt,
fonttitle=\bfseries, description color=Maroon,
colbacktitle=white, coltitle=DarkOliveGreen,
top=\tcboxedtitleheight,
boxed title style={arc=0pt},
attach boxed title to top left={yshift=-\tcboxedtitleheight/2,
xshift=4mm}%
},
}
\newtcbtheorem{myLemma}{Long text here without counter }{lemmastyle}{thm}
\usetikzlibrary{calc, fit}
\newcommand{\mybox}[4][8cm]{
\begin{figure}[!h]
\centering
\begin{tikzpicture}
\node[line width=0.5mm, rounded corners, text width=#1, draw=#2] (one) {\vspace{25pt}\\ #4};
\node[text=white,anchor=north east,align=center, minimum height=20pt] (two) at (one.north east) {#3};
\path[fill=#2]
(one.north west|-two.west) --
($(two.west)+(-1.5cm,0)$)
to[out=0,in=180] (two.south west) --
(two.south east) [rounded corners] --
(one.north east) --
(one.north west) [sharp corners] -- cycle;
\node[text=white,anchor=north east,align=center, minimum height=25pt, text height=2ex] (three) at (one.north east) {#3 \hspace*{.5mm}};
\end{tikzpicture}
\end{figure}
}
\usepackage{pifont}
\begin{document}
\mybox[6cm]{green!70!black}{Long Fancy Title}{
\begin{enumerate}
\item Show that
${\displaystyle D_2f(x,y) = \frac{\partial {}}{\partial{y}} \left ( \int_0^xg_1 (t,0) \ dt + \int_0^y g_2(x,s) \ ds \right)}$
\item prove that
${ \displaystyle \left(\forall x\in\mathbb{R} \right)\left(\forall y \in \mathbb{R} \right) x\neq y\, \text{and} \, x+y \neq 2 \implies x^{2}-2x \neq y^2-2y }$
\end{enumerate}
}
\begin{myLemma}{}{}
\begin{enumerate}
\item Show that
${\displaystyle D_2f(x,y) = \frac{\partial {}}{\partial{y}} \left ( \int_0^xg_1 (t,0) \ dt + \int_0^y g_2(x,s) \ ds \right)}$
\item prove that
${ \displaystyle \left(\forall x\in\mathbb{R} \right)\left(\forall y \in \mathbb{R} \right) x\neq y\, \text{and} \, x+y \neq 2 \implies x^{2}-2x \neq y^2-2y }$
\end{enumerate}
\end{myLemma}
\mybox[6cm]{blue!70!black}{Very Very Long Fancy Title}{Duis id dolor et ligula eleifend imperdiet. Mauris luctus, quam vitae viverra sagittis, dolor nibh imperdiet augue, eu venenatis eros augue et nisl. Vivamus nec fermentum est.}
Nullam libero augue, luctus et est vitae, fermentum aliquet libero. Maecenas dictum placerat eros, eu fermentum sem fermentum dapibus. Quisque non tellus nec magna feugiat luctus.
\end{document}
tcolorbox
orTiKZ
but notmdframed
. This code show three different boxes, which one do you want to change?