From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: ox-bibtex.el -- how to join sequential citations Date: Sun, 24 Nov 2013 10:42:02 +0100 Message-ID: <8761ri6sr9.fsf@gmail.com> References: <87siunf5lq.fsf@gmail.com> <878uwemrni.fsf@news.tumashu-localhost.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkWCP-00080t-0F for emacs-orgmode@gnu.org; Sun, 24 Nov 2013 04:42:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkWCG-0004EX-Hk for emacs-orgmode@gnu.org; Sun, 24 Nov 2013 04:41:52 -0500 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]:63217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkWCG-0004EQ-An for emacs-orgmode@gnu.org; Sun, 24 Nov 2013 04:41:44 -0500 Received: by mail-ea0-f179.google.com with SMTP id r15so1622958ead.24 for ; Sun, 24 Nov 2013 01:41:43 -0800 (PST) In-Reply-To: <878uwemrni.fsf@news.tumashu-localhost.org> (Feng Shu's message of "Sun, 24 Nov 2013 10:59:13 +0800") 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: Feng Shu Cc: emacs-orgmode@gnu.org Hello, Feng Shu writes: > Eric Schulte writes: > >> When exporting multiple sequential citations e.g., cite:foo cite:bar >> etc... I would like to see something like the following (latex used for >> this example) "\cite{foo, bar}", but instead I'm getting "\cite{foo} >> \cite{bar}", which leads to poorly formed PDFs (a similar thing happens >> for HTML export). > > May be you should use \cite{foo, bar} directly in org file. That was, indeed, the original way to handle citations in the former org-export-bibtex.el. It is still supported in both LaTeX, obviously, and HTML (which will split the above among two anchors). "cite" link support was added later, and is lacking in this area. >> My question is how best to fix this, should I write a filter function, >> or does the export engine already have processes in place to handle >> these sorts of export context issues? At the user level, a filter is definitely the way to go. Though, it is an interesting feature to implement in ox-bibtex.el. One idea would be to write another parse-tree filter function which would change cite links into \cite{...} commands and consecutive cite links into \cite{..., ...} commands. This would also allow us to get rid of both `org-html-link' and `org-latex-link' advices, as no more cite link would be left in the parse tree anyway. What do you think? Regards, -- Nicolas Goaziou