[Top][All Lists]

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

Re: [skribilo-users] bibliography sorting

From: Ludovic Courtès
Subject: Re: [skribilo-users] bibliography sorting
Date: Sat, 18 Aug 2012 18:09:26 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux)

Hi Roger,

Roger Mason <address@hidden> skribis:

> Regarding the documentation, I suggest that the first line in 6.3.2 be
> changed from:
> The *:sort* option of the |the-bibliography|
> <>
> markup is used for sorting the bibliography entries. There are three
> pre-existing functions for sorting entries:
> to:
> "The *:sort* option of the |the-bibliography|
> <>
> markup is used for sorting the bibliography entries. There are three
> pre-existing functions for sorting entries by author, date or
> identifier.  These funclions are loaded by putting
> (use-modules (skribilo biblio))
> at the top of the document."

Right.  I ended up adding a section about modules and the ‘use-modules’
form, and then something along what you wrote for the bibliography
sorting section.  So thanks for the suggestion!

In the future, it would be even nicer if you could send a patch against
the manual’s source, which consists of the .skb files under doc/user.

> In the scientific publications for which I write, the common manner of
> citing publications is by author and year.  For example:  "Mason
> (1979) demonstrated how silly science can be.  This is in complete
> contrast to earlier authors (Einsten, 1924; Schroedinger, 1930) with
> their serious approach to their work."  The entries are then sorted
> alphabetically, without an identifier.  I guess that in order to have
> that citation style and reference list I would need to hack something
> like Ex. 31 and put it in the document?

Sort-of.  First, you would need to use:

  (the-bibliography :labels 'name+year)

This will give you references like “[Einstein 1924, Schroedinger

But since you want parentheses and commas instead, you’ll have to
customize the ‘bib-ref’ and ‘bib-ref+’ markups.  The former is used when
referring to a single entry, while the latter is used when referring to
more than one entry.

Here’s a complete example:

--8<---------------cut here---------------start------------->8---
(use-modules (skribilo writer) (skribilo engine))
   '(book queinnec:lisp
      (author "Christian Queinnec")
      (title "Lisp In Small Pieces")
      (publisher "Cambridge University Press")
      (year "1996"))

   '(book scheme:ieee
       (title "IEEE Standard for the Scheme Programming Language")
       (author (noabbrev "IEEE Std 1178-1990"))
       (publisher "Institute of Electrical and Electronic Engineers, Inc.")
       (address "New York, NY")
       (year "1991")))

(markup-writer 'bib-ref (*current-engine*)
   :options '(:text :bib)
   :before "("
   :action (writer-action (markup-writer-get 'bib-ref (*current-engine*)))
   :after ")")

(markup-writer 'bib-ref+ (*current-engine*)
   :options '(:text :bib)
   :before "("
   :action (writer-action (markup-writer-get 'bib-ref+ (*current-engine*)))
   :after ")")

(document :title "Example"
   (chapter :title "Good"
      (p [These are good books ,(ref :bib '("queinnec:lisp"
"scheme:ieee")).  This one is actually a standard ,(ref :bib
   (chapter :title "Refs"
      (the-bibliography :labels 'name+year)))
--8<---------------cut here---------------end--------------->8---

The ‘markup-writer’ calls modify the way the current engine renders
bibliography references.  The ‘bib-ref’ markup corresponds to references
to a single entry, while the ‘bib-ref+’ markup is for several entries.
Here, we just reuse the default definition, except that we ask for
parentheses instead of square brackets.

But the issue with commas instead of semi-colons is still here.  To fix
that, currently, you’d basically have to copy/paste the ‘bib-ref+’
writer from engine/base.scm, and change it to use semi-colons instead.
Not convenient, but it does the job.

And yes, this has yet to be documented...

> By the way: what|*is*** |(*bib-table*)?  Do the asterisks designate
> text?  Again, a usage example would really make the documentation
> clearer.

No.  Scheme identifiers can contain almost any characters, and this one
contains asterisks.  By conventions, identifiers *like-this* are used in
Skribilo for global variables.


reply via email to

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