emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] tricky odt export needs


From: Christian Moe
Subject: Re: [O] tricky odt export needs
Date: Wed, 20 Nov 2013 22:33:47 +0100
User-agent: mu4e 0.9.9.5-dev6; emacs 24.3.1

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]