I am new to LaTeX and this community. This is my first post. I made a custom environment for Examples in my paper but when I center the example text it also adds vertical space between name of the example (Example 1) and the text below. I don't want it to do this and I am wondering if that is just a property of the command or if there is something weird going on caused by my environment or something.
Here is the code:
Code: Select all
\documentclass[12pt]{article}
\newcounter{example}\setcounter{example}{0}
\newenvironment{example}{\refstepcounter{example} \vspace{3mm} \noindent \textbf{Example \arabic{example}}\\ \indent}{\vspace{6mm}}
\begin{document}
\begin{example} \label{addexample}
\begin{center} Stuff \end{center}
\end{example}
\begin{example} \label{addexample}
Stuff
\end{example}
\end{document}
\end{document}
Thanks!
-Tony