0

I like the block environment, namely:

\begin{block}{Example}
Something interesting
\end{block}

However, it seems it is linked to beamer. So, is it possible to have something like the block environment when you have \documentclass{article}?

I added the package \usepackage{beamerarticle} which I found here, but when I use block it doesn't really show the block.

2
  • 2
    The output of the block environment depends on the beamer theme you use, but if you're referring the the more colorful ones, you can achieve a similar output using the tcolorbox package in your article.
    – leandriis
    Sep 26 at 20:37
  • That's exactly what I was looking for. Thanks.
    – Schach21
    Sep 26 at 20:50
1

enter image description here

\PassOptionsToPackage{svgnames}{xcolor}
\documentclass[twocolumn,a4paper]{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\usetikzlibrary{shadings,shadows}



\newenvironment{gblock}[1]{%
\tcolorbox[beamer,%
noparskip,breakable,
colback=LightGreen,colframe=DarkGreen,%
colbacklower=LimeGreen!75!LightGreen,%
title=#1]}%
{\endtcolorbox}



\begin{document}

\begin{gblock}{Example of \texttt{exampleblock}}
wwwwwwwwwwwwww
\end{gblock}

\end{document}

Or you may also like this

 \begin{tcolorbox} 
 [colback=white!100,colframe=red!75!black,width=10cm, 
 righttitle=0.5cm,subtitle style={boxrule=0.4pt, 
 colback=yellow!50!red!25!white},title= \bf{qqqqqqqq}\hfill  
 \bf{qqqqqqqqqqq}]
    \begin{center}\bf{aaaaaaaaa}\end{center}
    \tcblower
    qqqqqqqqqqqqq
\end{tcolorbox}

enter image description here

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.