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.I think 1.5 (and maybe even 1.4.4) will allow you to use an OPTIONAL argument with layouts you declare, which is inserted using Inset>Short Title (yes, that's badly named). Richard 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/ > -- ================================================================== 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
