# Why don't I get non-italic, normal font inside theorem environment using newmdtheoremenv and mdfdefinestyle?

The theorem text is written in italic even if I set font=\normalfont\normalsize. Maybe related to that, Portuguese "-ção" is not properly recognized in that text.

\documentclass[a4paper,10pt]{book}

\usepackage[brazilian]{babel}
\usepackage{mdframed}
\usepackage{amsmath}
\usepackage{xcolor}

\mdfdefinestyle{definitionSty}{font=\normalfont\normalsize, backgroundcolor=blue!10, linewidth=0pt, innerleftmargin=3ex, innerrightmargin=3ex, innertopmargin=3ex, innermargin =+1cm, outermargin =+1cm}

\newcounter{definitionCounter}[chapter]
\numberwithin{definitionCounter}{chapter}

\newmdtheoremenv[style=definitionSty]{definition}[definitionCounter]{Defini\c{c}\~{a}o}

\begin{document}

\begin{definition}{Medição, grandeza e medida}

\begin{itemize}
\item medição: \textit{processo} pelo qual se mede algo
\item medida: \textit{resultado} do processo de medição
\end{itemize}

\end{definition}

\end{document}

• It didn't work. Besides, I'm compiling with LuaLatex and remember someone told that that command is superfluous when using that compiler. Note that the word "definição" is properly shown: that problem is only for the box text, from which I conclude that the environment redefines things. I have to type "\c{c}\~a" to have "çã". – Leonardo Castro Dec 18 '15 at 13:44
• @campa Yes, you're right! I had forgotten I had defined it that way. By the way, how do I highlight code in comments (just like you just did)? – Leonardo Castro Dec 18 '15 at 13:57

The documentation on this is opaque, but includes an example use that starts

\theoremstyle{<some style>}
\newmdtheoremenv[linecolor=blue]{lemma}{Lemma}[section]

The crucial thing here is the \theoremstyle command, which is not mdframed based, but refers to the amsthm styling commands. So you need to load amsthm, and that has to be done before loading mdframed.

\documentclass[a4paper,10pt]{book}

\usepackage[brazilian]{babel}
\usepackage{amsthm}
\usepackage{mdframed}
\usepackage{amsmath}
\usepackage{xcolor}

\mdfdefinestyle{definitionSty}{backgroundcolor=blue!10, linewidth=0pt, innerleftmargin=3ex, innerrightmargin=3ex, innertopmargin=3ex, innermargin =+1cm, outermargin =+1cm}

\newcounter{definitionCounter}[chapter]
\numberwithin{definitionCounter}{chapter}

\theoremstyle{definition}
\newmdtheoremenv[style=definitionSty]{definition}[definitionCounter]{Defini\c{c}\~{a}o}

\begin{document}

\begin{definition}Medição, grandeza e medida
\begin{itemize}
\item medição: \textit{processo} pelo qual se mede algo
\item medida: \textit{resultado} do processo de medição
\end{itemize}
\end{definition}

\begin{definition}[Medição, grandeza e medida]\leavevmode
\begin{itemize}
\item medição: \textit{processo} pelo qual se mede algo
\item medida: \textit{resultado} do processo de medição
\end{itemize}
\end{definition}

\end{document}

Note that I am not quite sure how I should be interpreting your argument in the definition environment. Either print it straight as in the first version or put it in square brackets, then there is then an extra \leavevmode tweak needed because of the itemize.

Instead of loading amsthm you can load ntheorem, either with the amsthm option and still use \theoremstyle, or using its own styling commands. You can also use the thmtools interfaces to either of these packages.

• I've chosen \begin{definition} \textsc{Medição, grandeza e medida} ... \end{definition}. – Leonardo Castro Jan 8 '16 at 11:15

Missing character: There is no ç (U+00E7) in font cmti10!
Missing character: There is no ã (U+00E3) in font cmti10!
Missing character: There is no ç (U+00E7) in font cmti10!
Missing character: There is no ã (U+00E3) in font cmti10!
Missing character: There is no ç (U+00E7) in font cmti10!