强调并在定义中添加符号

强调并在定义中添加符号

这是我的代码:

\documentclass[a4paper,12pt]{report}
\usepackage{physics}
\usepackage{amsthm}

\renewcommand{\thechapter}{\Roman{chapter}}
\newtheorem{theorem}{Theorem}

\theoremstyle{definition}
\newtheorem{definition}{\underline{Def}}[chapter]
\renewcommand{\thedefinition}{\arabic{chapter}.\arabic{definition}}
\begin{document}
    \setcounter{chapter}{2}
    \chapter{Partial Derivatives}
    Contrary to the previous chapter, now we will deal with functions of several variables along with their continuity, derivative, and intgeral behavior.
    \begin{definition}
        Fibration A fibration
    \end{definition}
\end{document}

当为章节创建新的定义时,这是以下输出。 Output

我想知道如何才能使整个术语“Def 3.1”带下划线,以及如何使 1 后面出现冒号而不是句点。

谢谢!(Latex 初学者)

更新 1:

\documentclass[a4paper,12pt]{report}
\usepackage{physics}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{thmtools}

\renewcommand{\thechapter}{\Roman{chapter}}
\newtheorem{theorem}{Theorem}

\declaretheoremstyle[spaceabove = 6pt, spacebelow = 6pt, headpunct={:} ,postfoothook=\noindent\hspace{-\fontdimen2\font}]{mydef}

\declaretheorem[parent=chapter,name = Def,style = mydef]{definition}
\renewcommand{\thedefinition}{\arabic{chapter}.\arabic{definition}}

\declaretheorem[numbered = no,style = mydef, name = Example]{example}


\begin{document}
    \setcounter{chapter}{2}
    \chapter{Partial Differentiation}
    Contrary to the previous chapter, now we will discuss the continuity and differentiation of functions of several variables.
    \begin{definition}
        Let $D$ be a subset of $\mathbb{R}^2$, i.e: $$D \subseteq \mathbb{R}^2 = \{(x,y) \mid x\in \mathbb{R}, y\in\mathbb{R} \}$$
        We say that $f:D\rightarrow\mathbb{R}$ is a real-valued function of two variables, if it assigns a real number $f(x,y)\, \mathrm{to\,each}\, (x,y) \in D.$ The \emph{range} of $f$ is the set of real numbers that $f$ maps to, $R\subseteq\mathbb{R}$
    \end{definition}
    \begin{example}
        Let $f(x,y) = \sin(x^2y) \leadsto D = {\mathbb{R}}^2\, , R\rightarrow \left[-1,-1 \right] $
    \end{example}

\end{document}

enter image description here

答案1

以下是代码thmtools

\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{physics}
\usepackage{soulutf8}
\usepackage{amsthm, thmtools}

\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\normalfont\bfseries,
notefont=\mdseries, notebraces={(}{)},
headpunct ={:},
headformat=\underline{\NAME~\NUMBER \NOTE},
bodyfont=\normalfont,
postheadspace=1em,
]{mydef}
\renewcommand{\thechapter}{\Roman{chapter}}

\newtheorem{theorem}{Theorem}

\declaretheorem[style=mydef, name=Def, parent=chapter, preheadhook = \renewcommand{\thechapter}{\arabic{chapter}}]{definition}

\begin{document}

    \setcounter{chapter}{2}
    \chapter{Partial Derivatives}

    Contrary to the previous chapter, now we will deal with functions of several variables along with their continuity, derivative, and integral behavior.
    \begin{definition}[A silly definition]
        Fibration A fibration
    \end{definition}

\end{document} 

enter image description here

答案2

\documentclass[a4paper,12pt]{report}
\usepackage{physics}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{thmtools}

\renewcommand{\thechapter}{\Roman{chapter}}
\newtheorem{theorem}{Theorem}

\declaretheoremstyle[headpunct={:}]{mydef}

\declaretheorem[parent=chapter,style = mydef]{definition}
\renewcommand{\thedefinition}{\arabic{chapter}.\arabic{definition}}

\begin{document}
    \setcounter{chapter}{2}
    \chapter{Partial Derivatives}
    \begin{definition}[A silly definition]
        Let $D$ be a subset of $\mathbb{R}^2$
    \end{definition}
\end{document}

enter image description here

相关内容