How would one produce the following background for the Axioma?
What I would like to reproduce are the red colors behind the text.
Thanks for any help in advance!
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIt 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}
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}
I measured the color from your image with Digital Color Meter, but the result is not really perfect. Adapt it to your need.
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}
tcolorbox
package.