I want to be able to have some text aligned in the left margin such as a theorem label, and then have the example in the mdframed box. Here is an example of my failed attempt.
As you can see the text "this is a test" is slighly pushed right. Here is the code for this example
\documentclass[18pt]{article}
\usepackage{mdframed}
\newcommand{\sdef}{ %
\hspace*{-2in}\makebox[2in]{\hfill \textbf{Definition 1.1.1.1} \hspace*{.35in}}}
\newenvironment{definition}
{\begin{mdframed}[linewidth=2pt,roundcorner=8pt,align=center]
\vspace*{5px}%
\sdef}
{\vspace*{5px}
\end{mdframed}}
\begin{document}
\begin{definition}
This is a test \\
Here is more text.
\end{definition}
\end{document}
How do I properly align that first sentence? Thank you in advance.
EDIT: Another solution that I came across was to use the \ignorespaces macro so replacing the defintion of sdef with this works
\newcommand{\sdef}{ %
\hspace*{-2in}\makebox[2in]{\hfill \textbf{Definition 1.1.1.1} \hspace*{.35in}}\ignorespaces}
\documentclass
and the appropriate packages so that those trying to help don't have to recreate it.