From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: Citation syntax: a revised proposal Date: Wed, 25 Feb 2015 21:10:54 -0800 Message-ID: <87ioep2r6p.fsf@berkeley.edu> References: <87k2zjnc0e.fsf@berkeley.edu> <87bnkvm8la.fsf@berkeley.edu> <87zj8co3se.fsf@berkeley.edu> <87ioezooi2.fsf@berkeley.edu> <87mw4bpaiu.fsf@nicolasgoaziou.fr> <8761aznpiq.fsf@berkeley.edu> <87twyjnh0r.fsf@nicolasgoaziou.fr> <87oaopx24e.fsf@berkeley.edu> <87k2zd4f3w.fsf@nicolasgoaziou.fr> <87egpkv8g9.fsf@berkeley.edu> <877fv6xfaq.fsf@gmail.com> <87twya2ak0.fsf@berkeley.edu> <87zj81aa97.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQqja-0004F0-87 for emacs-orgmode@gnu.org; Thu, 26 Feb 2015 00:11:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQqjX-0003Sm-2G for emacs-orgmode@gnu.org; Thu, 26 Feb 2015 00:11:38 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:38701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQqjW-0003Se-Qe for emacs-orgmode@gnu.org; Thu, 26 Feb 2015 00:11:34 -0500 Received: by padbj1 with SMTP id bj1so11057783pad.5 for ; Wed, 25 Feb 2015 21:11:32 -0800 (PST) In-Reply-To: <87zj81aa97.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hi Nicolas, Nicolas Goaziou writes: > Richard Lawrence 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