From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: tricky odt export needs Date: Wed, 20 Nov 2013 22:33:47 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjFQH-0003Hp-Me for emacs-orgmode@gnu.org; Wed, 20 Nov 2013 16:35:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjFQ6-0007IH-V9 for emacs-orgmode@gnu.org; Wed, 20 Nov 2013 16:34:57 -0500 Received: from mail-forward2.uio.no ([129.240.10.71]:56574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjFQ6-0007I2-OW for emacs-orgmode@gnu.org; Wed, 20 Nov 2013 16:34:46 -0500 Received: from exim by mail-out2.uio.no with local-bsmtp (Exim 4.75) (envelope-from ) id 1VjFQ4-0005nl-7x for emacs-orgmode@gnu.org; Wed, 20 Nov 2013 22:34:44 +0100 In-reply-to: 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: Dan Griswold , emacs-orgmode@gnu.org I said: > You can do cross-references with ordinary links. Have a look at the > manual section 4.2, "Internal links". However, what you get out of the > box is textual references to e.g. section headings, not page > references. You can change that for each reference individually by > right-clicking on them in LibreOffice. There should be a way to get page > references by default, but off the cuff, I'm not sure how. Well, here's one way to get those page references, using filters: (defun my-odt-filter-pagerefs (text backend info) "Make page references, not textual references in ODT export." (when (org-export-derived-backend-p backend 'odt) (replace-regexp-in-string "text:reference-format=\"text\"" "text:reference-format=\"page\"" text))) (add-to-list 'org-export-filter-link-functions 'my-odt-filter-pagerefs) (Whee! I just wrote my first export filter.) Org doesn't know what the page number will be, so when you open the document in e.g. LibreOffice, you still have to update fields (Tools > Update) before you see page numbers. Yours, Christian