thmbox 标题中的数学符号不加粗?

thmbox 标题中的数学符号不加粗?

所以我一直在尝试使用 thmbox 来增加我的本科报告的趣味性,但我不喜欢默认样式,所以我正在尝试调整它。我基本上已经按照我想要的方式做了,除了标题中的任何数学仍然显示为粗体,尽管我已经使用 更改了标题样式\mdseries

这是我在序言中所做的:

\documentclass[a4paper,12pt,titlepage]{article} 
\bibliographystyle{plain}
\usepackage[margin=1.5cm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{thmbox}
\newtheorem[L]{theorem}{Theorem}[section]
\newtheorem[L]{definition}{Definition}[section]
\newtheorem[L]{corollary}{Corollary}[theorem]
\newtheorem[L]{lemma}[theorem]{Lemma}
\newtheorem[L]{proposition}[theorem]{Proposition}
\newtheorem[S]{remark}[theorem]{Remark}

\thmboxoptions{
leftmargin = 4.5pt, 
thickness = 0.3pt,
bodystyle = \itshape\noindent,
titlestyle = \hspace{0.15cm}-\hspace{0.15cm}(\mdseries{#1})
}

像这样使用它:

\begin{definition}[The Free Group on Two Generators, $F_2$]       
The free group on two generators, $F_2$ is a free group over a set with two elements (generators), $S = \{a,b\}$, containing all reduced words that can be formed by concatenating elements of $\{ a, a^{-1}, b, b^{-1}\}$. The identity is the empty word, denoted $e$.
\end{definition}

给出: 在此处输入图片描述

我不希望 $F_2$ 变得粗体!

此外,如果有人能帮助我让盒子完全包裹住内容,那就更好了!这是我的理想,但如果不是这样,我也会很高兴!(另外,我对 LaTeX 不是很有经验,所以如果可能的话,请尝试给我简单的解决方案!)

答案1

您只需使用即可headstyle。使用\textbf可避免粗体字样传播。您需要它,因为默认情况下,包中有\bfseries\boldmath

我会在正文中使用短破折号而不是连字符和直立括号。实际上,定义通常以直立字体排版,以强调定义的概念。

如果您希望左侧栏与左边距齐平,正确的间距是 4.3pt,并且右侧也需要相同的间距。为什么?因为thmbox:您总是否则将超额 4.3pt。

\documentclass{article}
\usepackage{thmbox}

\newtheorem[L]{definition}{Definition}[section]

\thmboxoptions{
  leftmargin = 4.3pt,
  rightmargin= 4.3pt,% <--- or you get an overfull of 4.3pt
  thickness = 0.3pt,
  bodystyle = \itshape\noindent,
  titlestyle = \ --\ (#1),
  headstyle = \textbf{#1 #2},
}

\newcommand{\itp}[1]{\textup{(}#1\textup{)}}

\begin{document}

\begin{definition}[The Free Group on Two Generators, $F_2$]
The free group on two generators, $F_2$ is a free group over a set with two
elements \itp{generators}, $S = \{a,b\}$, containing all reduced words that
can be formed by concatenating elements of $\{a, a^{-1}, b, b^{-1}\}$. The
identity is the empty word, denoted $e$.
\end{definition}

\end{document}

在此处输入图片描述

实际上,定义通常采用直排版,强调所定义的概念。但这是一种风格决定。

\documentclass{article}
\usepackage{thmbox}

\newtheorem[L]{definition}{Definition}[section]

\thmboxoptions{
  leftmargin = 4.3pt,
  rightmargin= 4.3pt,% <--- or you get an overfull of 4.3pt
  thickness = 0.3pt,
  bodystyle = \upshape\noindent,
  titlestyle = \ --\ (#1),
  headstyle = \textbf{#1 #2},
}

\newcommand{\itp}[1]{\textup{(}#1\textup{)}}

\begin{document}

\begin{definition}[The Free Group on Two Generators, $F_2$]
The \emph{free group on two generators}, $F_2$ is a free group over a set with two 
elements (generators), $S = \{a,b\}$, containing all reduced words that 
can be formed by concatenating elements of $\{a, a^{-1}, b, b^{-1}\}$. The 
identity is the empty word, denoted $e$.
\end{definition}

\end{document}

在此处输入图片描述

答案2

正如评论中所暗示的那样,只需删除键\boldmath中的开关即可headstyle。请注意,这\mdseries是一个开关,而不是一个带参数的命令,因此您对\mdseries{#1}in的使用titlestyle可以只是\mdseries #1。正如 egreg 在评论中提到的那样,您还应该将其放在\mdseries前面(,这样第一个括号就不会加粗。

\documentclass{article}

\usepackage{thmbox}

\newtheorem[L]{definition}{Definition}[section]

\thmboxoptions{
  leftmargin = 4.5pt, 
  thickness = 0.3pt,
  bodystyle = \itshape\noindent,
  titlestyle = \hspace{0.15cm}-\hspace{0.15cm}\mdseries(#1),
  headstyle = \bfseries#1 #2,
}

\begin{document}

\begin{definition}[The Free Group on Two Generators, $F_2$]       
The free group on two generators, $F_2$ is a free group over a set with two elements (generators), $S = \{a,b\}$, containing all reduced words that can be formed by concatenating elements of $\{ a, a^{-1}, b, b^{-1}\}$. The identity is the empty word, denoted $e$.
\end{definition}

\end{document}

定义

相关内容