emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Formal syntax for org-cite
@ 2021-11-30 17:21 Timothy
  2021-11-30 23:24 ` Tom Gillespie
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Timothy @ 2021-11-30 17:21 UTC (permalink / raw)
  To: emacs-orgmode, Nicolas Goaziou


Hi All (and Nicolas in particular),

There's recently been a little bit of progress on the Pandoc issue for
org-cite support
(https://github.com/jgm/pandoc/issues/7329#issuecomment-982805313), and
the maintainers are now asking if there is any specification for
org-cite syntax.

Looking at https://orgmode.org/worg/dev/org-syntax.html, there isn't,
and so I've tried to come up with a draft. Most of it was worked out
from what I know of the syntax combined with looking at org-element.el,
however I'm not sure what character class applies to the global and key
prefix/suffix components.

The draft:


Citation syntax is currently not documented, but from the implementation
it looks something like this:
#+begin_example
[cite CITESTYLE: GLOBALPREFIX KEYCITES GLOBALSUFFIX]
#+end_example

The only mandatory component, =KEYCITES= consists of one or more
instances of the pattern, separated by semicolons.
#+begin_example
KEYPREFIX @KEY KEYSUFFIX
#+end_example

=KEY= can be made of any word-constituent character, =-=, =.=, =:=, =?=,
=!=, =`=, ='=, =/=, =*=, =@=, =+=, =|=, =(=, =)=, ={=, =}=, =<=, =>=,
=&=, =_=, =^=, =$=, =#=, =%=, =%=, or =~=.

I have not yet confirmed what =KEYPREFIX= and =KEYSUFFIX= may contain,
but as a starting point, any of the characters allowed in =KEY= except
=@= plus whitespace would seem fairly safe. =KEYSUFFIX= must start with
a whitespace character to be able to be differentiated from =KEY=.

=CITESTYLE= consists of a main =STYLE= and any number of =VARIANT=​s
(including zero), prefixed by forwards slashes in the following pattern
#+begin_example
/STYLE/VARIANT/VARIANT/VARIANT
#+end_example

=STYLE= and =VARIANT= can be made of any alphanumeric character, =_=, or =-=.

=GLOBALPREFIX= and =GLOBALSUFFIX= can contain the same characters as
=KEYPREFIX= and =KEYSUFFIX=, however =GLOBALPREFIX= must end with a
semicolon, and =GLOBALSUFFIX= must start with a semicolon.

"cite" and =CITESTYLE=, =KEYCITES= and =GLOBALSUFFIX= are /not/
separated by whitespace. Neither are =KEYPREFIX=, =@KEY=, or =KEYSUFFIX=
separated by whitespace.


Do let me know what you think :)

Timothy.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-30  8:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-30 17:21 Formal syntax for org-cite Timothy
2021-11-30 23:24 ` Tom Gillespie
2021-12-01 13:16 ` Nicolas Goaziou
2021-12-02  6:26   ` Timothy
2021-12-02 12:13     ` Timothy
2021-12-02 12:50       ` Ihor Radchenko
2021-12-02 12:55         ` Timothy
2021-12-30  8:27 ` Timothy

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).