How to implement a counter theorem using bclogo package?

\begin{bclogo}[couleur=blue!10,logo =\bcplume,noborder =true]{Theorem}

         Content ....

\end{bclogo}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{bclogo}[couleur=blue!10,logo =\bccle,noborder =true]{proof}

         Content ...

\end{bclogo}

A full copy of my code below :

\documentclass[11pt]{article}

 %Configuration de la feuille 

\usepackage{amsmath,amssymb,enumerate,graphicx,pgf,tikz,fancyhdr}
\usepackage[utf8]{inputenc}
\usetikzlibrary{arrows}
\usepackage{geometry}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{tabvar}
\usepackage[tikz]{bclogo}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usepackage{blkarray}
\newcommand{\mLabel}[1]{\mbox{$\scriptstyle{#1}$}}
\geometry{hmargin=2.2cm,vmargin=1.5cm}\pagestyle{fancy}
\lfoot{\bfseries Réduction des endomorphismes}
\rfoot{\bfseries\thepage}
\cfoot{}
\renewcommand{\footrulewidth}{0.5pt} %Filet en bas de page



\begin{document} 
\begin{center}\textsc{{\huge Déterminant}}\end{center}
\section{Groupe symétrique}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{bclogo}[couleur=blue!10,logo =\bcplume,noborder =true]{Définition}
Une permutation de l'ensemble $\{1,\cdots ,n\}$ est une bijection de $\{1,\cdots,n\}$ dans lui-même. Le groupe symétrique, noté $\mathfrak{S}_n$ ou $S_n$, est l'ensemble des permutations de $\{1,\cdots ,n\}$
\end{bclogo}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vskip0.5cm 
\begin{bclogo}[couleur=white!10,logo =\bccle,noborder =true]{Exemple}
La notation habituelle est :
$\sigma =\begin{pmatrix} 1&2&3&4 \\\sigma(1)&\sigma(2)&\sigma(3)&\sigma(4)\end{pmatrix}\in S_4$
\end{bclogo}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{bclogo}[couleur=blue!10,logo =\bcplume,noborder =true]{Lemme 1.2}
L'ensemble $S_n$ possède $n!$ éléments
\end{bclogo}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vskip0.5cm 
\begin{bclogo}[couleur=white!10,logo =\bccle,noborder =true]{Preuve}
Pour $\sigma(1)$ on a $n$ choix possibles, pour $\sigma(2)$, puisque $\sigma(2)\ne \sigma(1)$, on a $n-1$ choix possibles, ainsi par reccurence immédiate pour $\sigma(i)$, on a $[n-(i-1)]$ choix possibles donc $\text{Card}(S_n)=n!$
\end{bclogo}
\noindent \textsc{\bf \Large }
\vskip0.5cm
\end{document}
  • If you want others to help, please make a full minimal example others can copy and test as is. That makes it a lot easier to help. Some may even never have heard of the bclogo package – daleif Aug 2 at 7:35
  • 1
    @daleif I added a full copy of my code – Stu Aug 2 at 7:43
up vote 1 down vote accepted

You should define your own environments:

\documentclass[11pt,a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\usepackage{amsmath,amssymb,enumerate,graphicx,pgf,tikz,fancyhdr}
\usetikzlibrary{arrows}
\usepackage{geometry}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{tabvar}
\usepackage[tikz]{bclogo}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usepackage{blkarray}

\newcommand{\mLabel}[1]{\mbox{$\scriptstyle{#1}$}}

\geometry{hmargin=2.2cm,vmargin=1.5cm,headheight=13.6pt}
\pagestyle{fancy}
\lfoot{\bfseries Réduction des endomorphismes}
\rfoot{\bfseries\thepage}
\cfoot{}

\renewcommand{\footrulewidth}{0.5pt} %Filet en bas de page

\newenvironment{definition}
 {%
  \begin{bclogo}[couleur=blue!10,logo=\bcplume,noborder=true]{Définition}%
 }
 {\end{bclogo}}

\newenvironment{example}
 {%
  \begin{bclogo}[couleur=white!10,logo=\bccle,noborder=true]{Exemple}%
 }
 {\end{bclogo}}

\newenvironment{proof}[1][Preuve]
 {\begin{bclogo}[couleur=white!10,logo=\bccle,noborder=true]{#1}}
 {\end{bclogo}}

\newcounter{theorem}
\counterwithin{theorem}{section}

\newenvironment{theorem}[1][Théorème]
 {%
  \refstepcounter{theorem}
  \begin{bclogo}[couleur=blue!10,logo =\bcplume,noborder =true]{#1 \thetheorem}%
 }
 {\end{bclogo}}


\begin{document} 

\section{Groupe symétrique}

\begin{definition}
Une permutation de l'ensemble $\{1,\cdots ,n\}$ est une bijection 
de $\{1,\cdots,n\}$ dans lui-même. Le groupe symétrique, noté 
$\mathfrak{S}_n$ ou $S_n$, est l'ensemble des permutations de 
$\{1,\cdots ,n\}$
\end{definition}

\begin{example}
La notation habituelle est :
$\sigma=\begin{pmatrix}
  1&2&3&4 \\
  \sigma(1)&\sigma(2)&\sigma(3)&\sigma(4)
\end{pmatrix}\in S_4$
\end{example}

\begin{theorem}[Lemme]\label{lem:factorial}
L'ensemble $S_n$ possède $n!$ éléments.
\end{theorem}

\begin{proof}
Pour $\sigma(1)$ on a $n$ choix possibles, pour $\sigma(2)$, 
puisque $\sigma(2)\ne \sigma(1)$, on a $n-1$ choix possibles, 
ainsi par reccurence immédiate pour $\sigma(i)$, on a $[n-(i-1)]$ 
choix possibles donc $\operatorname{Card}(S_n)=n!$
\end{proof}

\begin{theorem}\label{thm:factorial}
L'ensemble $S_n$ possède $n!$ éléments.
\end{theorem}

Le théorème~\ref{thm:factorial} est le même que le
lemme~\ref{lem:factorial}

\end{document}

enter image description here

The theorem environment has an optional argument for the tag (see the lemma). Also proof has an optional argument, if you want to do “Preuve du théorème” you can call it

\begin{proof}[Preuve du théorème]
  • Thank you for this answer and for this work. Just one thing, when I run the code, I've got an error message :<recently read> \counterwithin and I tried to download the package "chngcntr" but I don't now where I sould put these files? I tried also to download it through the package manager, but it doesn't find this package. l.44 \counterwithin {theorem}{section} – Stu Aug 2 at 13:22
  • @Stu You should update your TeX distribution. In the meantime, replace \newcounter{theorem} with \newcounter{theorem}[section] and \counterwithin{theorem}{section} with \renewcommand{\thetheorem}{\thesection.\arabic{theorem}}. – egreg Aug 2 at 13:25
  • Wonderfull, it works perfectly!!!!! – Stu Aug 2 at 13:46

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.