补充一些信息...
需要注意到在elegantbook.cls中的definition环境的定义为:
% Line 1079
\ELEGANT@newtheorem{definition}{defstyle}% Line 902
\tcbset{
common/.style={
fontupper=\citshape,
lower separated=false,
% before upper={\setlength{\parindent}{\normalparindent}},
coltitle=white,
colback=gray!5,
boxrule=0.5pt,
fonttitle=\bfseries,
enhanced,
breakable,
top=8pt,
before skip=8pt,
attach boxed title to top left={
yshift=-0.11in,
xshift=0.15in},
boxed title style={
boxrule=0pt,
colframe=white,
arc=0pt,
outer arc=0pt},
separator sign={.},},
defstyle/.style={
common,
colframe=main,
colback=main!5,
colbacktitle=main,
overlay unbroken and last={
\node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) {
\textcolor{main}{$\clubsuit$}};}},
...其中fontupper=\citshape使用的定义为:
\ifcsname kaishu\endcsname
\newcommand{\citshape}{\kaishu}
\else
\newcommand{\citshape}{\itshape}
\fi所以要想在定义环境里加粗,需要保证「楷体」有粗体的字重,或者使用伪粗体...
fontset=windows,将默认使用「中易楷体」(a.k.a. simkai.ttf),没有粗体字重fontset=fandol,默认使用「fandol-kai」同样没有粗体字重fontset=ubuntu使用的是思源字库(win下需要自行安装),其对应使用的楷体为「gkai00mp.ttf」(似乎是文鼎楷体),同样没有粗体的字重fontset=founder),其楷体字形是有粗体的,因此表现正常P.S.一个 不推荐 的方式是使用「伪粗体」,如下在windows的例子:
\documentclass[lang=cn]{elegantbook}
\setCJKfamilyfont{zhkai}[AutoFakeBold]{simkai.ttf}
\renewcommand*{\kaishu}{\CJKfamily{zhkai}}
\begin{document}
\begin{definition}
你好,我想要在这里\textbf{加粗}哈哈哈
我在windows下用的是「中易楷体」,没有粗体
\end{definition}
\end{document}
其实也可以改一下让定义环境里不使用楷体,而是使用常见的宋体.作为示例:
\documentclass[lang=cn]{elegantbook}
\tcbset{common/.append style={fontupper=\normalfont}}
\begin{document}
\begin{definition}
你好,我想要在这里\textbf{加粗}哈哈哈
我现在在windows下用的是「中易宋体」,没有粗体,所以改用「中易黑体」做为粗体
\end{definition}
\end{document}
或者使用fandol-song
\documentclass[lang=cn,fontset=fandol]{elegantbook}
\tcbset{common/.append style={fontupper=\normalfont}}
\begin{document}
\begin{definition}
你好,我想要在这里\textbf{加粗}哈哈哈
我现在在windows下用的是「fandol宋体」,他有粗体
\end{definition}
\end{document}
核心原因还是因为elegant-latex对common这个style使用了楷体,但是有粗字重的楷体太少了...
谢谢!