0

I'm getting used to the great package tcolorbox. Makes documents much more fun to read for students.

One thing I'd like to do : while numbering theorems is fine, I'd like my definitions, remarks and so on to be unnumbered. And I would like it to be done without having to type \begin{definition*} each time.

I browsed the documentation, and several posts on this site, but couldn't find any easy way. The only thing I found is this trick :

\newtcbtheorem{defin}{Définition}{breakable,enhanced,colback=green!5,colframe=green!35!black,fonttitle=\bfseries}{defin}
\newenvironment{definition}{\begin{defin*}}{\end{defin*}}

Is there a simpler way to do this ?

Thanks for any help.

closed as unclear what you're asking by user31729, Kurt, TeXnician, Troy, Mico Apr 11 '18 at 19:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Is \begin{definition}...\end{definition} simpler than \begin{defin*}...\end{defin*}??? Also, your wrapping of the defin* environment will probably gobble the text content of the environment,unless you provide the 2 mandatory arguments of defin – user31729 Apr 1 '18 at 14:02
  • Addition: Or the one mandatory argument of defin* .... – user31729 Apr 1 '18 at 14:11
2

You could wrap it in a macro, called, say, \mynicetheoremwrapperforlaziness, this way you get rid of the \begin{...}...\end{...}.

Is that quicker than \begin{defin*}...\end{defin*}? Not really...

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[most]{tcolorbox}

\usepackage{blindtext}

\newtcbtheorem{defin}{Définition}{breakable,enhanced,colback=green!5,colframe=green!35!black,fonttitle=\bfseries}{defin}
\newenvironment{definition}{%
  \begin{defin*}
  }{%
  \end{defin*}%
}

\NewDocumentCommand{\mynicetheoremwrapperforlaziness}{+o+m}{%
  \begin{defin*}{\IfValueT{#1}{#1}}
    #2%
  \end{defin*}
}


\begin{document}

\begin{definition}{Mon dieu}
Stuff
\end{definition}

\mynicetheoremwrapperforlaziness{%

\blindtext

}

\mynicetheoremwrapperforlaziness[Foo Title]{%

\blindtext

}


\end{document}

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