home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / text / tex / 13337 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.6 KB  |  69 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!usenet
  3. From: heller@heller.slip.uiuc.edu (Helmut Heller)
  4. Subject: Re: line break after every character, how?:SOLUTION
  5. References: <1992Nov19.160226.6338@newssrv.edvz.univie.ac.at>
  6. Message-ID: <BxzKIz.4CC@news.cso.uiuc.edu>
  7. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  8. Reply-To: heller@lisboa.ks.uiuc.edu
  9. Organization: University of Illinois at Urbana
  10. Date: Thu, 19 Nov 1992 23:13:43 GMT
  11. Keywords: SOLUTION, Thanks
  12. Lines: 55
  13.  
  14. Thanks to everyone who responded to my original request.
  15.  
  16. David Carlisle, carlisle@cs.man.ac.uk, has actually made a style file which  
  17. does what I want. It is available from aston and SHSU and is called  
  18. showkeys.sty.
  19.  
  20. Muhammad Masroor Ali and Hiroshi NAKASHIMA pointed out how to split a word in  
  21. single characters and I based my solution on their insight (see below).
  22.  
  23. Peter Schmitt gave a solution involving "real" hyphenation; perhaps overkill  
  24. for what I wanted to do.
  25.  
  26. Here my little macros to make labels appear in the margins and if they don't  
  27. fit they are wrapped around nicely:
  28.  
  29. %% show labels in margins if draft mode
  30. \if@draft
  31. \def\BreakAfterEachCharacter#1{\Break#1\EndText}
  32. \def\Break#1{\ifx#1\EndText\let\next = \relax
  33.     \else#1\penalty0\let\next=\Break\fi
  34.     \next}
  35. \def\EndText{End@fT@xt}
  36. \reversemarginpar
  37. \def\label#1{\@bsphack\if@filesw {\let\thepage\relax
  38.    \def\protect{\noexpand\noexpand\noexpand}%
  39. \xdef\@gtempa{\write\@auxout{\string
  40.       \newlabel{#1}{{\@currentlabel}{\thepage}}}}}\@gtempa
  41.    \if@nobreak \ifvmode\nobreak\fi\fi\fi%
  42. % here comes the new stuff to print the label in the margin
  43. \def\@mr{%
  44. \smash{%\smash will eliminate hight and width of the box
  45. \hspace*{-2mm}% experimental factor, that is as far as the printer will print
  46. \hspace*{-\marginparwidth}% we reserve the width of the margin
  47. \hspace*{-\marginparsep}% we go as far out as possible, no outer space
  48. \parbox{\marginparwidth}{\raggedright\footnotesize\tt  
  49. \BreakAfterEachCharacter{#1}}}}
  50. \ifvmode
  51.  \@mr
  52. \else
  53.  \vadjust{\smash{\raise 8pt\hbox{\@mr}}
  54.    % we need this smash to elimitate the effect
  55.    % of the \raise
  56.          }
  57. \fi
  58. \@esphack}
  59. \fi
  60.  
  61.  
  62. --
  63. Servus, Helmut  (W9/DH0MAD) ______________NeXT-mail preferred________________
  64. heller@lisboa.ks.uiuc.edu   "Knowledge must be gathered and cannot be given" 
  65. FAX:   (217)244-6078                      ZEN, one of BLAKES7                
  66. Phone: (217)244-6914        -------------------------------------------------
  67. Helmut Heller, University of Illinois at Urbana-Champaign, Beckman Institute
  68. Theoretical Biophysics Group, Room 3143, MC 251
  69.