[comp.text.tex] Reverse video in LaTeX?

lulu@ucrmath.ucr.edu (david lu) (08/26/90)

	I will be writing a documention for a computer
program in a couple of weeks, where I'd like to show the
screen layout of the program.  The problem is that the
program uses reverse video to highlight some of the text.
How can I show reverse video in LaTeX?

					- David

-- 
---==lulu@ucrmath==---  just another bewildered college undergraduate.
David T Lu, Amateur Thinker: lulu@ucrmath.ucr.edu, {ucsd, uci}!ucrmath!lulu
"After three days without programming, life becomes meaningless."
				- Geoffrey James, _The Tao of Programming_

dougcc@csv.viccol.edu.au (Douglas Miller) (09/06/90)

In article <8317@ucrmath.ucr.edu>, lulu@ucrmath.ucr.edu (david lu) writes:
> 	I will be writing a documention for a computer
> program in a couple of weeks, where I'd like to show the
> screen layout of the program.  The problem is that the
> program uses reverse video to highlight some of the text.
> How can I show reverse video in LaTeX?

This is what I did when faced with the same problem.

Take the MF source file of your choice (e.g. CMTT10.MF), and change the
font idenifier (e.g., from CMTT to CMTTR) and change the line "generate
roman" to "generate reverse"

Make the file REVERESE.MF from ROMAN.MF by adding the following code
before the line "input romanu":

   let echar = endchar;
   def endchar =
   picture normalpicture; normalpicture=currentpicture;
   clearit;
   fill (l-1,-(desc_depth#+1u#)*hppp)--
        (r+1,-(desc_depth#+1u#)*hppp)--
        (r+1,(body_height#+1u#)*hppp)--
        (l-1,(body_height#+1u#)*hppp)--cycle;
   addto currentpicture also -normalpicture;
   echar enddef;
   let endchar_ = endchar;

(this is what "reverses" all the characters), and changing the line "input
romsub" to "input revsub".

Make the file REVSUB.MF from ROMSUB.MF by deleting the following code from
the space character at the end of the file:

   forsuffixes $=1,2,3,4: penpos$(thin_v
   penpos0(thin_vair,90); x0=.5w; y0l=vr
   x1=x2; x3=x4=w-x1; lft x1l=hround .75
   y1=y4=h; y2=y3=y0;                   
   fill z1l---z2l...(x2,y0l)---(x3,y0l).
    ..z4l---(x3l,y0r)--(x2r,y0r)---z1r..
   penlabels(0,1,2,3,4); 

This is the "visible" space character, that we will need to use between
words (TeX doesn't have stretchy black space), hence this character needs to
be reduced to a simple black rectangle.

To use the fonts I have a LaTeX macro:

   \newcommand{\reverse}{\ttr\catcode`\ =12}

Which changes the font and makes each space appear as a black rectangle.