具有正常字體和節編號的 thmbox

具有正常字體和節編號的 thmbox

我如何在聲明一些命令的 thmbox 環境中使用“普通字體”作為定義,並使用“斜體”作為註釋(以及類似的環境)。我還需要編號為“節”或“小節”。

\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm]{geometry}

\usepackage{thmtools}
\declaretheorem[style=normalfont, thmbox=M, name=Definition]{definition}
\declaretheorem[style=remark, thmbox=M, name=Remark]{remark}
\begin{document}
\section{Trying}
\begin{remark}
This is a remark.
\end{remark}
\begin{definition}
This is a definition. i just need this as normal font.
\end{definition}
in addition, numbering should be in section (or subsection).
\end{document}

答案1

您必須將相應的選項傳遞給thmbox,因為當您要定義盒裝定理時此套件將接管。

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amsthm} % amsthm is important!
\usepackage{thmtools}

\declaretheorem[style=remark]{xyz}

\declaretheorem[
  style=plain,
  thmbox={style=M,bodystyle=\normalfont},
  name=Definition,
  within=section,
]{definition}

\declaretheorem[
  style=remark,
  thmbox={style=M,bodystyle=\normalfont,headstyle=\itshape Remark \upshape\theremark},
  name=Remark,
  within=section,
]{remark}

\begin{document}

\section{Trying}

\begin{remark}
This is a remark.
\end{remark}

\begin{definition}
This is a definition. I just need this as normal font.
\end{definition}

In addition, numbering should be in section (or subsection).

\end{document}

在此輸入影像描述

不得不說,這個結果簡直慘不忍睹。當然只是我的意見。

相關內容