Dashed box environment
Welcome, and good question. I don't know of a LaTeX package that can easily do what you want out of the box. The fancybox
package does a lot of fancy boxes (naturally) but not dashed lines around them.
The reason might be that TeX doesn't have native mechanisms for drawing dashed/dotted lines, only solid ones. So to create dashed lines one needs to calculate the number of dashes and draw each one.
LaTeX's built-in picture
environment can do this, but I never learned too much about it. TikZ can do it:
\documentclass{article}
\usepackage{environ}
\usepackage{tikz}
\NewEnviron{elaboration}{
\par
\begin{tikzpicture}
\node[rectangle,minimum width=0.9\textwidth] (m) {\begin{minipage}{0.85\textwidth}\BODY\end{minipage}};
\draw[dashed] (m.south west) rectangle (m.north east);
\end{tikzpicture}
}
\begin{document}
My Elaboration
\begin{elaboration}
{My item list is shown below:}
\begin{itemize}
\item dummy item
\item dummy item 2
\item dummy item 3
\end{itemize}
\end{elaboration}
\end{document}
There is probably an improvement to the TikZ code that can be made by using a decoration to draw the shape's border, thereby reducing it to one line of TikZ. But since all you want is a dashed line this will do the trick. You can play around with the settings to get the separation you want or make it customizable.
without loading large packages:
\documentclass{article}
\usepackage{arydshln,paralist}
\makeatletter
\newenvironment{elaboration}[1]
{\par\tabular{:p{\linewidth}:}\hdashline
\rule{0pt}{4ex}#1\\
\compactitem}
{\endcompactitem\\\hdashline\endtabular}
\makeatother
\begin{document}
\begin{elaboration}{My item list is shown bellow:}
\item dummy item
\item dummy item 2
\item dummy item 3
\end{elaboration}
\end{document}
Here a solution based on my adjustbox
package and dashbox
which provides \dbox
and \dashbox
. These work like \fbox
and \framebox
but with dashed lines.
\documentclass{article}
\usepackage{adjustbox}
\usepackage{dashbox}
\begin{document}
\noindent
My Elaboration
\begin{adjustbox}{minipage=0.85\textwidth,precode=\dbox}
My item list is shown below:
\begin{itemize}
\item dummy item
\item dummy item 2
\item Verbatim: \verb+\section+
\end{itemize}
\end{adjustbox}
\end{document}