tcbtheorem 中的斜体更正

tcbtheorem 中的斜体更正

我重新定义了\emph命令,使文本加粗和倾斜

\DeclareEmphSequence{\bfseries\boldmath\slshape, \itshape}

\emph但是,这似乎会影响所用行的水平间距。我只在tcbtheorem标题足够长的多行环境中注意到了这种影响。例如,如果定理已编号或具有可选标题。

我尝试使用斜体校正,但无法使间距保持一致。此外,我知道很多人不赞成使用粗体\emph,我可能会定义一个专门用于定义的新命令。

在此处输入图片描述

\documentclass{article}
\usepackage{lmodern}
\usepackage{amssymb}
\usepackage[many]{tcolorbox}
\usepackage[a4paper,margin=1.5cm]{geometry}

\newtcbtheorem[number within=section]{definition}
{Definition}{
    enhanced,
    detach title, fonttitle=\sffamily\bfseries,
    coltitle=gray!70!black,
    before upper={\tcbtitle\quad}
}{def}

\DeclareEmphSequence{\bfseries\boldmath\slshape, \itshape}

\begin{document}
\section{Introduction}

\begin{definition}{}{}
    Suppose \(\Omega \subseteq \mathbb{C}\) is open. Then a function \(f:\Omega\rightarrow\mathbb{C}\) is \emph{holomorphic} if it is complex differentiable at every point \(z \in \Omega\).
\end{definition}

\begin{definition*}{}{}
    Suppose \(\Omega \subseteq \mathbb{C}\) is open. Then a function \(f:\Omega\rightarrow\mathbb{C}\) is \emph{holomorphic} if it is complex differentiable at every point \(z \in \Omega\).
\end{definition*}

\begin{definition*}{test}{}
    Suppose \(\Omega \subseteq \mathbb{C}\) is open. Then a function \(f:\Omega\rightarrow\mathbb{C}\) is \emph{holomorphic} if it is complex differentiable at every point \(z \in \Omega\).
\end{definition*}

\begin{definition}{}{}
    Suppose \(\Omega \subseteq \mathbb{C}\) is open. Then a function \(f:\Omega\rightarrow\mathbb{C}\) is \emph{holomorphic}\dots
\end{definition}

\end{document}

答案1

如果您尝试不使用它,\emph您会看到differentiable只是挤压到行上,压缩间距,但是\emph粗体使得行更长并且不适合,并且 tex 选择拉伸空间而不是在段落的倒数第二行放置连字符。

最简单的方法是强制连字符,同时使用\linebreak(不是\\)来强制对齐行。

在此处输入图片描述

\documentclass{article}
\usepackage{lmodern}
\usepackage{amssymb}
\usepackage[many]{tcolorbox}
\usepackage[a4paper,margin=1.5cm]{geometry}

\newtcbtheorem[number within=section]{definition}
{Definition}{
    enhanced,
    detach title, fonttitle=\sffamily\bfseries,
    coltitle=gray!70!black,
    before upper={\tcbtitle\quad}
}{def}

\DeclareEmphSequence{\bfseries\boldmath\slshape, \itshape}

\showhyphens{differentiable}
\begin{document}
\section{Introduction}


\begin{definition}{}{}
    Suppose \(\Omega \subseteq \mathbb{C}\) is open. Then a function \(f:\Omega\rightarrow\mathbb{C}\) is {holomorphic} if it is complex differentiable at every point \(z \in \Omega\).
\end{definition}

\begin{definition}{}{}
    Suppose \(\Omega \subseteq \mathbb{C}\) is open. Then a function \(f:\Omega\rightarrow\mathbb{C}\) is \emph{holomorphic} if it is complex differentiable at every point \(z \in \Omega\).
\end{definition}


\begin{definition}{}{}
    Suppose \(\Omega \subseteq \mathbb{C}\) is open. Then a function \(f:\Omega\rightarrow\mathbb{C}\) is \emph{holomorphic} if it is complex differ-\linebreak entiable at every point \(z \in \Omega\).
\end{definition}




\end{document}

相关内容