The following mwe
showcases the environment I am currently working with:
\documentclass{article}
\usepackage[tikz]{mdframed}
\definecolor{greentitle}{RGB}{165,224,168}
\newenvironment{notation}[1]
{\begin{mdframed}[
bottomline=true,
leftline=true,
linecolor=greentitle,
innerrightmargin=25pt,
singleextra={
\node[overlay,anchor=east,fill=greentitle,rotate=90,font=\footnotesize\scshape] at ([yshift=0.4pt]O|-P) {#1};
},
firstextra={
\node[overlay,anchor=east,fill=greentitle,rotate=90,font=\footnotesize\scshape] at ([yshift=0.4pt]O|-P) {#1};
},
]
}
{\end{mdframed}}
\begin{document}
\begin{notation}{Notation}
Sample Text
\end{notation}
\begin{notation}{Notation}
\begin{enumerate}
\item sample
\item sample
\item sample
\item sample
\item sample
\item sample
\end{enumerate}
\end{notation}
\begin{notation}{Notation}
\begin{enumerate}
\item sample
\item sample
\end{enumerate}
\end{notation}
\begin{notation}{Notation}
\begin{enumerate}
\item sample
\item sample
\end{enumerate}
\end{notation}
\end{document}
The issue I have is that I would like the environment to expand to the height of any word, in this case, notation by default. Therefore, the minimum height of the framed environment should be the height of the boxed word "notation." In the last examples you can see that the bottom line is not aligned with the boxed word.
Also I would like the boxed word to anchored outside of the framed box at the top right corner, not as is.
Note also that there is not enough space after each environment and as the first and second example show, they overlap.
tcolorbox
acceptable to you?tcolorbox
andmdframed
.