I am hoping to create a custom-styled example environment within r markdown that renders pdf output.
I want something that looks like this or like this, but I still want the example to be numbered, and I want to use the simple syntax
'''{example} <!-- I use ' instead of ` to make it appear in this question -->
Hello
'''
throughout my document. Is this achievable? Thank you in advance!
EDIT: I am adding a minimal example
---
header-includes:
- \newtheorem{theorem}{Theorem}
- \newtheorem{example}{Example}
urlcolor: blue
extension: latex_macros
numbersections: true
output:
bookdown::pdf_document2:
toc: false
biblio-style: apalike
---
'''{example} <!-- I use ' instead of ` to make it appear in this question -->
Hello
'''
Then I get something like this
But I would want the example to be styled and numbered. Maybe put inside a block that look maybe like this (Image from here, but no example number and I can't just use the r markdown block)



