Go to page:

Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

FAQ /

ShadedBox

Categories: Tag me
<< | Page list | >>

> I've got an ERT for defining a shaded box with a line around it. I'm
> trying to make my own environment for it, but I'm just not getting the
> Preamble right.

Well, after spending a few hours reading 'The Not So Short Guide to LaTex' and 'A Simplified Introduction to LaTeX' and pulling some of Herbert Voss' pages out of Google's catch (a few transatlantic links have been spotty, so I can't get there directly) I've got this, which works quite nicely:

  
Preamble
\usepackage{color,calc}
\definecolor{shade}{gray}{0.8}
\newenvironment{myshadedbox}[1][]%
        {
        %\setlength{\fboxsep}{-\fboxrule}
        \footnotesize\normalfont\ttfamily\raggedright
        \setlength{\rightmargin}{\leftmargin}
        \setlength{\itemsep}{-12pt}
        \setlength{\parsep}{20pt}
        \begin{lrbox}{\@tempboxa}%
        \begin{minipage}{\linewidth-2\fboxsep}
        }%
        {
        \end{minipage}%
        \end{lrbox}%
        \fcolorbox{black}{shade}{\usebox{\@tempboxa}}\newline\newline
        }%
EndPreamble
  

Just figured I'd post it in case anyone else was curious how to do it.

From: Peter Harkins http://push.cx(approve sites)


Tag me

<< | FAQ.PageList | >>

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2010-06-05 01:00 CEST