TeX版 - Shaded Box Around Text |
|
|
|
|
|
c*******n 发帖数: 32 | 1 Hi,
I am trying to put a shaded box around some text but I can't seem to do
it... Can someone help me? I tried using the "shadethm" package but
can't figure out how to get un-numbered theorems:
\newshadetheorem*{shadequote}
doesn't work, LaTeX compiler complains that \* is already defined.
I also found this piece of code online but can't figure out how to get
it to work either:
\usepackage{color,calc}
\definecolor{shade}{gray}{0.8}
\newenvironment{myshadedbox}[1][]%
{
%\set | a**e 发帖数: 5794 | 2 我看不懂你的例子,就自己写了一个。
\documentclass{article}
\usepackage{color,calc}
\definecolor{demo@bgcolor}{gray}{.8}
\let\oldfboxsep\fboxsep
\newsavebox{\mybox}
\newenvironment{shadedbox}{
\noindent
\begin{lrbox}{\mybox}
\begin{minipage}[c]{.945\textwidth}
}{
\end{minipage}
\end{lrbox}%
\setlength{\fboxsep}{8pt}
\colorbox{demo@bgcolor}{\usebox{\mybox}}
\setlength{\fboxsep}{\oldfboxsep}
}
\begin{document}
\begin{shadedbox}
blar
\end{shadedbox}
\end{document}
【在 c*******n 的大作中提到】 : Hi, : I am trying to put a shaded box around some text but I can't seem to do : it... Can someone help me? I tried using the "shadethm" package but : can't figure out how to get un-numbered theorems: : \newshadetheorem*{shadequote} : doesn't work, LaTeX compiler complains that \* is already defined. : I also found this piece of code online but can't figure out how to get : it to work either: : \usepackage{color,calc} : \definecolor{shade}{gray}{0.8}
|
|
|
|
|
|
|