Re: making a Box: using floatrow package in place of default float

2012-08-05 Thread Mostafa Tarek
Hello Justin, 

I'm trying to use your preamble script to have similar caption to the one in the
example but I get errors, I copied the script as is.

I get these errors:

LaTeX Error: Missing \begin{document)
desc: 
\ 
ifundefined{fs  boxed}{}% do nothing if not in use
You're in trouble here.  Try typingto proceed.
If that doesn't work, type  X   to quit.


LaTeX Error: Missing \begin{document)
desc:
\newcommand\floatc  simplerule[2]{\flushleft{\  fs  cfon...

You can't use:'macro parameter character #' in horizontal mode
desc:
 ...erule[2]{\flushleft{\  fs  cfont #
  1 #2}}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.

You can't use:'macro parameter character #' in horizontal mode
desc:
 ...le[2]{\flushleft{\  fs  cfont #1 #
  2}}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.

LaTex Error: \fs undefined
desc:
   \renewcommand\fs
 boxed{%
Try typingto proceed.
If that doesn't work, type  X   to quit.


Your help will be deeply appreciated

thanks in advance



Re: making a Box: using floatrow package in place of default float

2012-03-04 Thread Justin Wood
Justin Wood  gmail.com> writes:
> I'm still hoping to get floatrow integrated as a module though...
>
> To that end, do you know how the module parameter UsesFloatPkg = false
should
> behave?

Jürgen helped me figure out what I was doing wrong: needed to also specify
IsPredefined = true (I had false). I also finally realised I was making the
rookie mistake of trying to specify my preamble inside of the Float
definition itself.

I offer up my chimera for anyone who might be interested. It does work
quite well, BUT! be warned that as best I can tell this is effectively
overriding float with floatrow in all instances, so some behaviour is going
to be modified.

* It took me a while to find that I needed to specify the \floatsetup
command (in floatrow form) to get table float captions back on top where
they belong.
(I've gone with \floatsetup[table]{style=plain,capposition=TOP})

* Use of [H] for floats (place here definitely) appears to trigger a
package clash with float/floatrow because, at a guess, [H] expects float to
be loaded. There is discussion of [H] in the floatrow manual but it's a
little beyond me so I've ignored that for now.

Please be gentle... :)


boxedfloat-override.module
Description: Binary data


Re: making a Box: using floatrow package in place of default float

2012-03-03 Thread Justin Wood
Csikos Bela  freemail.hu> writes:
> 
> Hello:
> 
> Here are two example lyx files. See the difference between the location of
> the floats, which is reflected in the TOC.
> 
> This requires caption and floatrow packages but not the module you mentioned.
> For details see the documentation of floatrow package.
> 
> Cheers,


Thanks Csikos, that definitely demonstrates the output style I'm after.

I'm still hoping to get floatrow integrated as a module though...

To that end, do you know how the module parameter UsesFloatPkg = false should
behave? I had hoped this would let me specify a Float but then define it's
function in Preamble, etc. However LyX continues to try and build the new float
type using \newfloat etc as before. I suppose I could try to redefine those
commands...



Re: making a Box: using floatrow package in place of default float

2012-03-02 Thread Csikos Bela
Justin Wood  írta:
>Hi all. Bit of a tortured question, but hoping someone can help me sort this 
>out.The goal: I'm trying to add the ability to create box floats in my 
>doctoral thesis, which are used to contain regular text displayed as an 
>important aside. Attached is an example of what I'm after (box.pdf), based 
>on what I have so far.>
>
>
Functionality requirements:* a float, framed* numbered caption, derived from 
containing chapter (Box 2.1, 2.2, etc) which is included in the List of X in 
TOC* that caption should be at the top and inside the box itself>
>
* text should be smaller font size>
The setup:* LyX 2.0.2 on OS X 10.7.3 with TeXLive 2011.* documents use the 
bundled thesis template (KOMA-script), set with XeTeX for additional fonts 
(though the same function was provided by this mechanism when it was 
'just' LaTeX).>
>
To date (~18 months) I've been using a custom boxedfloat.module that Jürgen 
Spitzmüller provided me with (attached), with the following LaTeX preamble to 
control the caption format:\@ifundefined{fs@boxed}{}% do nothing if not in use>
>
{%  \usepackage{framed}>
>
   \newcommand\floatc@simplerule[2]{\flushleft{\@fs@cfont #1 #2}}  
\renewcommand\fs@boxed{%>
>
   \def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@simplerule    
\def\@fs@pre{\begin{framed}}%>
>
    \def\@fs@post{\end{framed}}%    \def\@fs@mid{\kern8pt}%>
>
    \let\@fs@iftopcapt\iftrue}}%This works very well — again, producing the 
example — however I have a couple of limitations that the floatrow package 
seems to be able to address:>
>
* specifying the font size once in preamble, whereas at the moment I've not 
been able to find any other way than ERT at the beginning and end of the float 
to add {\small ... }>
>
* the ability to use normal paragraph breaks rather than manually entering 
\medskip* the ability to include footnotes within the Box, which to date has 
proved impossible but floatrow states that it can do soThe problem...:>
>
I cannot get floatrow to work. I found this previous list trail from 2011, and 
followed the suggestion to implement floatrow.module (aside: looking at 
exported LaTeX, \usepackage{floatrow} is still inserted twice). Unfortunately 
nothing I've tried has succeeded, and my knowledge of LaTeX and/or LyX 
modules doesn't appear up to the task... It seems that the module 
overriding of the auto-included float package does not occur before LyX 
automatically adds the configuration commands pertaining to the original float 
package; namely:>
>
\floatstyle{boxed}\newfloat{boxfloat}{tbh}{lob}[chapter]>
>
\providecommand{\boxfloatname}{Box}\floatname{boxfloat}{\protect\boxfloatname}>
>
floatrow documentation sort of says this should work anyway, but it 
doesn't. Any time I try to replace or override this in the floatrow.module 
or LaTeX preamble, compilation (XeTeX) throws an Undefined control sequence 
error, protesting that \floatstyle{boxed} was not \def'd, followed by a 
missing \begin{document}. My tentative guess is that the float style commands 
are effectively being given twice?>
>
The request:I'll be eternally grateful if someone can help me solve this! I 
don't much care how it's done, whether by resolving this particular 
issue with using floatrow over the default float or by some other package or 
LaTeX wizardry. Perhaps it could even be added to LyX proper; surely I'm 
not that unusual in seeking this format type?>
>
Thanks as always!PS - slightly less than 6 months till immutable submission 
deadline...>
>
>
~:justin.wood:~ ≤ 350ppm>


Hello:

Here are two example lyx files. See the difference between the location of
the floats, which is reflected in the TOC.

This requires caption and floatrow packages but not the module you mentioned.
For details see the documentation of floatrow package.

Cheers,

bcsikos





textbox-float-a.lyx
Description: Binary data


textbox-float-b.lyx
Description: Binary data