Jürgen Spitzmüller <spitz <at> lyx.org> writes:
>
> Premanshu Bhushan wrote:
> > I have been writing a book in lyx. I am using a lot of shaded boxes to
> > highlight information. Is there a way to redesign all of them by
redefinig
> > them in preamble. For example, can i write a code to reduce the width to
> > 0.8 of text width and make them all centered. otherwise i will have to
> > manually select all more than 100 boxes and declare its property. it
> > defeats the purpose of using styles rather than manually formatting. I
have
> > been experimenting with renewcommand and renewenvironment codes but
without
> > much success.
>
> The following hack should work if all boxes currently have 100% text
width:
>
> \renewenvironment{shaded}{%
> \begin{center}%
> \begin{minipage}[t]{.8\columnwidth}%
> \def\FrameCommand{\fboxsep=\FrameSep \colorbox{shadecolor}}%
> \MakeFramed {\FrameRestore}%
> }{%
> \endMakeFramed
> \end{minipage}%
> \end{center}%
> }
>
> Another possibility would be do run a script on the LyX file directly.
>
> Regards,
> Jürgen
>
Thanks Jürgen Spitzmüller. Your hack does work as all my boxes were 100%
textwidth. Can u also help to understand something like running a script for
me in Lyx. Thanks.
Premanshu Bhushan
>