On Wednesday 12 November 2008 08:22:29 am rgheck wrote:
> Max Bian wrote:
> > I am using LyX 1.6 on Windows Vista. How do I define a new layout that
> > does the following:
> >
> > 1) Take an image and some text.
> >
> > 2) In the backend, get LyX to place the text in a box, the image in
> > another box, then put the two boxes in a larger box side-by-side
> >
> > 3) Automatically number the outer box and display a label in final
> > output.
> >
> > Is this possible?
>
> Yes, this can be done---anything you can do in LaTeX you can do in
> LyX---though not easily, because LyX does not support multi-argument
> commands or environments very well. But you could do it with a couple
> optional arguments to a command defined in a layout. What's not clear to
> me is how to deal with the image. Do you want just to give the path, or
> do you want to use LyX's support for graphics? You can probably do it
> either way,
>
> rh

I don't remember if you can have 2 parboxes or whatever side by side, or 
whether you'd need to use a table. But whatever.

Here's how I usually do stuff like that:

I put the text in one environment. That environment prints nothing, instead 
assigning #1 to a variable. By the way, you might need to use a character 
style instead of an environment for that -- I don't remember, but I think 
envionrments print the text no matter what, which is not what you want. I put 
the graphic in a second environment -- a fairly complex one. The second 
environment makes a big box, then 2 small boxes. Box 1 gets #1, which I 
believe contains the graphic. Box 2 gets the saved variable, which contains 
the text.

The beauty of doing it that way is that everything you want is visible in LyX, 
at least somewhat representative of how it will look on paper.

HTH

SteveT
-- 
Steve Litt
Recession Relief Package
http://www.recession-relief.US

Reply via email to