home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.text.tex
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!news.duc.auburn.edu!usenet
- From: hankedr@mail.auburn.edu (Darrel Hankerson)
- Subject: Re: how to define a LaTeX environment with an *optional* argument?
- Message-ID: <1993Jan24.001854.8494@news.duc.auburn.edu>
- Sender: usenet@news.duc.auburn.edu (News Account)
- Nntp-Posting-Host: lab1.duc.auburn.edu
- Organization: Auburn University, Alabama
- References: <1jpnnsINN5el@retriever.cs.umbc.edu>
- Date: Sun, 24 Jan 1993 00:18:54 GMT
- Lines: 16
-
- In article <1jpnnsINN5el@retriever.cs.umbc.edu> finin@cs.umbc.edu (Timothy Finin) writes:
- >Is there a way to define an environment in LaTeX that takes a single
- >optional argument? I have the following definition for an environment
-
- Many LaTeX commands have optional arguments. Look for any one of them
- in latex.tex and you will find your answer. The usual approach is to
- use \@ifnextchar, as in
- \def\nopagebreak{\@ifnextchar[{\@nopgbk}{\@nopgbk[4]}}
-
- Remember, if you put such a def in the source file (as opposed to a style
- file to be used in the \documentstyle-line), then do
- \makeatletter
- <new definitions>
- \makeatother
-
- --darrel
-