This works, but clearly the best solution would be an Environment layout type that allows arguments.
Steve Litt wrote: > On Thursday 17 May 2007 12:03, you wrote: > >> There has been work towards creating legitimate environments, but it >> doesn't exist yet. As a hack, you actually can create an environment >> with an argument, but you have to put the argument in ERT, in braces, at >> the very beginning of the text in LyX. LyX will then output something >> like: \begin{myenv}{stuff in ERT}...\end{myenv}. You can also do a >> similar trick with commands, if you'd like to have more than one argument. >> > > Thanks Richard, > > It turned out to be simple and quite elegent. LyX gives the option of having > the LaTeXType of a LyX environment be "command". I have a feeling that > feature was included to do exactly what I was trying to do. My LyX BoxTitle > environment does nothing but call LaTeX COMMAND (not environment) \boxtitleL, > and \boxtitleL does nothing but \def\boxtitle{#1}. > > Following the title is the text of the box, which is in LyX environment > BoxText, which calls environment \boxtext. \boxtext makes a minipage, gives > it a background color via package framed, prints the title in \Large size, > skips a half an inch and prints the text to which LyX BoxText is applied. I > get a nice salmon colored box with a title and text. LyX tries very hard not > to pagebreak within the box. > > So I get the best of both worlds. The box title prints in LyX just like any > other large, centered text, while in LaTeX->dvi it prints from within the > \boxtext environment -- no ERT required. > > Thanks > > SteveT > > Steve Litt > Author: Universal Troubleshooting Process books and courseware > http://www.troubleshooters.com/ > > -- ================================================================== Richard G Heck, Jr Professor of Philosophy Brown University http://frege.brown.edu/heck/ ================================================================== Get my public key from http://sks.keyserver.penguin.de Hash: 0x1DE91F1E66FFBDEC Learn how to sign your email using Thunderbird and GnuPG at: http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto