Oh never mind, I already solved this problem and forgot I'd solved it. I made 
the title LyX environment with a LatexType of command, and had that command 
set a variable, and then the box text environment used that variable.

SteveT

On Thursday 17 May 2007 11:47, Steve Litt wrote:
> Hi all,
>
> All my books contain, interspersed throughout regular text, boxes breaking
> out special stuff. The boxes are centered and have slightly narrower
> margins than the rest of the text. Each box has a large box title on the
> top line, and the text of the message to the reader in the rest of the box.
> Titles are often things like NOTE, TIP, WARNING, CAUTION, but often are
> completely ad-hock text, which is why I can't simply create an environment
> for each.
>
> Ideally title and text would go in a minipage, which I can make shaded. In
> fact, I could do that by setting the title text with ERT, and then putting
> the box text in a box environment which prints the title (which was
> declared in ERT) before printing the text.
>
> The trouble with that approach is the title won't be seen in the LyX GUI,
> which confuses me as an author.
>
> Another approach is to use an environment that has an argument. However, I
> know of no way that LyX can pass an arbitrary argument (as opposed to one
> fixed within the LyX environment declaration) to the LaTeX environment.
>
> What I'd REALLY like is a way to make an environment, call it \boxtitle,
> that does nothing but use any text within that environment to set a
> variable. Then the box environment, call it \box, would simply turn that
> text into a title within a minipage.
>
> Meanwhile, within LyX itself, \boxtitle (actually the LyX environment that
> calls it), would look like just another environemnt and show up perfectly
> in LyX.
>
> So does anyone know a way to create a LaTeX environment that, instead of
> printing the text it's applied to, sets a variable with the text it's
> applied to? If not, does anyone know another way to do what I need to do?
>
> Thanks
>
> SteveT
>
> Steve Litt
> Author: Universal Troubleshooting Process books and courseware
> http://www.troubleshooters.com/

Reply via email to