Article View: comp.text
Article #3792A few more .ip macros
From: clayton
Date: Mon, 08 Jun 1987 11:09
Date: Mon, 08 Jun 1987 11:09
43 lines
2057 bytes
2057 bytes
Tom Hoffman wrote a latex macro that almost solves the .ip paragraph
problem. I found his mixture of tex and latex confusing, so I rewrote
his solution in latex:
\newenvironment{itemlist}[1]
{\begin{list}{}{\settowidth{\labelwidth}{#1}
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\itemindent}
\addtolength{\leftmargin}{\labelsep}
\renewcommand{\makelabel}[1]{##1\hfill}}}%
{\end{list}}
I also took a whack at a complete solution:
% Back to tex we go.
\def\ml#1{%
\newbox \newlabel
\setbox \newlabel =\hbox{#1}%
\ifdim \wd\newlabel >\labelwidth
\newdimen \pad \pad=\textwidth
\advance \pad by-\rightmargin
\advance \pad by-\itemindent
\advance \pad by-\labelsep
\hbox to\pad {#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=\ml}}%
{\end{list}}
This seems to work; it even nests, but the inner itemlists cause
overfull \hbox errors. When I find I'm writing macros like \ml I
usually stop, calm down, and look for another solution. However, I'm
going to cut my losses and let this one go. Here's a hint for anybody
who picks it up: white-space is very important (which is partly why I'm
letting this go).
Technical Details
Message-ID:
<772@thumper.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!princeton!allegra!ulysses!faline!thumper!claytonShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!princeton!allegra!ulysses!faline!thumper!clayton From: clayton@thumper.UUCP Newsgroups: comp.text Subject: A few more .ip macros Message-ID: <772@thumper.UUCP> Date: Mon, 8-Jun-87 07:09:05 EDT Article-I.D.: thumper.772 Posted: Mon Jun 8 07:09:05 1987 Date-Received: Wed, 10-Jun-87 07:20:32 EDT Organization: Bellcore, Morristown, N.J. Lines: 43