|
From: | Dan Griswold |
Subject: | Re: [O] tricky odt export needs |
Date: | Thu, 21 Nov 2013 15:52:41 -0500 |
Well, here's one way to get those page references, using filters:
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.
(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
[Prev in Thread] | Current Thread | [Next in Thread] |