Why don't I get non-italic, normal font inside theorem environment using newmdtheoremenv and mdfdefinestyle?
Your log will show
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!
If you add
\usepackage{fontspec}
Then it will use latin modern opentype fonts and the non ascii character swill work as expecteded.
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 grandeza: \textit{propriedade} quantificada por medição
\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 grandeza: \textit{propriedade} quantificada por medição
\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.