[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Citation syntax: a revised proposal
From: |
Richard Lawrence |
Subject: |
Re: [O] Citation syntax: a revised proposal |
Date: |
Wed, 25 Feb 2015 21:10:54 -0800 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) |
Hi Nicolas,
Nicolas Goaziou <address@hidden> writes:
> Richard Lawrence <address@hidden> writes:
>
>> Agreed. I'd like to see an implementation of a parser for the
>> [cite:...] part of the syntax as a first step. If we can get that far,
>> I'd guess that extending the parser to include either a subtype label or
>> {:key val ...} syntax will not be too difficult to do.
>
> I'll do it by the end of the week.
That would be wonderful! Will you publish a patch or, better, a branch
somewhere, even if it's not ready for master?
I don't know if this is helpful, but I'm posting an updated grammar
below for the [cite: ...] part of the syntax that uses parentheses
around `cite' to indicate the distinction between in-text and
parenthetical citations. It doesn't include any clauses for a subtype
label or for extra key-value pairs.
Best,
Richard
We need a category of /citation/ objects, which require the following
properties (the names here are not important and could be changed):
- is-parenthetical (boolean; nil means is in-text)
- common-prefix (text)
- common-suffix (text)
- references (list)
Each reference in the list of references should be a plist with the
following properties:
- prefix (text)
- suffix (text)
- key (string)
- suppress-author (boolean; t means author name should not be output)
- is-full (boolean; t means a full bibliography entry should be
output in-place)
The category of citations has the following grammar:
- A CITATION is a PARENTHETICAL-CITATION or an IN-TEXT citation.
- A PARENTHETICAL-CITATION is either a SIMPLE-PARENTHETICAL or a
CITATION-LIST whose TAG is a PARENTHESIZED-TAG.
- An IN-TEXT-CITATION is either a SIMPLE-IN-TEXT, or a
CITATION-LIST whose TAG is a BARE-TAG.
- A SIMPLE-PARENTHETICAL is a KEY immediately surrounded by square
brackets.
- A SIMPLE-IN-TEXT is a BARE-KEY.
- A CITATION-LIST has the format
[TAG: PREFIX; INDIVIDUAL-REFERENCE; ... INDIVIDUAL-REFERENCE; SUFFIX]
where the initial PREFIX and final SUFFIX are optional. At least
one INDIVIDUAL-REFERENCE must be present. The colon and
semicolons here are literal and indicate the end of the TAG and
the end of a PREFIX or INDIVIDUAL-REFERENCE respectively.
- A TAG is either a PARENTHESIZED-TAG or a BARE-TAG.
- A PARENTHESIZED-TAG is a BARE-TAG, immediately surrounded by parentheses.
- A BARE-TAG is: `cite'.
- An INDIVIDUAL-REFERENCE has the format:
PREFIX KEY SUFFIX
The KEY is obligatory, and the prefix and suffix are optional.
- A BARE-KEY is a KEY with immediately-preceding whitespace
- A KEY optionally begins with `-', and obligatorily contains `@' or
`&' followed by a string of characters which begins with a letter
or `_', and may contain alphanumeric characters and the following
internal punctuation characters:
:.#$%&-+?<>~/
- A PREFIX or SUFFIX is arbitrary text (except `;', `]', and KEYs)
which may contain only the following Org objects:
- bold
- code
- entity
- italic
- latex-fragment
- line-break
- strike-through
- subscript
- superscript
- underline
- superscript
- Re: [O] Citation syntax: a revised proposal, (continued)
- Re: [O] Citation syntax: a revised proposal, Richard Lawrence, 2015/02/20
- Re: [O] Citation syntax: a revised proposal, Rasmus, 2015/02/21
- Re: [O] Citation syntax: a revised proposal, Samuel Wales, 2015/02/21
- Re: [O] Citation syntax: a revised proposal, Samuel Wales, 2015/02/21
- Re: [O] Citation syntax: a revised proposal, Aaron Ecay, 2015/02/25
- Re: [O] Citation syntax: a revised proposal, Richard Lawrence, 2015/02/25
- Re: [O] Citation syntax: a revised proposal, Nicolas Goaziou, 2015/02/25
- Re: [O] Citation syntax: a revised proposal,
Richard Lawrence <=
- Re: [O] Citation syntax: a revised proposal, Thomas S. Dye, 2015/02/25
- Re: [O] Citation syntax: a revised proposal, Aaron Ecay, 2015/02/26
- Re: [O] Citation syntax: a revised proposal, Thomas S. Dye, 2015/02/26
- Re: [O] Citation syntax: a revised proposal, Stefan Nobis, 2015/02/27
- Re: [O] Citation syntax: a revised proposal, Richard Lawrence, 2015/02/27
- Re: [O] Citation syntax: a revised proposal, Rasmus, 2015/02/27
- Re: [O] Citation syntax: a revised proposal, Melanie Bacou, 2015/02/20
- Re: [O] Citation syntax: a revised proposal, Richard Lawrence, 2015/02/20
- Re: [O] Citation syntax: a revised proposal, Vaidheeswaran C, 2015/02/24
- Re: [O] Citation syntax: a revised proposal, Richard Lawrence, 2015/02/24