# How make framed blocks in beamer [duplicate]

I want to create a block in every frame like this

Because I don't like to use classical blocks like this Could you please give me the necessary code ? Thank you

• You could try to use empty slides and tcolorbox. But without MWE and any attempt it will be hard to help you. – TeXnician Nov 12 '17 at 15:34
• Welcome to TeX - LaTeX! Do you a sample theme you wish to use? – Andrew Swann Nov 12 '17 at 15:36
• I use the theme Madrid – Student Nov 12 '17 at 15:40
• Should "definition 1" be the frametitle? What should happen to the elements which are normally on a slide of the Madrid theme, e.g. head and footline? – samcarter is at topanswers.xyz Nov 12 '17 at 18:44
• it's not the frametitle, it is only the title of a block – Student Nov 12 '17 at 18:50

You can make a similar box with the tcolorbox package.

\documentclass{beamer}
\usepackage[most]{tcolorbox}

\newtcolorbox[auto counter]{pabox}[1]{%
colback=white,
colframe=structure.fg,
colbacktitle=white!90!structure.fg,
coltitle=black,
fonttitle=\bfseries,
title=Definition~\thetcbcounter .,
enhanced,
attach boxed title to top left={yshift=-2mm, xshift=0.5cm}
}

\begin{document}

\begin{frame}
\begin{pabox}
This is my own box with a mandatory
numbered title and options.
\end{pabox}
\end{frame}

\end{document}


• hi! how can you add the name of the definition in the upper small box ? thank you :) tex.stackexchange.com/questions/337331/… here i see that I can add a parameter in the options ' title=#2, ' but it erases the word theorem. How can I have theorem, the counter and the name of it into parenthesis? – Marine Galantin Jan 25 '18 at 6:24
• @MarineGalantin Seems like I was too slow and Christian Hupfer already answered this. – samcarter is at topanswers.xyz Jan 25 '18 at 20:34
• but do you know how to define a specific counter ressetting at each chapter? I don't understand the answer of Christian and I can't make it work :/ – Marine Galantin Jan 26 '18 at 17:47
• @MarineGalantin Then it would be best if you take Christians answer and write a follow up question about your counter problem. – samcarter is at topanswers.xyz Jan 26 '18 at 18:26