🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #4596

.ip environment redux

#4596
From: R. Clayton
Date: Fri, 08 Apr 1988 18:09
50 lines
1888 bytes
A while back I posted a latex environment providing .ip-like lists.  At
the time I noted the environment produced overfull \hbox errors when
nested.  Recently it was pointed out that the environment also exhausts
the \box and \dimen register spaces on long lists.  This new version
should fix both problems:

   \documentstyle{article}
   
   \catcode`@=11
   
   \newbox \itemlist@label
   \newdimen \itemlist@labelpad
   
   \def\itemlist@makelabel#1{%
      \setbox \itemlist@label =\hbox{#1}%
      \ifdim \wd\itemlist@label >\labelwidth
          \itemlist@labelpad = \textwidth
          \advance \itemlist@labelpad by -\rightmargin
          \advance \itemlist@labelpad by -\@totalleftmargin
          \advance \itemlist@labelpad by \labelwidth
          \hbox to \itemlist@labelpad {#1\hfill}%
      \else #1\hfill
      \fi
      }
   
   \newenvironment{itemlist}[1]
   {\begin{list}{}{\settowidth{\labelwidth}{#1}
   \setlength{\leftmargin}{\labelwidth}
   \addtolength{\leftmargin}{\itemindent}
   \addtolength{\leftmargin}{\labelsep}
   \let\makelabel=\itemlist@makelabel}}{\end{list}}
   
   \catcode`@=12
   
   \def\a{There is a certainty that an agreement will be signed on a
   political settlement.  I think that Pakistan and Afghanistan will come
   to an agreement.  And we with the Americans will agree to be guarantors,
   I think.}
   
   \begin{document}
   
   \begin{itemlist}{beta}
   \item[alpha] \a
   \item[beta] \a
   \item[gamma] \a
   \end{itemlist}
   
   \end{document}
   
Technical Details
Message-ID: <1035@thumper.bellcore.com>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mailrus!umix!umich!mibte!gamma!sabre!sword!faline!thumper!clayton

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mailrus!umix!umich!mibte!gamma!sabre!sword!faline!thumper!clayton
From: clayton@thumper.bellcore.com (R. Clayton)
Newsgroups: comp.text
Subject: .ip environment redux
Message-ID: <1035@thumper.bellcore.com>
Date: 8 Apr 88 18:09:46 GMT
Organization: Bellcore, Morristown, N.J.
Lines: 50