home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / text / tex / 15369 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.1 KB  |  29 lines

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