emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Denis Maier via "General discussions about Org-mode."
	<emacs-orgmode@gnu.org>
Cc: Denis Maier <denis.maier.lists@mailbox.org>
Subject: Re: [wip-cite-new] Adjust punctuation around citations
Date: Sat, 15 May 2021 13:43:36 +0200	[thread overview]
Message-ID: <875yzkte6v.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <fc4d8a5b-38f2-6598-ae15-4a6ba0909170@mailbox.org> (Denis Maier via's message of "Fri, 14 May 2021 15:39:25 +0200")

Hello,

Denis Maier writes:

> Regarding French typography.
> With this example:
> ---------------------------------------------------
>
> #+language: fr
> #+cite_export: test
>
> "This is a complete sentence."[cite:@key]
>
> "This is an incomplete sentence" [cite:@key].

[...]

> I'm getting:
>
> ----------------------------------------------------
> "This is a complete sentence[1]."
>
> "This is an incomplete sentence[2]" .

[...]

> 2 is a bit odd.
> - there's the spurios space before the period.
> - I think in that case the footnote mark should be just before the 
> period, i.e. after the quotation mark. Basically like example 3.

[...]

> I don't know if that is feasible with the current parameters.

It is not. I added a `same' parameter for citation to achieve it. I also
fixed the space error.

You can try again with the following processor:

--8<---------------cut here---------------start------------->8---
(defun org-test--language-to-rule (info)
  (pcase (plist-get info :language)
    ("en-us" '(inside outside after))
    ((or "en" "de" "en-gb") '(static outside after))
    ("fr" '(static same before))
    (_ nil)))

(defun org-test-export-citation (citation style _backend info)
  (pcase style
    ("author-year"
     (org-cite-adjust-punctuation citation '(outside outside before) info nil t)
     "(John Doe, 1999)")
    (_
     (pcase (org-test--language-to-rule info)
       (`nil nil)
       (rule (org-cite-adjust-punctuation citation rule info)))
     (unless (org-cite-inside-footnote-p citation)
       (org-cite-wrap-citation citation info))
     "...")))

(org-cite-register-processor 'test
  :export-citation #'org-test-export-citation)
--8<---------------cut here---------------end--------------->8---

I'll comment further in another message.

Regards,
-- 
Nicolas Goaziou


      reply	other threads:[~2021-05-15 11:44 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 21:33 Nicolas Goaziou
2021-05-13 22:14 ` Denis Maier
2021-05-13 23:21 ` Bruce D'Arcus
2021-05-14  8:31   ` Denis Maier
2021-05-14 10:26   ` Nicolas Goaziou
2021-05-14 12:37     ` Bruce D'Arcus
2021-05-14  8:42 ` Denis Maier
2021-05-14 12:28   ` Bruce D'Arcus
2021-05-15 11:56   ` Nicolas Goaziou
2021-05-15 12:03     ` Bruce D'Arcus
2021-05-15 12:43       ` Bruce D'Arcus
2021-05-16 21:29     ` Denis Maier
2021-05-16 21:38       ` Bruce D'Arcus
2021-05-16 22:03         ` Denis Maier via General discussions about Org-mode.
2021-05-16 22:24           ` Bruce D'Arcus
2021-05-17  8:08             ` Denis Maier
2021-06-05 21:35               ` Nicolas Goaziou
2021-06-05 21:45                 ` Bruce D'Arcus
2021-06-05 22:00                   ` Denis Maier
2021-06-12  9:39                     ` Nicolas Goaziou
2021-06-12 21:41                       ` Bruce D'Arcus
2021-06-12 22:04                         ` Nicolas Goaziou
2021-06-12 22:12                           ` Bruce D'Arcus
2021-06-13  8:22                           ` Denis Maier
2021-06-13 21:54                       ` Denis Maier
2021-06-13 22:04                         ` Bruce D'Arcus
2021-06-13 22:23                           ` Denis Maier
2021-06-13 22:47                             ` Bruce D'Arcus
2021-06-14 11:45                               ` Denis Maier
2021-06-14 11:51                                 ` Denis Maier
2021-06-14 23:37                                 ` Bruce D'Arcus
2021-06-14 23:41                                   ` Bruce D'Arcus
2021-06-20  7:41                                   ` Nicolas Goaziou
2021-06-20 16:37                                     ` Bruce D'Arcus
2021-06-20 17:17                                       ` Nicolas Goaziou
2021-06-21  8:12                                     ` Denis Maier
2021-06-21  8:45                                       ` Nicolas Goaziou
2021-06-21  9:49                                         ` Denis Maier
2021-06-21 10:07                                         ` Denis Maier
2021-05-14 13:39 ` Denis Maier
2021-05-15 11:43   ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yzkte6v.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=denis.maier.lists@mailbox.org \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [wip-cite-new] Adjust punctuation around citations' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).