Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem is your definition of the example environment, not sagecommandline itself. In order to correct it, you can use the more standard definition that uses the amsthm package:

\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{example}{Example}

However, if you really want to keep your current definition, your can surround any part of the text (the sage output, for example) with \bgroup\normalfont and \egroup; however, this is less elegant.

My suggestion is to use amsthm. You can fine-tune every aspect for your environments, and even define new style for common ones. I hope this helps!