groff
[Top][All Lists]
Advanced

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

Re: [Groff] using -mom to write a paper


From: Peter Schaffter
Subject: Re: [Groff] using -mom to write a paper
Date: Tue, 1 Feb 2011 17:46:17 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Feb 01, 2011, Petr Man wrote:
> I have decided to give -mom a try for a scientific paper. Although it
> is not primarily intended for such task, I have found out, that I can
> adapt it to most of my needs. However, I have a few issues, that I am
> unable to work out. Any help is welcome.
> 
> Problem 1:
> I would like to have a cover page in my document, that looks exactly
> like the cover page -mom creates for me, but with a logo above the
> title. Is there any simple way to do that?

Yes.  Anything you set prior to invoking .START gets printed on the
same page as the first page that comes after .START.  In your case,
the first page after .START is the cover.  Therefore, if you set
your logo before .START (with .PSPIC?), it will appear on the cover
wherever you position it; the cover will in all other respects be
exactly as mom formats it by default.

Say your logo is composed of 10 X's.  The following will print the
X's, centred, 6 cm from the top of the page.  The formatting and
positioning of the remaining cover text will be exactly the same as
if you hadn't set the X's.

.TITLE      "Test Document
.AUTHOR     "Petr Man
.PRINTSTYLE TYPESET
.COVER      TITLE AUTHOR
.CENTER
.SP |6c-1v
XXXXXXXXXX
.START

> Problem 2:
> My document is typeset in two columns. I would however like to have an
> abstract in full width under the document title and then the two
> columns on the same page for everything else. I can't find any way to
> do that, so I have for now put it on a separate page. Having a
> separate page has also the negative side effect that I end up having
> twice the title in the TOC, because the page with abstract is actually
> extra document followed by .COLLATE.

Use .EPIGRAPH with the BLOCK argument, immediately after .START, and
plug the abstract in there.  That will set the abstract across the
full measure above the columns.  You'll probably want to set the
epigraph indent to 0 (.EPIGRAPH_INDENT 0) and make other adjustments
to the epigraph style to bring the formatting in line with your doc.
See the "Epigraph control macros" section of the docs.
 
> Problem 3:
> I am having problem with lists that don't fit on one page or one
> column. In the case where the list doesn't fit the page, -mom inserts
> an extra page with one word and a warning about "environment stack
> underflow" and then continues on the following page. Same error when
> it breaks into the next column, but in that case it seems to render
> correctly.

The problem seems to have resulted from an extraneous brace in the
HEADER macro.  It's fixed in the repository, so grab the latest copy
of om.tmac from there.

> The "environment stack underflow" also comes up if I make more than 9
> subheads in one column, but I am not able to reproduce this reliably.
> All this happens only when I use two columns.

I'm unable to reproduce this.  See whether it still crops up with
the fixed om.tmac in the repository.  If it does, attach an example
demonstrating the problem.

> Problem 4:
> I need one extra level of headings (a subsubhead). The manual suggests
> to use paraheads for this, but that does not behave consistently for
> me, as it sometimes does not flush the first line left, even if I told
> it to do so.

The docs are a little sketchy on how to trick mom into sub-subheads
with PARAHEAD.  Try defining a macro like this, either in om.tmac or at
the top of your doc.
 
.MAC SUB-SUBHEAD END
.\"  The following two lines define a sub-subhead style
.\"  (here identical to subheads)
.    PARAHEAD_FONT   B
.    PARAHEAD_SIZE   +.5
.\"  The next line ensures the sub-subhead is flush left
.    PARAHEAD_INDENT 0
.    PP
.\"  Subheads are raised slightly above the baseline for aesthetic
.\"  reasons.  The \v escape in the next line reproduces the same
.\"  behaviour for the sub-subhead.  Remove the \v escape if that's
.\"  not what you want.
.    PARAHEAD \v'-\\n[#LEAD]/5'\\$1
.\"  Resetting #PP in the next line ensures that the paragraph after
.\"  the sub-subhead gets treated as a proper post-heading paragraph
.\"  (i.e. is not indented)
.    nr #PP 0 1
.END

> In case I decide to extend my om.tmac, are there any
> caveats in "cloning" what .SUBHEAD does and adding an extra
> .SUBSUBHEAD?

Caveats include TOC collection/formatting, and head/subhead numbering.  

For the purposes of generating a TOC, the clone will collect the
sub-subhead as if it were a subhead and format it accordingly in the
TOC, which is probably not what you want.  Equally, the clone will
number the sub-subhead as if it were a subhead--again, most likely
not what you want.

If TOC and numbering aren't an issue, then cloning should work,
but I'd still recommend using the SUB-SUBHEAD macro, above, and
modifying it to your needs.

-- 
Peter Schaffter

Author of The Binbrook Caucus
http://www.schaffter.ca



reply via email to

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