2

I want to create a block in every frame like this

enter image description here

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

Student
  • 1,134
  • 2
  • 9
  • 27

1 Answers1

4

You can make a similar box with the tcolorbox package.

\documentclass{beamer}
\usetheme{Madrid}
\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}

enter image description here

  • hi! how can you add the name of the definition in the upper small box ? thank you :)

    https://tex.stackexchange.com/questions/337331/how-to-create-a-rounded-beamer-block-with-the-title-starting-a-bit-forward-than?noredirect=1&lq=1 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 06:24
  • 1
    @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