Counter for tcolorbox Announcing the arrival of Valued Associate #679: Cesar Manara ...

How to make an animal which can only breed for a certain number of generations?

Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?

Diophantine equation 3^a+1=3^b+5^c

Determine whether an integer is a palindrome

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

malloc in main() or malloc in another function: allocating memory for a struct and its members

Should man-made satellites feature an intelligent inverted "cow catcher"?

Plotting a Maclaurin series

When does a function NOT have an antiderivative?

First paper to introduce the "principal-agent problem"

What are some likely causes to domain member PC losing contact to domain controller?

How to name indistinguishable henchmen in a screenplay?

Random body shuffle every night—can we still function?

What is the proper term for etching or digging of wall to hide conduit of cables

Twin's vs. Twins'

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

New Order #6: Easter Egg

Vertical ranges of Column Plots in 12

How do Java 8 default methods hеlp with lambdas?

Did pre-Columbian Americans know the spherical shape of the Earth?

Any stored/leased 737s that could substitute for grounded MAXs?

Besides transaction validation, are there any other uses of the Script language in Bitcoin

Calculation of line of sight system gain

3D Masyu - A Die



Counter for tcolorbox



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)tcolorbox theorem numberingEnumerated tcolorbox titleIncreasing counter ten by ten in Tcolorbox… and refer good?Different format for fonttitle and counter in tcolorboxCounter outside tcolorbox?Title with counter for ListingsStop counter increment in tcolorbox when using overlays in BeamerContinuous Counter for FiguresHow do I change counter to `Alph` format of a counter in tcolorboxThe counter tcbbreakpart blocks at 2 when adding tcolorbox tabsCustomize counter using tcolorbox?Same counter for different tcolorbox theorems












8















I would like to create a boxes for




  • theorem

  • definition

  • proposition


to looks like the following image ( but with counter for each box ) :



enter image description here



I tired with tcolorbox



Here's my code:



%this is created by Mohcine 
documentclass[10pt,a4paper]{report}
usepackage[margin=1in]{geometry}
usepackage{amsthm,amssymb,amsfonts}
usepackage{tikz,lipsum,lmodern}
usepackage[most]{tcolorbox}


newtcolorbox{Box1}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white, fonttitle=bfseries,
colbacktitle=white!50!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
title=#2,#1}


newtcolorbox{Box2}[2][]{
lower separated=false,
colback=white,
colframe=black,fonttitle=bfseries,
colbacktitle=black,
coltitle=white,
enhanced,
attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
boxed title style={boxrule=0pt,colframe=white,},
title=#2,#1}

newtcolorbox{Box3}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

newtcolorbox{Box4}[2][]{arc=0mm,
lower separated=false,
colback=white!30!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

begin{document}

begin{Box1}{Définition}
Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
[ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
end{Box1}

begin{Box2}{Proposition: Loi image}
Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
est donnée par
[forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
end{Box2}

begin{Box4}{}
begin{center}
{Hugetextbf{Les méthodes à maitriser}}
end{center}
end{Box4}

begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
$mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
end{Box3}

end{document}


Which produces :



enter image description here










share|improve this question

























  • why not using tcbnewtheorem etc?

    – user31729
    Feb 24 '17 at 10:49











  • i don't know but could make the same style ?

    – Educ
    Feb 24 '17 at 10:50











  • I have removed the mdframed tag since that package is not used here

    – user31729
    Feb 24 '17 at 11:11











  • of course no problem, Good texifying.

    – Educ
    Feb 24 '17 at 11:13


















8















I would like to create a boxes for




  • theorem

  • definition

  • proposition


to looks like the following image ( but with counter for each box ) :



enter image description here



I tired with tcolorbox



Here's my code:



%this is created by Mohcine 
documentclass[10pt,a4paper]{report}
usepackage[margin=1in]{geometry}
usepackage{amsthm,amssymb,amsfonts}
usepackage{tikz,lipsum,lmodern}
usepackage[most]{tcolorbox}


newtcolorbox{Box1}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white, fonttitle=bfseries,
colbacktitle=white!50!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
title=#2,#1}


newtcolorbox{Box2}[2][]{
lower separated=false,
colback=white,
colframe=black,fonttitle=bfseries,
colbacktitle=black,
coltitle=white,
enhanced,
attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
boxed title style={boxrule=0pt,colframe=white,},
title=#2,#1}

newtcolorbox{Box3}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

newtcolorbox{Box4}[2][]{arc=0mm,
lower separated=false,
colback=white!30!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

begin{document}

begin{Box1}{Définition}
Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
[ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
end{Box1}

begin{Box2}{Proposition: Loi image}
Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
est donnée par
[forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
end{Box2}

begin{Box4}{}
begin{center}
{Hugetextbf{Les méthodes à maitriser}}
end{center}
end{Box4}

begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
$mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
end{Box3}

end{document}


Which produces :



enter image description here










share|improve this question

























  • why not using tcbnewtheorem etc?

    – user31729
    Feb 24 '17 at 10:49











  • i don't know but could make the same style ?

    – Educ
    Feb 24 '17 at 10:50











  • I have removed the mdframed tag since that package is not used here

    – user31729
    Feb 24 '17 at 11:11











  • of course no problem, Good texifying.

    – Educ
    Feb 24 '17 at 11:13
















8












8








8


4






I would like to create a boxes for




  • theorem

  • definition

  • proposition


to looks like the following image ( but with counter for each box ) :



enter image description here



I tired with tcolorbox



Here's my code:



%this is created by Mohcine 
documentclass[10pt,a4paper]{report}
usepackage[margin=1in]{geometry}
usepackage{amsthm,amssymb,amsfonts}
usepackage{tikz,lipsum,lmodern}
usepackage[most]{tcolorbox}


newtcolorbox{Box1}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white, fonttitle=bfseries,
colbacktitle=white!50!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
title=#2,#1}


newtcolorbox{Box2}[2][]{
lower separated=false,
colback=white,
colframe=black,fonttitle=bfseries,
colbacktitle=black,
coltitle=white,
enhanced,
attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
boxed title style={boxrule=0pt,colframe=white,},
title=#2,#1}

newtcolorbox{Box3}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

newtcolorbox{Box4}[2][]{arc=0mm,
lower separated=false,
colback=white!30!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

begin{document}

begin{Box1}{Définition}
Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
[ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
end{Box1}

begin{Box2}{Proposition: Loi image}
Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
est donnée par
[forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
end{Box2}

begin{Box4}{}
begin{center}
{Hugetextbf{Les méthodes à maitriser}}
end{center}
end{Box4}

begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
$mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
end{Box3}

end{document}


Which produces :



enter image description here










share|improve this question
















I would like to create a boxes for




  • theorem

  • definition

  • proposition


to looks like the following image ( but with counter for each box ) :



enter image description here



I tired with tcolorbox



Here's my code:



%this is created by Mohcine 
documentclass[10pt,a4paper]{report}
usepackage[margin=1in]{geometry}
usepackage{amsthm,amssymb,amsfonts}
usepackage{tikz,lipsum,lmodern}
usepackage[most]{tcolorbox}


newtcolorbox{Box1}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white, fonttitle=bfseries,
colbacktitle=white!50!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
title=#2,#1}


newtcolorbox{Box2}[2][]{
lower separated=false,
colback=white,
colframe=black,fonttitle=bfseries,
colbacktitle=black,
coltitle=white,
enhanced,
attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
boxed title style={boxrule=0pt,colframe=white,},
title=#2,#1}

newtcolorbox{Box3}[2][]{
lower separated=false,
colback=white!80!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

newtcolorbox{Box4}[2][]{arc=0mm,
lower separated=false,
colback=white!30!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

begin{document}

begin{Box1}{Définition}
Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
[ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
end{Box1}

begin{Box2}{Proposition: Loi image}
Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
est donnée par
[forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
end{Box2}

begin{Box4}{}
begin{center}
{Hugetextbf{Les méthodes à maitriser}}
end{center}
end{Box4}

begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
$mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
end{Box3}

end{document}


Which produces :



enter image description here







theorems counters tikz-styles tcolorbox






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 24 '17 at 11:10







user31729

















asked Feb 24 '17 at 10:38









EducEduc

1,87941843




1,87941843













  • why not using tcbnewtheorem etc?

    – user31729
    Feb 24 '17 at 10:49











  • i don't know but could make the same style ?

    – Educ
    Feb 24 '17 at 10:50











  • I have removed the mdframed tag since that package is not used here

    – user31729
    Feb 24 '17 at 11:11











  • of course no problem, Good texifying.

    – Educ
    Feb 24 '17 at 11:13





















  • why not using tcbnewtheorem etc?

    – user31729
    Feb 24 '17 at 10:49











  • i don't know but could make the same style ?

    – Educ
    Feb 24 '17 at 10:50











  • I have removed the mdframed tag since that package is not used here

    – user31729
    Feb 24 '17 at 11:11











  • of course no problem, Good texifying.

    – Educ
    Feb 24 '17 at 11:13



















why not using tcbnewtheorem etc?

– user31729
Feb 24 '17 at 10:49





why not using tcbnewtheorem etc?

– user31729
Feb 24 '17 at 10:49













i don't know but could make the same style ?

– Educ
Feb 24 '17 at 10:50





i don't know but could make the same style ?

– Educ
Feb 24 '17 at 10:50













I have removed the mdframed tag since that package is not used here

– user31729
Feb 24 '17 at 11:11





I have removed the mdframed tag since that package is not used here

– user31729
Feb 24 '17 at 11:11













of course no problem, Good texifying.

– Educ
Feb 24 '17 at 11:13







of course no problem, Good texifying.

– Educ
Feb 24 '17 at 11:13












3 Answers
3






active

oldest

votes


















10














I suggest the usage of newtcbtheorem -- it is configurable with options like any other tcolorbox environment, the title content is used from the 2nd argument. The 3rd. argument is meant for the label and can be left empty if not needed.



By using auto counter each theorem defines a 'personal' counter, with number within=.. there's fine control on the numbering style.



The general syntax of a newtcbtheorem definition is



newtcbtheorem[init options]{theoremenvname}{Theorem Name}{options}{prefix}


where prefix is prepended to a possible label, i.e. if the prefix is def the label for foo would be def:foo, newtcbtheorem uses a pre-defined label separator :, but this can be changed with the option label separator=...



The example for method environment shows how to specify the options.



Edit: tcolorbox theorem numbering is a related question.



%this is created by Mohcine 
documentclass[10pt,a4paper]{report}

usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[french]{babel}
usepackage[margin=1in]{geometry}
usepackage{amsthm,amssymb,amsfonts}
usepackage{tikz,lipsum,lmodern}
usepackage[most]{tcolorbox}


newtcbtheorem[auto counter]{definition}{Définition}{
lower separated=false,
colback=white!80!gray,
colframe=white, fonttitle=bfseries,
colbacktitle=white!50!gray,
coltitle=black,
enhanced,
boxed title style={colframe=black},
attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
}{def}


newtcbtheorem[auto counter]{proposition}{Proposition}{%
lower separated=false,
colback=white,
colframe=black,fonttitle=bfseries,
colbacktitle=black,
coltitle=white,
enhanced,
attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
boxed title style={boxrule=0pt,colframe=white,},
}{prop}

newtcbtheorem[auto counter,number within=chapter]{method}{Méthode}{%
lower separated=false,
colback=white!80!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
}{met}

newtcolorbox{Box4}[2][]{arc=0mm,
lower separated=false,
colback=white!30!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

begin{document}

begin{definition}{}{}
Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
[ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
end{definition}

begin{proposition}{Loi image}{}
Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
est donnée par
[forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
end{proposition}

begin{Box4}{}
begin{center}
{Hugetextbf{Les méthodes à maitriser}}
end{center}
end{Box4}

setcounter{chapter}{26}

begin{method}[colbacktitle={yellow}]{Savoir calculer la loi d'une variable aléatoire}{}
Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
$mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
end{method}

end{document}


enter image description here






share|improve this answer





















  • 1





    @Educ: You're welcome. I've added the boxed title style={colframe=black} option to definition box -- it was missing (and is not shown in the screenshot)

    – user31729
    Feb 24 '17 at 11:06











  • @ChristianHupfer I have voted your answer and it is useful to regard even my question of my little book that I will present at the university. But Définition 1 borderless was better :-).

    – Sebastiano
    Feb 24 '17 at 11:58













  • @Sebastiano: Well better or worse is opinion - based. Nobody is forced to do so. And actually, all is stated in the tcolorbox manual

    – user31729
    Feb 24 '17 at 12:00











  • @ChristianHupfer I hope you did not get angry.

    – Sebastiano
    Feb 24 '17 at 12:03



















4














Here's a solution just using counters incremented before the title. I would advice you to prefix the counter value with your title setup (e.g. "Definition") per box so you do not have to type it every time.



%this is created by Mohcine 
documentclass[10pt,a4paper]{report}
usepackage[margin=1in]{geometry}
usepackage{amsthm,amssymb,amsfonts}
usepackage{tikz,lipsum,lmodern}
usepackage[most]{tcolorbox}

newcounter{mbo}
newcounter{mbt}
newcounter{mbth}

newtcolorbox{Box1}[2][]{
before title={stepcounter{mbo}},
lower separated=false,
colback=white!80!gray,
colframe=white, fonttitle=bfseries,
colbacktitle=white!50!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
title={thembo~#2},#1}


newtcolorbox{Box2}[2][]{
before title={stepcounter{mbt}},
lower separated=false,
colback=white,
colframe=black,fonttitle=bfseries,
colbacktitle=black,
coltitle=white,
enhanced,
attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
boxed title style={boxrule=0pt,colframe=white,},
title={thembt~#2},#1}

newtcolorbox{Box3}[2][]{
before title={stepcounter{mbth}},
lower separated=false,
colback=white!80!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title={thembth~#2},#1}

newtcolorbox{Box4}[2][]{arc=0mm,
lower separated=false,
colback=white!30!gray,
colframe=white!20!black,fonttitle=bfseries,
colbacktitle=white!30!gray,
coltitle=black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
yshift=-2mm},
title=#2,#1}

begin{document}

begin{Box1}{Définition}
Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
[ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
end{Box1}

begin{Box2}{Proposition: Loi image}
Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
est donnée par
[forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
end{Box2}

begin{Box4}{}
begin{center}
{Hugetextbf{Les méthodes à maitriser}}
end{center}
end{Box4}

begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
$mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
end{Box3}

end{document}





share|improve this answer
























  • +1 thank you but i prefer solution of Christian Hupfer

    – Educ
    Feb 24 '17 at 11:05



















0














the seconde code is good, but i want a change the numération of the définition frome "1.définition" to "définition 1.1".
thanks.






share|improve this answer








New contributor




yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f355495%2fcounter-for-tcolorbox%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    10














    I suggest the usage of newtcbtheorem -- it is configurable with options like any other tcolorbox environment, the title content is used from the 2nd argument. The 3rd. argument is meant for the label and can be left empty if not needed.



    By using auto counter each theorem defines a 'personal' counter, with number within=.. there's fine control on the numbering style.



    The general syntax of a newtcbtheorem definition is



    newtcbtheorem[init options]{theoremenvname}{Theorem Name}{options}{prefix}


    where prefix is prepended to a possible label, i.e. if the prefix is def the label for foo would be def:foo, newtcbtheorem uses a pre-defined label separator :, but this can be changed with the option label separator=...



    The example for method environment shows how to specify the options.



    Edit: tcolorbox theorem numbering is a related question.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}

    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}
    usepackage[french]{babel}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}


    newtcbtheorem[auto counter]{definition}{Définition}{
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    boxed title style={colframe=black},
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    }{def}


    newtcbtheorem[auto counter]{proposition}{Proposition}{%
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    }{prop}

    newtcbtheorem[auto counter,number within=chapter]{method}{Méthode}{%
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    }{met}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{definition}{}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{definition}

    begin{proposition}{Loi image}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{proposition}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    setcounter{chapter}{26}

    begin{method}[colbacktitle={yellow}]{Savoir calculer la loi d'une variable aléatoire}{}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{method}

    end{document}


    enter image description here






    share|improve this answer





















    • 1





      @Educ: You're welcome. I've added the boxed title style={colframe=black} option to definition box -- it was missing (and is not shown in the screenshot)

      – user31729
      Feb 24 '17 at 11:06











    • @ChristianHupfer I have voted your answer and it is useful to regard even my question of my little book that I will present at the university. But Définition 1 borderless was better :-).

      – Sebastiano
      Feb 24 '17 at 11:58













    • @Sebastiano: Well better or worse is opinion - based. Nobody is forced to do so. And actually, all is stated in the tcolorbox manual

      – user31729
      Feb 24 '17 at 12:00











    • @ChristianHupfer I hope you did not get angry.

      – Sebastiano
      Feb 24 '17 at 12:03
















    10














    I suggest the usage of newtcbtheorem -- it is configurable with options like any other tcolorbox environment, the title content is used from the 2nd argument. The 3rd. argument is meant for the label and can be left empty if not needed.



    By using auto counter each theorem defines a 'personal' counter, with number within=.. there's fine control on the numbering style.



    The general syntax of a newtcbtheorem definition is



    newtcbtheorem[init options]{theoremenvname}{Theorem Name}{options}{prefix}


    where prefix is prepended to a possible label, i.e. if the prefix is def the label for foo would be def:foo, newtcbtheorem uses a pre-defined label separator :, but this can be changed with the option label separator=...



    The example for method environment shows how to specify the options.



    Edit: tcolorbox theorem numbering is a related question.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}

    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}
    usepackage[french]{babel}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}


    newtcbtheorem[auto counter]{definition}{Définition}{
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    boxed title style={colframe=black},
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    }{def}


    newtcbtheorem[auto counter]{proposition}{Proposition}{%
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    }{prop}

    newtcbtheorem[auto counter,number within=chapter]{method}{Méthode}{%
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    }{met}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{definition}{}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{definition}

    begin{proposition}{Loi image}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{proposition}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    setcounter{chapter}{26}

    begin{method}[colbacktitle={yellow}]{Savoir calculer la loi d'une variable aléatoire}{}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{method}

    end{document}


    enter image description here






    share|improve this answer





















    • 1





      @Educ: You're welcome. I've added the boxed title style={colframe=black} option to definition box -- it was missing (and is not shown in the screenshot)

      – user31729
      Feb 24 '17 at 11:06











    • @ChristianHupfer I have voted your answer and it is useful to regard even my question of my little book that I will present at the university. But Définition 1 borderless was better :-).

      – Sebastiano
      Feb 24 '17 at 11:58













    • @Sebastiano: Well better or worse is opinion - based. Nobody is forced to do so. And actually, all is stated in the tcolorbox manual

      – user31729
      Feb 24 '17 at 12:00











    • @ChristianHupfer I hope you did not get angry.

      – Sebastiano
      Feb 24 '17 at 12:03














    10












    10








    10







    I suggest the usage of newtcbtheorem -- it is configurable with options like any other tcolorbox environment, the title content is used from the 2nd argument. The 3rd. argument is meant for the label and can be left empty if not needed.



    By using auto counter each theorem defines a 'personal' counter, with number within=.. there's fine control on the numbering style.



    The general syntax of a newtcbtheorem definition is



    newtcbtheorem[init options]{theoremenvname}{Theorem Name}{options}{prefix}


    where prefix is prepended to a possible label, i.e. if the prefix is def the label for foo would be def:foo, newtcbtheorem uses a pre-defined label separator :, but this can be changed with the option label separator=...



    The example for method environment shows how to specify the options.



    Edit: tcolorbox theorem numbering is a related question.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}

    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}
    usepackage[french]{babel}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}


    newtcbtheorem[auto counter]{definition}{Définition}{
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    boxed title style={colframe=black},
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    }{def}


    newtcbtheorem[auto counter]{proposition}{Proposition}{%
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    }{prop}

    newtcbtheorem[auto counter,number within=chapter]{method}{Méthode}{%
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    }{met}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{definition}{}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{definition}

    begin{proposition}{Loi image}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{proposition}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    setcounter{chapter}{26}

    begin{method}[colbacktitle={yellow}]{Savoir calculer la loi d'une variable aléatoire}{}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{method}

    end{document}


    enter image description here






    share|improve this answer















    I suggest the usage of newtcbtheorem -- it is configurable with options like any other tcolorbox environment, the title content is used from the 2nd argument. The 3rd. argument is meant for the label and can be left empty if not needed.



    By using auto counter each theorem defines a 'personal' counter, with number within=.. there's fine control on the numbering style.



    The general syntax of a newtcbtheorem definition is



    newtcbtheorem[init options]{theoremenvname}{Theorem Name}{options}{prefix}


    where prefix is prepended to a possible label, i.e. if the prefix is def the label for foo would be def:foo, newtcbtheorem uses a pre-defined label separator :, but this can be changed with the option label separator=...



    The example for method environment shows how to specify the options.



    Edit: tcolorbox theorem numbering is a related question.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}

    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}
    usepackage[french]{babel}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}


    newtcbtheorem[auto counter]{definition}{Définition}{
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    boxed title style={colframe=black},
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    }{def}


    newtcbtheorem[auto counter]{proposition}{Proposition}{%
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    }{prop}

    newtcbtheorem[auto counter,number within=chapter]{method}{Méthode}{%
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    }{met}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{definition}{}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{definition}

    begin{proposition}{Loi image}{}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{proposition}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    setcounter{chapter}{26}

    begin{method}[colbacktitle={yellow}]{Savoir calculer la loi d'une variable aléatoire}{}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{method}

    end{document}


    enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 3 '18 at 22:07

























    answered Feb 24 '17 at 10:59







    user31729















    • 1





      @Educ: You're welcome. I've added the boxed title style={colframe=black} option to definition box -- it was missing (and is not shown in the screenshot)

      – user31729
      Feb 24 '17 at 11:06











    • @ChristianHupfer I have voted your answer and it is useful to regard even my question of my little book that I will present at the university. But Définition 1 borderless was better :-).

      – Sebastiano
      Feb 24 '17 at 11:58













    • @Sebastiano: Well better or worse is opinion - based. Nobody is forced to do so. And actually, all is stated in the tcolorbox manual

      – user31729
      Feb 24 '17 at 12:00











    • @ChristianHupfer I hope you did not get angry.

      – Sebastiano
      Feb 24 '17 at 12:03














    • 1





      @Educ: You're welcome. I've added the boxed title style={colframe=black} option to definition box -- it was missing (and is not shown in the screenshot)

      – user31729
      Feb 24 '17 at 11:06











    • @ChristianHupfer I have voted your answer and it is useful to regard even my question of my little book that I will present at the university. But Définition 1 borderless was better :-).

      – Sebastiano
      Feb 24 '17 at 11:58













    • @Sebastiano: Well better or worse is opinion - based. Nobody is forced to do so. And actually, all is stated in the tcolorbox manual

      – user31729
      Feb 24 '17 at 12:00











    • @ChristianHupfer I hope you did not get angry.

      – Sebastiano
      Feb 24 '17 at 12:03








    1




    1





    @Educ: You're welcome. I've added the boxed title style={colframe=black} option to definition box -- it was missing (and is not shown in the screenshot)

    – user31729
    Feb 24 '17 at 11:06





    @Educ: You're welcome. I've added the boxed title style={colframe=black} option to definition box -- it was missing (and is not shown in the screenshot)

    – user31729
    Feb 24 '17 at 11:06













    @ChristianHupfer I have voted your answer and it is useful to regard even my question of my little book that I will present at the university. But Définition 1 borderless was better :-).

    – Sebastiano
    Feb 24 '17 at 11:58







    @ChristianHupfer I have voted your answer and it is useful to regard even my question of my little book that I will present at the university. But Définition 1 borderless was better :-).

    – Sebastiano
    Feb 24 '17 at 11:58















    @Sebastiano: Well better or worse is opinion - based. Nobody is forced to do so. And actually, all is stated in the tcolorbox manual

    – user31729
    Feb 24 '17 at 12:00





    @Sebastiano: Well better or worse is opinion - based. Nobody is forced to do so. And actually, all is stated in the tcolorbox manual

    – user31729
    Feb 24 '17 at 12:00













    @ChristianHupfer I hope you did not get angry.

    – Sebastiano
    Feb 24 '17 at 12:03





    @ChristianHupfer I hope you did not get angry.

    – Sebastiano
    Feb 24 '17 at 12:03











    4














    Here's a solution just using counters incremented before the title. I would advice you to prefix the counter value with your title setup (e.g. "Definition") per box so you do not have to type it every time.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}

    newcounter{mbo}
    newcounter{mbt}
    newcounter{mbth}

    newtcolorbox{Box1}[2][]{
    before title={stepcounter{mbo}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    title={thembo~#2},#1}


    newtcolorbox{Box2}[2][]{
    before title={stepcounter{mbt}},
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    title={thembt~#2},#1}

    newtcolorbox{Box3}[2][]{
    before title={stepcounter{mbth}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title={thembth~#2},#1}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{Box1}{Définition}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{Box1}

    begin{Box2}{Proposition: Loi image}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{Box2}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{Box3}

    end{document}





    share|improve this answer
























    • +1 thank you but i prefer solution of Christian Hupfer

      – Educ
      Feb 24 '17 at 11:05
















    4














    Here's a solution just using counters incremented before the title. I would advice you to prefix the counter value with your title setup (e.g. "Definition") per box so you do not have to type it every time.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}

    newcounter{mbo}
    newcounter{mbt}
    newcounter{mbth}

    newtcolorbox{Box1}[2][]{
    before title={stepcounter{mbo}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    title={thembo~#2},#1}


    newtcolorbox{Box2}[2][]{
    before title={stepcounter{mbt}},
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    title={thembt~#2},#1}

    newtcolorbox{Box3}[2][]{
    before title={stepcounter{mbth}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title={thembth~#2},#1}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{Box1}{Définition}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{Box1}

    begin{Box2}{Proposition: Loi image}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{Box2}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{Box3}

    end{document}





    share|improve this answer
























    • +1 thank you but i prefer solution of Christian Hupfer

      – Educ
      Feb 24 '17 at 11:05














    4












    4








    4







    Here's a solution just using counters incremented before the title. I would advice you to prefix the counter value with your title setup (e.g. "Definition") per box so you do not have to type it every time.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}

    newcounter{mbo}
    newcounter{mbt}
    newcounter{mbth}

    newtcolorbox{Box1}[2][]{
    before title={stepcounter{mbo}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    title={thembo~#2},#1}


    newtcolorbox{Box2}[2][]{
    before title={stepcounter{mbt}},
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    title={thembt~#2},#1}

    newtcolorbox{Box3}[2][]{
    before title={stepcounter{mbth}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title={thembth~#2},#1}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{Box1}{Définition}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{Box1}

    begin{Box2}{Proposition: Loi image}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{Box2}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{Box3}

    end{document}





    share|improve this answer













    Here's a solution just using counters incremented before the title. I would advice you to prefix the counter value with your title setup (e.g. "Definition") per box so you do not have to type it every time.



    %this is created by Mohcine 
    documentclass[10pt,a4paper]{report}
    usepackage[margin=1in]{geometry}
    usepackage{amsthm,amssymb,amsfonts}
    usepackage{tikz,lipsum,lmodern}
    usepackage[most]{tcolorbox}

    newcounter{mbo}
    newcounter{mbt}
    newcounter{mbth}

    newtcolorbox{Box1}[2][]{
    before title={stepcounter{mbo}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white, fonttitle=bfseries,
    colbacktitle=white!50!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,yshift=-2mm},
    title={thembo~#2},#1}


    newtcolorbox{Box2}[2][]{
    before title={stepcounter{mbt}},
    lower separated=false,
    colback=white,
    colframe=black,fonttitle=bfseries,
    colbacktitle=black,
    coltitle=white,
    enhanced,
    attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
    boxed title style={boxrule=0pt,colframe=white,},
    title={thembt~#2},#1}

    newtcolorbox{Box3}[2][]{
    before title={stepcounter{mbth}},
    lower separated=false,
    colback=white!80!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title={thembth~#2},#1}

    newtcolorbox{Box4}[2][]{arc=0mm,
    lower separated=false,
    colback=white!30!gray,
    colframe=white!20!black,fonttitle=bfseries,
    colbacktitle=white!30!gray,
    coltitle=black,
    enhanced,
    attach boxed title to top left={xshift=0.5cm,
    yshift=-2mm},
    title=#2,#1}

    begin{document}

    begin{Box1}{Définition}
    Soit $X : Omega longrightarrow E$ une variable aléatoire. On appelle loi de $X$ l'application
    [ P_{X} : Xleft( Omega right)to [0,1],quad xmapsto mathbb{P}left( X=xright)]
    end{Box1}

    begin{Box2}{Proposition: Loi image}
    Soit $X : Omega longrightarrow E$ une variable aléatoire et $f : E longrightarrow F$ . La loi de la variable aléatoire $Y=fcirc X$
    est donnée par
    [forall y in fleft(Xleft(Omega right) right),quad mathbb{P}left(Y=yright)=sum_{xin f^{-1}left({y} right)}mathbb{P}left(X=x right). ]
    end{Box2}

    begin{Box4}{}
    begin{center}
    {Hugetextbf{Les méthodes à maitriser}}
    end{center}
    end{Box4}

    begin{Box3}{Méthode 26.1 : Savoir calculer la loi d'une variable aléatoire}
    Il faut tout d'abord déterminer l'ensemble A des valeurs possibles de $X$, puis de calculer les
    $mathbb{P}left(X=xright)$, $x$ parcourant l'ensemble des valeurs prises par $X$. On représente généralement le résultat sous forme de tableau
    end{Box3}

    end{document}






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 24 '17 at 10:45









    TeXnicianTeXnician

    26.1k63491




    26.1k63491













    • +1 thank you but i prefer solution of Christian Hupfer

      – Educ
      Feb 24 '17 at 11:05



















    • +1 thank you but i prefer solution of Christian Hupfer

      – Educ
      Feb 24 '17 at 11:05

















    +1 thank you but i prefer solution of Christian Hupfer

    – Educ
    Feb 24 '17 at 11:05





    +1 thank you but i prefer solution of Christian Hupfer

    – Educ
    Feb 24 '17 at 11:05











    0














    the seconde code is good, but i want a change the numération of the définition frome "1.définition" to "définition 1.1".
    thanks.






    share|improve this answer








    New contributor




    yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      the seconde code is good, but i want a change the numération of the définition frome "1.définition" to "définition 1.1".
      thanks.






      share|improve this answer








      New contributor




      yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        the seconde code is good, but i want a change the numération of the définition frome "1.définition" to "définition 1.1".
        thanks.






        share|improve this answer








        New contributor




        yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        the seconde code is good, but i want a change the numération of the définition frome "1.définition" to "définition 1.1".
        thanks.







        share|improve this answer








        New contributor




        yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 18 mins ago









        yusf amadiazyusf amadiaz

        1




        1




        New contributor




        yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        yusf amadiaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f355495%2fcounter-for-tcolorbox%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

            Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

            How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...