引理、定理、推论和定义的彩色标题

引理、定理、推论和定义的彩色标题

可以将lemmatheoremcorollary、的标题definition显示为彩色吗?

答案1

通过该包amsthm您可以使用增强的 \newtheorem命令。

\newtheorem{⟨env name⟩}{⟨text⟩}[⟨parent counter⟩]

\newtheorem{⟨env name⟩}[⟨shared counter⟩]{⟨text⟩}

然后添加颜色,如图<text>所示。

A

请注意,此处使用的环境defn不包含共享计数器,因此它将启动为 <section number>. 1.

\documentclass[12pt,a4paper]{article}

\usepackage{amsmath,amsthm} 
\usepackage{xcolor}

%*********************************************** put the colors <<<<<
\newtheorem{thm}{\textcolor{green}{Theorem}}[section]
\newtheorem{cor}[thm]{\textcolor{violet}{Corollary}}
\newtheorem{lem}[thm]{\textcolor{orange}{Lemma}}
\newtheorem{prop}[thm]{\textcolor{blue}{Proposition}}
\newtheorem{defn}{\textcolor{red}{Definition}}[section]
%****************************************************

\DeclareMathOperator{\per}{per}
\newcommand{\A}{\mathcal{A}}
\newcommand{\eval}[2][\right]{\relax
    \ifx#1\right\relax \left.\fi#2#1\rvert}

\begin{document}
    
    \section{A color Sampler}
    
    \begin{lem}\label{lem-per}
        \begin{equation}
            \prod_{i\in\mathbf{n}}
            \biggl(\sum_{\,j\in\mathbf{n}}b_{ij}\hat x_i\biggr)
            =\biggl(\prod_{\,i\in\mathbf{n}}\hat x_i\biggr)\per \mathbf{B}
        \end{equation}
        where $\per \mathbf{B}$ is the permanent of $\mathbf{B}$.
    \end{lem}

\begin{thm}\label{thm-main}
    \begin{equation}\label{detB}
        \det\mathbf{B}=
        \sum^n_{l =0}\sum_{I_l \subseteq n}
        \prod_{i\in I_l}(b_{ii}-\lambda_i)
        \det\mathbf{B}^{(\lambda)}(I_l |I_l ),
    \end{equation}
    where $I_l =\{i_1,\dots,i_l \}$ and $\mathbf{B}^{(\lambda)}(I_l |I_l )$
    is the principal submatrix obtained from $\mathbf{B}^{(\lambda)}$
    by deleting its $i_1,\dots,i_l $ rows and columns.
\end{thm}


\begin{cor}\label{tripleA}
    Let $(\A,\A',\A'')$ be a triple of arrangements. Then
    \[ \pi (\A,t) = \pi (\A',t) + t \pi (\A'',t). \]
\end{cor}

\begin{defn}
    Let $(\A,\A',\A'')$ be a triple with respect to
    the hyperplane $H \in \A$. Call $H$ a \textit{separator}
    if $T(\A) \not\in L(\A')$.
\end{defn}

\begin{prop}\label{prop:eg}
    \begin{equation}
        H_c=\frac1{2n}\sum^n_{l =0}(-1)^{l}
        D_{l},
    \end{equation}
    where
    \begin{equation}\label{delta-l}
        D_{l}=\eval[2]{\sum_{I_{l}\subseteq \mathbf{n}}
            D(t_1,\dots,t_n)}_{t_i=\left\{\begin{smallmatrix}
                0,& \text{if }i\in I_{l}\quad\\% \quad added for centering
                1,& \text{otherwise}\end{smallmatrix}\right.\;,\;\; i=1,\dots,n}.
    \end{equation}
\end{prop}
    
    
\end{document}

数学例子取自testmath.tex – AMS-LaTeX 包的示例

相关内容