6

How would one produce the following background for the Axioma?

enter image description here

What I would like to reproduce are the red colors behind the text.

Thanks for any help in advance!

1
  • 3
    Have a look at the tcolorboxpackage.
    – user263192
    Apr 6, 2022 at 17:41

3 Answers 3

11

It can also be done using the theorems and skins libraries from 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}
6

You can use tcolorbox and wrap the axiom environment, defined in the standard way, with \tcolorboxenvironment (section 18.4) in the manual.

\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}

enter image description here

I measured the color from your image with Digital Color Meter, but the result is not really perfect. Adapt it to your need.

6

It can easily be done with the ntheorem and the mdframed packages:

        \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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .