a2ps
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

catman formatting patch


From: David Starks-Browning
Subject: catman formatting patch
Date: Thu, 7 Jun 2001 15:45:11 +0100

Greetings,

I use a2ps-4.13b to print man pages.  I love that it's clever enough
to convert c^Hc to a bold 'c'.  There is even code to convert other
combinations, like o^H+ to LaTeX's \oplus symbol.

Unfortunately, Digital (Compaq Tru64) UNIX man pages go a step further
and construct o^Ho^H+^H+ (a bold '+' inside a bold 'o') as a fancy
"bullet" character.  Unfortunately a2ps does not deal with this,
instead it prints 'o^H+' (where the 'o' and '+' are in bold).

This is done in src/read.c.  It was easy to add this special case.
Here's the patch:

====================================================================
--- read.c.orig Thu Jan 13 17:23:39 2000
+++ read.c      Thu Jun  7 15:37:18 2001
@@ -88,6 +88,19 @@
          *face = Keyword_strong;
          buffer->curr += 6;
        }
+      /* Seen on Digital (Compaq Tru64) UNIX man pages,
+        a bold itemize symbol. */
+      else if ('o'  == c &&
+              'o'  == input[0] &&
+              '\b' == input[1] &&
+              '+'  == input[2] &&
+              '\b' == input[3] &&
+              '+'  == input[4])
+       {
+         *face = Symbol;
+         buffer->curr += 6;
+         c = 0305; /* \oplus in LaTeX */
+       }
       else if  (c    == input[0] &&
                '\b' == input[1] &&
                c    == input[2])
====================================================================

Note that I did not check for other combinations, like +^H+^Ho^Ho, or
who knows what else.  Is that necessary?

I just copied the choice of symbol from the other cases ('+^Ho' and
'o^H+').  I don't know whether a bold version of \oplus would be
preferable, or is even available.

This suits our needs, but certainly there are lots of other
Digital/Compaq users out there, so maybe this (or something like this)
should go into the next version?

Thanks very much for your work on a2ps!

Regards,
David

 -------------------------------------------------------------------
  David Starks-Browning                  | address@hidden
  EMBL Outstation --                     |
  The European Bioinformatics Institute  |
  Wellcome Trust Genome Campus           | tel: +44 (1223) 494 616
  Hinxton, Cambridge, CB10 1SD, UK       | fax: +44 (1223) 494 468
 -------------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]