0

Let's consider the code following:

\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}

\newmdtheoremenv{theo}{Theorem}

\begin{document}

\begin{theo}[William's theorem]
For $n > 1$ we have that:
$$\textrm{n prime number} \Leftrightarrow (n - 1)! \equiv -1 (mod \; n)$$

\end{theo} 

\begin{theo}[Odd parity of additive function]
If $f$ is an additive function then $f$ is an odd function

\end{theo}

\end{document}

which result in the following boxes:

enter image description here

I want to change two things in this code:

  • Instead of Theorem 1 and Theorem 2 I would like to have Theorem 1.1 and Theorem 1.2. I've seen a similar questions to this one, but I had problems with its implementation (very often complex or not working with article class)
  • Do you know how can I read of italic within the boxes? Everything is treated as it was between dolars $$ whereas for example text "If f is an additive function" should not be in italic, it should be written in normal text.

Could you please give me a hand with solving those issues?

1 Answer 1

1

Probably best to load ntheorem alongside mdframed. Then you can use \theoremfont{} to get rid of the italics.

The article class doesn't have chapters, but if you wanted them numbered by section you could do this:

\documentclass{article}
\usepackage{ntheorem}
\usepackage{mdframed}
\usepackage{lipsum}

\theorembodyfont{}
\newmdtheoremenv{theo}{Theorem}[section]

\begin{document}

\section{My First Section}

\begin{theo}[William's theorem]
For $n > 1$ we have that:
$$\textrm{n prime number} \Leftrightarrow (n - 1)! \equiv -1 (mod \; n)$$

\end{theo} 

\section{My Second Section}

\begin{theo}[Odd parity of additive function]
If $f$ is an additive function then $f$ is an odd function

\end{theo}

\end{document}

If you really meant by chapter, then you can use the report or book class instead and change it to \newmdtheoremenv{theo}{Theorem}[chapter].

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .