🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #10701

Re: how to define a LaTeX environment with an *optional* argument?

#10701
From: Darrel Hankerson
Date: Sun, 24 Jan 1993 00:18
16 lines
1188 bytes
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
Technical Details
Message-ID: <1993Jan24.001854.8494@news.duc.auburn.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!news.duc.auburn.edu!usenet
References: <1jpnnsINN5el@retriever.cs.umbc.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex
Path: arc1-ca.pugleaf.net!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