[comp.text.tex] Underlining a whole paragraph

rsingh@elaine17.stanford.edu (Rajesh Kumar Singh) (03/05/91)

Hello,

I know that underlining sucks :-) but this advisor of mine
absolutely wants to underline almost a paragraph of text in
article style.  What she wants is something like this.

blah  blah  blah  blah  blah  blah  blah  blah  blah  blah  
----  ----  ----  ----  ----  ----  ----  ----  ----  ----  
blah  blah  blah  blah  blah  blah  blah  blah  blah  blah  
----  ----  ----  ----  ----  ----  ----  ----  ----  ----  
blah  blah  blah. 
----  ----  ---- 

Even a continous underline is OK.  The trouble is that latex
typesets the WHOLE PARAGRAPH AS ONE SINGLE LINE. I looked
up in latex guide on pages 51 and 171 but it didn't help.

So far I have tried the following variations.

\begin{underline} Text to be underlined ... \end{underline}
\begin{underline} \parbox{\textwidth} Text to ... \end{underline}
\begin{underline} {Text to be underlined ...} \end{underline}
\underline{Text to be underlined ...}

None of it seems to work.  Thanks for any and all help.
--raj
--
Rajesh Kumar Singh               E-mail: rsingh@portia.stanford.edu
Gauls!  We have nothing to fear; except perhaps that the sky may fall
on our heads tomorrow.  But as we all know, tomorrow never comes!!
				-- Adventures of Asterix.

xiaofei@acsu.buffalo.edu (Xiaofei Wang) (03/06/91)

In article <1991Mar5.065740.27490@leland.Stanford.EDU> rsingh@elaine17.stanford.edu (Rajesh Kumar Singh) writes:
* Hello,
* 
* I know that underlining sucks :-) but this advisor of mine
* absolutely wants to underline almost a paragraph of text in
* article style.  What she wants is something like this.
* 
* blah  blah  blah  blah  blah  blah  blah  blah  blah  blah  
* ----  ----  ----  ----  ----  ----  ----  ----  ----  ----  
* blah  blah  blah  blah  blah  blah  blah  blah  blah  blah  
* ----  ----  ----  ----  ----  ----  ----  ----  ----  ----  
* blah  blah  blah. 
* ----  ----  ---- 
* 
I don't think this is LaTeX specific problem I tried to do the same 
with Plain TeX without success either. So I would like a Plain TeX
solution also. [I remember I tried \underline in math mode and it 
did not work. underbar in text mode does not work.]
-- 
xiaofei@acsu.buffalo.edu / rutgers!ub!xiaofei / v118raqa@ubvms.bitnet

wittig@gmdzi.gmd.de (Georg Wittig) (03/06/91)

rsingh@elaine17.stanford.edu (Rajesh Kumar Singh) writes:

>I know that underlining sucks :-) but this advisor of mine
>absolutely wants to underline almost a paragraph of text in
>article style.

>Even a continous underline is OK.  The trouble is that latex
>typesets the WHOLE PARAGRAPH AS ONE SINGLE LINE. I looked
>up in latex guide on pages 51 and 171 but it didn't help.



This one was in comp.text.tex some time ago.

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

\documentstyle{article}

\def\underl#1 {\leavevmode\let\first=\relax\underli #1 }
\def\underli#1 {\ifx&#1\let\next=\relax\unskip
                \else\let\next=\underli\first\ulinebox{#1}\fi\let\first=\undersp\next}
\def\undersp{\penalty50\ulinebox{\space}\penalty50}
\def\ulinebox#1{\vtop{\hbox{\strut#1}\hrule}}%Taken from TexHax v.88, 52


\begin{document}
\underl now is the time for all now is the time for all good men to now is the time now is the nownownow now iw is fhgdkhfd dfygdfg fkudshf &
\end{document}

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Have fun!

-- 
Georg Wittig   GMD-Z1.IT   P.O.Box 1240 | "Freedom's just another word
D-W-5205 St. Augustin 1	   (Germany)	|  for nothing left to lose"
email:		wittig@gmdzi.gmd.de	| (from "Me and Bobby McGee",
telephone:	(+49) 2241 14-2294	|  Janis Joplin, Kris Kristofferson)

allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) (03/14/91)

As quoted from <4239@gmdzi.gmd.de> by wittig@gmdzi.gmd.de (Georg Wittig):
+---------------
| rsingh@elaine17.stanford.edu (Rajesh Kumar Singh) writes:
| 
| >I know that underlining sucks :-) but this advisor of mine
| >absolutely wants to underline almost a paragraph of text in
| >article style.
| 
| This one was in comp.text.tex some time ago.
+---------------

I was notified by mail that the advisor got a clue and went with italics.
However, this is still likely to be of use to somebody.

The proper way to do underlining in TeX is to use an underlined font.  Keeping
that in mind (and since I've been trying to learn MetaFont anyway, without
benefit of a manual [ )-: ]) I came up with the following.

These are a good indication of how well the CM fonts are designed in MetaFont.
I have two clippings of MetaFont code which can be added to any font
individually or together to produce underlined, reversed, or reverse
underlined fonts.  (I needed these for a screen dumper which produces LaTeX
environments for inclusion in user documentation.  The dumper itself is
contingent on my figuring out how to use ptys on an Altos 1000 --- they seem
to be Streams-based, there is a /dev/pty and nothing else, with the clone
major device and pty major as its minor device.)

% place this before the "generate" line to create an underlined font
extra_endchar:=extra_endchar&"sd_underline_rule;";

def sd_underline_rule =
  pickup rule.nib; top y50=top y51=-desc_depth-.5rule_thickness;
  rt x51=w; lft x50=0; filldraw stroke z50--z51; enddef;

% place this before the "generate" line to create a reverse font
% code modified from the MFbook
extra_endchar:=extra_endchar&"sd_reverse_char;";

def sd_reverse_char =
  picture sd_rev_tmp; sd_rev_tmp := currentpicture;
  clearit; fill (0,-desc_depth-2)--(w,-desc_depth-2)--
    (w,body_height+1)--(0,body_height+1)--cycle;
  currentpicture:=currentpicture-sd_rev_tmp; enddef;

% you can place both to get a reverse underlined font; in that case, the
% reverse area will extend one pixel below the underline.
% Both reverse spaces and underlined spaces can be generated by generating
% an actual space character (see tset.mf) and using some TeX code to make
% a space on input generate a space character on output.

I have tested these, but not together.  I can't see why they wouldn't work
together.

++Brandon
-- 
Me: Brandon S. Allbery			    Ham: KB8JRR on 40m, 10m when time
Internet: allbery@NCoast.ORG		      permits; also 2m, 220, 440, 1200
America OnLine: KB8JRR // Delphi: ALLBERY   AMPR: kb8jrr.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery          KB8JRR @ WA8BXN.OH