1

I want to remove numbering in this theorem defined in mdframed

\documentclass{article}    
\usepackage{amssymb}
\usepackage[framemethod=TikZ]{mdframed}

\newcounter{theo}%[section] \setcounter{theo}{0}
\newenvironment{theo}[2][]{%
\refstepcounter{theo}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
{\strut Theorem~\thePrte};}}
}%
{\mdfsetup{%
frametitle={
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
{\strut Theorem~\thetheo:~#1};}}%
}%
\mdfsetup{innertopmargin=5pt, innerbottommargin=10pt, linecolor=yellow!60!brown!60!,%
linewidth=2.3pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax, roundcorner=5pt
}
\begin{mdframed}[]\relax%
\label{#2}}{\end{mdframed}}


\begin{document}

\begin{theo}[{\tiny Théorème des valeurs intermédiaires}]{}
Soit $f$ une fonction definie sur $\mathbb{R}$...
\end{theo}

\end{document}
  • 1
    Welcome! Remove \thetheo and \thePrte ? – cfr Oct 15 '16 at 0:10
  • Your code does not compile. – cfr Oct 15 '16 at 0:12
0

Please be sure that code you post compiles unless you are asking for help with a compilation error.

\the<counter name> produces a typeset version of the LaTeX counter <counter>'s current value. Hence, removing these removes the numbers from the output.

\documentclass{article}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{amssymb}
\newenvironment{theo}[2][]{%
  \ifstrempty{#1}%
  {%
    \mdfsetup{%
      frametitle={%
        \tikz[baseline=(current bounding box.east),outer sep=0pt]
        {\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
          {\strut Theorem};}%
      },
    }
  }%
  {%
    \mdfsetup{%
      frametitle={%
        \tikz[baseline=(current bounding box.east),outer sep=0pt]
        {\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
          {\strut Theorem:~#1};}%
      },
    }%
  }%
  \mdfsetup{%
    innertopmargin=5pt, innerbottommargin=10pt, linecolor=yellow!60!brown!60!, linewidth=2.3pt,topline=true, frametitleaboveskip=\dimexpr-\ht\strutbox\relax, roundcorner=5pt,
  }%
  \begin{mdframed}[]\relax
    \label{#2}%
  }{%
  \end{mdframed}%
}

\begin{document}
\begin{theo}[{\tiny Théorème des valeurs intermédiaires}]{}
  Soit $f$ une fonction definie sur $\mathbb{R}$...
\end{theo}
\end{document}

numberless thm

  • Thanks you for the help! I didn't used an appropriate package for accented letters, that's why it doesn't compile ! – Adel Joe Oct 15 '16 at 10:42
  • It doesn't compile because \mathbb is undefined without amssymb. – cfr Oct 15 '16 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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