[tex-eplain] emulating a \description environment
Guy Worthington
guyw@multiline.com.au
Mon, 26 Feb 2001 11:20:43 +0800
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C09FE6.289A01D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Thanks Daniel for a very easy to read analysis of the paragraph
annotations macro. I've added all your improvements to my code
snippet.
The paragraph shaping of the first paragraph is satisfactory, however
I'm still not happy with the result. If I must have a ragged edge
(because my paragraph is too narrow) I'd prefer it to be ragged-right,
not as it is displayed in my .dvi.
%-annot1.tex-------------------------------------------------
\hsize=30pc \vsize=50pc
\font\KeywordFont=cmsltt10
\catcode`\"=\active
\catcode`\|=\active
\gdef|{\begingroup\it \let|=\endgroup} % for marking up a variable
\gdef"{\begingroup\tt \let"=\endgroup} % for marking up literals
\def\keyword#1{{\KeywordFont#1\/}} % Keyword Font
\parindent0pt \clubpenalty10000 \widowpenalty10000
\def\Annotation#1&{%
\hangindent10em\hangafter0
\llap{\hbox to10em{#1\hss}}\ignorespaces}
\everypar={\Annotation}
\def\\{\leavevmode}
\\{\bf Method} & {\bf Description}
\vskip1\jot
\\|wait|() & There are three overloaded versions of this method.
This version has no parameters and suspends the current thread
until the |notify|() method for the object to which the |wait|()
belongs, is called. Note that when |wait|() is called, it release
the synchronization lock on the object, so another method or code
block synchronized on the same object can be called. This will
allow other threads to call |wait|() for the same object.
\\ & Since all version of the |wait|() method can throw an
|InteruptedException|, you must call it in a |try| block with a
|catch| block for this exception, or indicate that the method
calling it throws this exception.
\\|wait|(\keyword{long} |timeout|) & This version suspends the
current thread until the number of milliseconds specified by the
argument has expired, or until the |notify|() method for the
object to which the |wait|() method belongs is called, if that
occurs sooner.
\\\vtop to 0pt{\hbox{|wait|(\keyword{long} |timeout|,}
\hbox{\keyword{int} |nanos|}\vss} & This version works
in the same way as the previous version, except that the time interval
is specified by two arguments, the first in milliseconds and the
second in nanoseconds.
\\|notify|() & This will restart the thread that has called the
|wait|() method for the object to which the |notify|() method
belongs. If no threads are waiting, the method does nothing.
\\|notifyAll|() & This will restart all threads that have called
the |wait|() for the objects to which the |notifyAll|() method
belongs.
\bye
%----------------------------------------------------------
------=_NextPart_000_0005_01C09FE6.289A01D0
Content-Type: application/octet-stream;
name="annot1.dvi"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="annot1.dvi"
9wIBg5LAHDsAAAAAA+gbIFRlWCBvdXRwdXQgMjAwMS4wMi4yNjoxMDQwiwAAAAEAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////jZ/yAACOoAJYAACNoP2yAACNjY3zFxryIlYA
CgAAAAoAAAAGY21ieDEwwk1ldGhvkFHHZI6OkWQACkRlc2NyaXB0aW9ujp8PAACNjY3zJP0AJzoA
CgAAAAoAAAAGY210aTEwz3dhaXTzAEvxYHkACgAAAAoAAAAFY21yMTCrKCmOjpFkAApUaGVyZZYE
YWhhcmWTdGhyZWWTb5W443aTZXJsb2FkZWSbBGFodpNlcnNpb25zmG9mmHRoaXOYbWV0aG+QRx1k
LpEHlgFUaGlzjqQMAACNkWQACnaauONlcnNpb26WA2jfaGFzk25vk3BhcmFtZXRlcnOTYW5kk3N1
c3CQRx1lbmRzk3RoZZNjdXJyZW6YdJN0aHJlYWSOoY2RZAAKdW6auON0aWyWA1EzdGhlk89ub3Rp
ZnmrKCmTbWV0aG+QRx1kk2ZvcpN0aGWTb2KRAI44amVjdJN0b5N3aGljmGiTdGhlk893YWl0qygp
jqGNkWQACmKQRx1lbG9uZ3MsmwMg+mlzlgMT42NhbGxlZC6RBFv3Tm90ZZN0aGF0k3doZW6Tz3dh
aXSrKCmTaXOTY2FsbGVkLJhpdJNyZWxlYXNljqGNkWQACnRoZZYCZVBzeW5jmrjjaHJvbml6YXRp
b26TbG+QRx1jmGuTb26TdGhlk29ikQCOOGplY3QskQKVUXNvk2Fub3RoZXKTbWV0aG+QRx1kk29y
jqGNkWQACmNvlUcdZGWbA9+WYmxvk2OVuON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