I am very close to getting the mdframed
setting that I want:
\documentclass[a4paper,10pt]{book}
\usepackage[paper=a4paper,twoside=true,lmargin=4cm,
rmargin=4cm,bindingoffset=0cm]{geometry}
\usepackage{mdframed}
\begin{document}
\noindent Surrounding text.
\begin{mdframed}
\begin{tabbing}
some great \=code\\
\>next line
\end{tabbing}
\end{mdframed}
\noindent Surrounding text.
\end{document}
Two questions:
-
How do I make the font size within the
mdframed
environment\small
? -
How can I turn this into a reusable environment, such that I won't have to begin and end both the
mdframed
andtabbing
environments every time?
Best Answer
Another approach without additional packages is to define a new environment; in the following example, the environment
myenv
does what you want and hasan optional argument to pass options tomdframed
: