Consider the following MWE
\documentclass{article}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\usepackage{blindtext}
% https://tex.stackexchange.com/questions/350316/create-manual-page-break-within-tcolorbox
\newtcolorbox{ExampleBox}{%
breakable,
enhanced,
colback=black!10!white,
colframe=black!25!white,
coltitle=black,
title=\textbf{Example}
}
\newtcolorbox{NoteBox}{%
breakable,
enhanced,
colback=red!10!white,
colframe=red!25!white,
coltitle=black,
title=\textbf{Note}
}
\begin{document}
\begin{ExampleBox}
\begin{itemize}
\item Ich gehe nach Hause. \textit{I'm going home.}\\
\blindtext[1]
\item Ich gehe nach Hause. \textit{I'm going home.}
\end{itemize}
\end{ExampleBox}
\begin{NoteBox}
\begin{itemize}
\item Ich gehe nach Hause. \textit{I'm going home.}\\
\blindtext[1]
\end{itemize}
\end{NoteBox}
\end{document}
This creates two new tcolorboxes
named ExampleBox
and NoteBox
. Now in my original document I have several more of these boxes and their content is always of the same form: an itemize
environment, where each \item
is followed by some text, then some cursive text and then an optional \\ + some more text
.
This approach gives me the desired result but involves a lot of (hopefully) unnecessary writing. So I was wondering if it is possible to create an environment of the form
\begin{environment}[ex]
\item{first sentence}{cursive sentence}{optional text}
\item{first sentence}{cursive sentence}
\end{environment}
which should produce the same result as the above ExampleBox
. The idea would be to define somewhere (in some form) triplets of the form (tag, Title, color) --- which would be in the above case (ex, Example, black) --- to make the generation and using of such very specific tcolorboxes
a bit easier.
Not sure if relevant, but I use LuaLaTeX and the first sentence
in the modified \item
environment would contain special characters (like Kanji or Cyrillic letters).