Text Formattingtcolorbox title

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
asafw
Posts: 37
Joined: Sun Jun 10, 2012 12:33 pm

tcolorbox title

Post by asafw »

Hello,

I'm trying to use tcolobox with the following code that I found online.
How can I get rid of the preamble in the title, so that it reads just "Sample", not "Algorithm 1:Sample"?

Thank you very much,
Asaf

Code: Select all

\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\newtcbtheorem[]{coloredtheorem}{Algorithm}{colback=gray!15!white,arc=0pt,outer arc=0pt}{th}

\begin{coloredtheorem}{Sample}{smp}
Pigs are pink.
\end{coloredtheorem}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

tcolorbox title

Post by Johannes_B »

Theorems are numbered.

Code: Select all

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\newtcolorbox{coloredtheorem}[1]{colback=gray!15!white,arc=0pt,outer arc=0pt,title={#1}}
\begin{document}
\begin{coloredtheorem}{Sample}
Pigs are pink.
\end{coloredtheorem}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
asafw
Posts: 37
Joined: Sun Jun 10, 2012 12:33 pm

Re: tcolorbox title

Post by asafw »

Thank you Johannes!
Post Reply