a2ps
[Top][All Lists]
Advanced

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

Re: formatting question


From: Warren Pollans
Subject: Re: formatting question
Date: Fri, 27 Feb 2004 11:51:17 -0500

Thanks, that's exactly the advice I needed. Here's a copy of the style sheet I'm using. My needs are pretty simple - (1) pick out a group of words on some lines and highlight them and (2) highlight lines starting with two spaces.


# Style sheet for dance card index

style "wlp" is
case sensitive

first alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789?"
second alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789?# &"

operators are
  # HighLight Title
  (/^\\([^-]+ -- \\)\\([^(]+\\)\\(.*\\)/
     \1 Plain, \2 Keyword_strong, \3 Plain),

  # HighLight OneLiner
  (/^\\(  .*\\)/
     \1 Label_strong)

end operators

end style



On Friday, Feb 27, 2004, at 04:42 US/Eastern, Jan Willem Knopper wrote:

Warren Pollans wrote:
Hello,

Please feel free to point me elsewhere if this is not the appropriate
place to ask this question.

I have text files that I generate on the fly from database tables.
I've decided that they would look better if some groups of words were
in boldface. The words are not fixed "keywords" but can be found using
a regex of the form ^pattern1(.*)pattern2$ so that $1 (or \1 ?)
contains the word(s) I want print in bold.  What's the easiest way to
have a2ps do this?  It seems like I should be able to write a simple
.ssh file to this but I can't figure it out.


If you want to make a style sheet for your type of text files then you
can make pattern1 bold with a regex P-rule (pretty printing rule). The
example from the stylesheet info pages is:

 (/^([a-zA-Z0-9_]*)([\t ]*:)/, \1 Label_strong, \2 Plain)

which is made to highlight the a_rule of a `Yacc' rule:

     a_rule : part1 part2 ;

This rule can also be found in slightly different form in the file
yacc.ssh in the stylesheets directory (which for me is
/usr/local/share/a2ps/sheets).

I hope this helps,

Jan Willem






reply via email to

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