From 3f09f53459b877f53072efbf57dec21fa37280b5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 13 May 2021 21:11:52 -0700 Subject: Implement curly-brace syntax for Markdown citation keys. The change provides a way to use citation keys that contain special characters not usable with the standard citation key syntax. Example: `@{foo_bar{x}'}` for the key `foo_bar{x}`. Closes #6026. The change requires adding a new parameter to the `citeKey` parser from Text.Pandoc.Parsing [API change]. Markdown reader: recognize @{..} syntax for citatinos. Markdown writer: use @{..} syntax for citations when needed. Update manual with curly-brace syntax for citations. Closes #6026. --- MANUAL.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'MANUAL.txt') diff --git a/MANUAL.txt b/MANUAL.txt index 75fe599e2..6f06d1e8a 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -4949,12 +4949,15 @@ Inline and regular footnotes may be mixed freely. #### Extension: `citations` #### Markdown citations go inside square brackets and are separated -by semicolons. Each citation must have a key, composed of '@' + -the citation identifier from the database, and may optionally -have a prefix, a locator, and a suffix. The citation key must -begin with a letter, digit, or `_`, and may contain +by semicolons. Each citation must have a key and may optionally +have a prefix, a locator, and a suffix. The citation key +consists of `@` plus the citation identifier, possibly +enclosed in curly braces. If the identifier starts +with a letter, digit, or `_`, followed by zero or more alphanumerics, `_`, and internal punctuation characters -(`:.#$%&-+?<>~/`). Here are some examples: +(`:.#$%&-+?<>~/`), then the curly braces may be omitted. +Identifiers may not contain whitespace characters or unbalanced +curly braces. Here are some examples: Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1]. @@ -4962,6 +4965,8 @@ alphanumerics, `_`, and internal punctuation characters Blah blah [@smith04; @doe99]. + Blah blah [@{https://example.com/bib?name=foobar&date=2000}, p. 33]. + `pandoc` detects locator terms in the [CSL locale files]. Either abbreviated or unabbreviated forms are accepted. In the `en-US` locale, locator terms can be written in either singular or plural forms, -- cgit v1.2.3