On Mon, Sep 22, 2003 at 05:08:16PM +0300, Martin Vermeer wrote:
> On Mon, Sep 22, 2003 at 02:53:54PM +0200, Andre Poenitz spake thusly:
> > What's the real world problem you are currently trying to solve?
> 
> The one the (tested, working) solution of which is the following:
> 
> (lyx_sty.C)
> 
> string const boxwidth_def =
>     "\\newlength\\w\n";
> 
> string const fboxwidth_def =
>     "\\newcommand\\setfboxwidth[0]{%\n"
>     "\\setlength\\w{\\columnwidth}\n"
>     "\\addtolength\\w{-2\\fboxsep}\n"
>     "\\addtolength\\w{-2\\fboxrule}}%\n";
> 
> string const ovalboxwidth_def =
>     "\\newcommand\\setovalboxwidth[0]{%\n"
>     "\\setlength\\w{\\columnwidth}\n"
>     "\\addtolength\\w{-2\\fboxsep}\n"
>     "\\addtolength\\w{-0.8pt}}\n"; // 2x \thinlines width
> 
> and (insetbox.C):
> 
>     if (pt == "Boxed") {
>         os << "%\n\\par\\setfboxwidth\\fbox{\\parbox{\\w}{%\n";
>     } else
>         os << "%\n\\par\\setovalboxwidth\\ovalbox{\\parbox{\\w}{%\n";
> 
> ...
> 
> void InsetBox::validate(LaTeXFeatures & features) const
> {
>     features.require("boxwidth");
>     if (params_.type == "Boxed") {
>         features.require("fboxwidth");
>     } else {
>         features.require("fancybox");
>         features.require("ovalboxwidth");
>     }
>     inset.validate(features);
> }

I still don't see the problem (except that a global length '\w' is a bit
non-descriptive, '\lyxboxwidth' etc might be better.

In fact I'd think something along the lines of 

\usepackage{fancybox}
\usepackage{calc}

\par\fbox{\parbox{\columnwidth-2\fboxsep-2\fboxrule}{xxxx}}
\par\ovalbox{\parbox{\columnwidth-2\fboxsep-0.8pt}{xxxx}}

might be better.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to