关于数学环境着色的简单疑问

关于数学环境着色的简单疑问

如何为 Axioma 生成以下背景?

在此处输入图片描述

我想要重现的是文本背后的红色。

提前感谢任何帮助!

答案1

也可以使用theorems和中skins的库来完成tcolorbox

\documentclass{article}
\usepackage{amsmath, amsthm}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\newtcbtheorem{axiom}{Axioma}{
    enhanced,
    frame hidden,
    arc=0mm,
    boxrule=0mm,
    borderline west={.7mm}{.2mm}{purple},
    left=2mm,
    colframe=purple,
    coltitle=black,
    colback=purple!15,
    theorem style=plain,
    label separator=.,
    terminator sign=.,
    description delimiters={(}{)},
    description font=\normalfont,
    fonttitle=\normalfont\bfseries,
}{ax}
\begin{document}

\begin{axiom}{O Axioma da união}{}
Para cada conjunto \(\mathcal{A}\), existe um conjunto \(B\) tal que, para todo o \(A \in \mathcal{A}\) e todo o \(x \in A\), tem-se \(x \in B\).
\end{axiom}

\end{document}

答案2

您可以使用手册中的第 18.4 节来使用tcolorbox和包装axiom以标准方式定义的环境。\tcolorboxenvironment

\documentclass{article}
\usepackage{amsmath, amsthm}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}

\theoremstyle{definition}
\newtheorem{axiom}{Axioma}

\definecolor{axiombackground}{RGB}{254,227,234}
\definecolor{axiombar}{RGB}{252,0,65}

\tcolorboxenvironment{axiom}{
  enhanced,
  frame hidden,
  arc=0mm,
  boxrule=0mm,
  borderline west={.7mm}{.2mm}{purple},
  left=2mm,
  colframe=axiombar,
  colback=axiombackground,
}

\begin{document}

\begin{axiom}[O Axioma da união]
Para cada conjunto \(\mathcal{A}\), existe um conjunto \(B\) tal que,
para todo o \(A \in \mathcal{A}\) e todo o \(x \in A\), tem-se \(x \in B\).
\end{axiom}

\end{document}

在此处输入图片描述

我用数字测色仪测量了您图片的颜色,但结果并不完美。请根据您的需要进行调整。

答案3

ntheorem使用和包可以轻松完成mdframed

        \documentclass[11pt]{book} %
        \usepackage[T1]{fontenc}
        \usepackage[svgnames]{xcolor}%
        \usepackage{amssymb,amsmath}
        \usepackage[amsmath,framed]{ntheorem}
        \usepackage[ntheorem]{mdframed}
        \theoremheaderfont{\bfseries}
        \theorembodyfont{\upshape}
           \theoremstyle{plain}
        \newmdtheoremenv[topline=false, bottomline=false, rightline=false, leftline=true, linewidth=2pt, linecolor=Tomato, backgroundcolor=MistyRose, innertopmargin=10pt, innerbottommargin=10pt]{axiom}{Axioma}

        \begin{document}

        \setcounter{axiom}{3}
        \begin{axiom}[O axioma da união]
        Para cada conjunto $\mathcal A$, existe um conjunto $B$ tal que, para todo o $A \in\mathcal A$ e todo $x\in A$, tem-se $x\in B$.
        \end{axiom}

        \end{document}

在此处输入图片描述

相关内容