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

[mgp-users 01181] Re: MGP Preprocessor Details; release soon!



On Mon, Jun 09, 2003 at 10:12:19AM -0400, Mark Allman wrote:
> Folks-
> 
> I use mgp for technical presentations.  I like it quite a lot.  I
> used to use latex and like mgp quite a lot better.  But, it really
> has three things that are less than optimal in my opinion...
> 
> (1) equation support is poor (as someone else noted, at least super
>     and subscripts would be really nice)

That needs to be handled by MGP internally, so I can't help with that;
I'm a preprocessor type-of-guy! 8-}

(And I stopped writing C code once I found out how great Perl is.)

> (2) no good way to make nice tables

I'm working on this.  My initial idea is to provide a format
similar to that of the UNIX tbl facility, because that's designed
with a text data-spec in mind.  The basic idea is to lay out the
format first, defining the stylistic attributes of each column and line,
with column-boundaries specified by a "|" character.

For example, the specification of a two-column table might
look something like this:
***********************************************************************
               <F_BOLD><ALLCAPS><S_8> | <F_BOLD><ALLCAPS><S_8>
=
    <C_RED><F_COURIER><A_CENTER><S_5> | <C_BLUE><F_ITALIC><A_RIGHT><S_5>
  <C_GREEN><F_COURIER><A_CENTER><S_5> | <C_GREEN><F_ITALIC><A_RIGHT><S_5>
-
  This line in red, courier, centered | This one blue, italic, right-justified
<C_BLACK black word>, now green again | This one green, italic, right-justified
***********************************************************************

The topmost line defines the styles for the initial Table
Heading line.  The = means draw a double-line across the
screen, to underscore the Heading line.  The next line
defines the styles for the first data line within the table.
The following line defines the styles for the second data
line, and due to the absence of any additional such lines,
all following data lines.  The - marks the end of the format
specifications, so the following lines are identified as data
for the body of the table.

Note that the default styles can be overriden by the formatting
tags supplied directly within the data lines, as in the <C_BLACK
stuff> case.

Regarding the style tags, <F_BOLD> means switch to the
predefined "bold" font, <S_8> means set the text size to 8
points, <A_RIGHT> means align text for right-justification, etc.
(See http://teachmeperl.com/mg2mgp.html for details.)

> 
> (3) the input format is way verbose

That's largely why I wrote my MGP preprocessor, so you can
define your own styles and apply them in-line, or define text
chunks and insert them in-line, with optional "undo"-ing of those
changes, instead of typing tons of %directives (many repeatedly)
to accomplish the same things.

> When I used latex I used a pre-processor that I liked a ton.  I
> wrote a new preprocessor for mgp that takes a format that is very
> similar and turns out mgp.
> 
<SNIP> 
> This is all just a perl script (yes, I know... ugh).  You're welcome
> to the code, but it is pretty rough and the documentation is pretty
> minimal (although it comes with an example file that includes an
> example of nearly all the capabilities, I think).  Send
> comments/fixes.  Slurp from:
> 
>     http://roland.grc.nasa.gov/~mallman/software/mmaker/
> 
> allman
> Mark Allman -- BBN/NASA GRC -- http://roland.grc.nasa.gov/~mallman/

Thanks for your contribution!  I'll check it out.  

-Tim
*------------------------------------------------------------*
| Tim Maher (206) 781-UNIX  (866) DOC-PERL  (866) DOC-UNIX   |
| CEO, JAWCAR ("Just Another White Camel Award Recipient")   |
| tim(AT)Consultix-Inc.Com  TeachMeUnix.Com  TeachMePerl.Com |
*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*
|  Watch for my Book: "Minimal Perl for Shell Programmers"   |
*------------------------------------------------------------*