groff
[Top][All Lists]
Advanced

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

Re: [Groff] refer help


From: Peter Schaffter
Subject: Re: [Groff] refer help
Date: Sun, 5 Sep 2010 15:42:13 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

On Sun, Sep 05, 2010, Werner Lemberg wrote:
> 
> > \*[foo Blow2], with macro "foo" blank, as above, prints the entry
> > correctly but refer doesn't sort it (probably something to do with
> > the asterisk).  It winds up at the top of the bibliography.
> > 
> > %A \C'Blow2'\[duplicate] works reliably, so it's probably the best
> > solution.  The "2" is abitrary.  Any alphanumeric(s) after the
> > author's name maintains the sort order provided the same one(s)
> > is/are used for subsequent duplicate entries.
> > 
> > Still not happy about refer not having a mechanism for dealing with
> > multiple works by the same author, but it's way beyond my expertise
> > to fix that.
> 
> Example, please.

This is the bibliography database.

-----biblio-----
%A Ray Bradbury
%T Fahrenheit 451
%I Ballantine
%C New York
%D 1953

%A Ray Bradbury
%T Something Wicked This Way Comes
%I Simon & Shuster
%C New York
%D 1962

%A Ray Bradbury
%T The Illustrated Man
%I Doubleday
%C New York
%D 1951
-----end biblio-----

And this is the test file.

-----refer-test.mom-----
.TITLE  "Refer test document
.AUTHOR "Peter Schaffter
.PRINTSTYLE TYPESET
.START
.PP
Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Sed at
ante.  Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Sed
at ante.  Mauris eleifend, quam a vulputate dictum, massa
quam dapibus Lorem ipsum dolor sit amet, consectetur
.PP
Nulla facilisi.  Nunc volutpat.  Vestibulum ante ipsum primis in
faucibus orci luctus et ultrices posuere cubilia curae.  Ut sit
amet orci vel mauris blandit vehicula.  Nullam quis enim.  Integer
dignissim viverra velit.
.\"
.\" Refer section
.\"
.char \[duplicate] \v'-.3m'\l'3m'\v'.3m'\&
.R1
no-label-in-text
no-label-in-reference
join-authors ", and " ", " ", and "
database biblio
sort A1Q1T1B1E1
reverse A1
.R2
.BIBLIOGRAPHY_TYPE PLAIN
.BIBLIOGRAPHY
.[
fahrenheit
.]
.[
wicked
%A \C'Bradbury2'\[duplicate]
.]
.[
illustrated
%A \C'Bradbury2'\[duplicate]
.]
.[
$LIST$
.]
-----end refer-test-mom-----

Processed with 'groff -mom -R refer-test.mom', the bibliography
comes out correctly as

      Bradbury, Ray.  _Fahrenheit 451._ etc
      -----. _The Illustrated Man._ etc
      -----. _Something Wicked This Way Comes._ etc

However, if, in the "Refer section", rather than using the \C escape to
prevent output of "Bradbury2" while allowing refer to see it for
sorting purposes, we define a blank macro

    .de foo
    ..

then

    .[
    fahrenheit
    .]
    .[
    wicked
    %A \*[foo Bradbury2]\[duplicate]
    .]
    .[
    illustrated
    %A \*[foo Bradbury2]\[duplicate]
    .]
    .[
    $LIST$
    .]

produces

      -----. _The Illustrated Man._ etc
      -----. _Something Wicked This Way Comes._ etc
      Bradbury, Ray.  _Fahrenheit 451._ etc

In other words, refer doesn't see "Bradbury2" for the purposes of
sorting, and sorts the two Bradbury2 entries by title only.

My aim is to come up with a concise, reliable way to get refer to
see the first part of the replacement %A fields (the duplicates)
without outputting them, allowing for correct sorting even when the
%A fields contain only the long dash.  As a kludge, the \C escape
with a non-existent glyph name works, and meets the "concise,
reliable" criteria.  Curiously, the shorter "\[name]" doesn't work.

The ideal, of course, would be a refer command that instructs refer
what to do with duplicate authors.

-- 
Peter Schaffter

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



reply via email to

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