![没有 Beamer 的块环境](https://linux22.com/image/440044/%E6%B2%A1%E6%9C%89%20Beamer%20%E7%9A%84%E5%9D%97%E7%8E%AF%E5%A2%83.png)
我喜欢块环境,即:
\begin{block}{Example}
Something interesting
\end{block}
但是,它似乎与 beamer 相关联。那么,当您拥有 时,是否有可能拥有类似于块环境的东西\documentclass{article}
?
\usepackage{beamerarticle}
我添加了我发现的包这里,但是当我使用block
它时并没有真正显示出块。
答案1
\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}
或者你可能还喜欢这个
\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}