* Flattening references in ODT export
@ 2017-09-09 3:52 James Harkins
2017-09-09 9:06 ` James Harkins
0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2017-09-09 3:52 UTC (permalink / raw)
To: emacs-orgmode
Hi,
Is there a way to have "figure" references in ODT exports be simply a flat list?
Meaning -- I would like "Example 1," "Example 2," etc. (or "Figure," doesn't really matter).
With "num:nil," "Listing 1," "Listing 2," "Listing 3," but there is also a figure, which becomes "Figure 1." So there's a listing and a figure with the same index number. Hm.
I am pretty sure this will not satisfy the journal's style requirements.
It seems there is some customizability here[1], but which predicate should I use in place of org-odt--enumerable-image-p for listings?
I'm willing to avoid SRC blocks if that will help.
Also, it may not help to wrap all of these entities in FIGURE blocks, because I found (the hard way) ODT export fails if an image is inside a figure block.
Thanks,
hjh
[1] http://orgmode.org/manual/Labels-and-captions-in-ODT-export.html#Labels-and-captions-in-ODT-export
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Flattening references in ODT export
2017-09-09 3:52 Flattening references in ODT export James Harkins
@ 2017-09-09 9:06 ` James Harkins
2017-09-09 9:16 ` James Harkins
0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2017-09-09 9:06 UTC (permalink / raw)
To: emacs-orgmode
---- On Fri, 08 Sep 2017 23:52:33 -0400 James Harkins <jamshark70@zoho.com> wrote ----
> Is there a way to have "figure" references in ODT exports be simply a flat list?
>
> Meaning -- I would like "Example 1," "Example 2," etc. (or "Figure," doesn't really matter).
>
> With "num:nil," "Listing 1," "Listing 2," "Listing 3," but there is also a figure, which becomes "Figure 1." So there's a listing and a figure with the same index number.
So I found variable-help for org-odt-category-map-alist.
BTW the variable's help conflicts with the org manual. The manual says, to change the displayed label, you should change the second string for the category, but the help in Emacs indicates it's actually the fourth string.
Manual says:
(setq org-odt-category-map-alist
'(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p)))
Should be:
(setq org-odt-category-map-alist
'(("__Figure__" "Figure" "value" "Illustration" org-odt--enumerable-image-p)))
But it's still not working. Maybe I'm misunderstanding the fields. I thought keying __Figure__ and __Listing__ both to the OD-VARIABLE "Illustration" would make both of them share one numeric sequence:
(setq org-odt-category-map-alist
'(("__Table__" "Table" "value" "Table" org-odt--enumerable-p)
("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p)
("__MathFormula__" "Text" "math-formula" "Equation" org-odt--enumerable-formula-p)
("__DvipngImage__" "Equation" "value" "Equation" org-odt--enumerable-latex-image-p)
("__Listing__" "Illustration" "value" "Figure" org-odt--enumerable-p)))
... but they still get separate counters.
One suspicious thing in content.xml:
<text:sequence-decls>
<text:sequence-decl text:display-outline-level="2" text:name="Table"/>
<text:sequence-decl text:display-outline-level="2" text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="2" text:name="Text"/>
<text:sequence-decl text:display-outline-level="2" text:name="Equation"/>
<text:sequence-decl text:display-outline-level="2" text:name="Illustration"/>
</text:sequence-decls>
Org generates two Illustration counters...?
OK, so org has an inherent limitation that every distinct type of labeled entity must have a separate counter. Well, bother.
I guess next I'm going to try to hack ox-odt.el... (and, mental note, don't write for a journal ever again that won't accept PDF, 'cause the ODT exporter is really not mature by comparison. And don't tell me to write directly in LibreOffice, I have reasons why that is a terrible idea for me. I'll explain them another time if you like.)
hjh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Flattening references in ODT export
2017-09-09 9:06 ` James Harkins
@ 2017-09-09 9:16 ` James Harkins
2017-09-10 8:18 ` Nicolas Goaziou
0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2017-09-09 9:16 UTC (permalink / raw)
To: emacs-orgmode
---- On Sat, 09 Sep 2017 05:06:24 -0400 James Harkins <jamshark70@zoho.com> wrote ----
> I guess next I'm going to try to hack ox-odt.el...
Hm, that's going to be too complicated. So I suppose my only other option is to make an SVG for every code example, and include only images. Or hack the xml by hand in the final editing stage.
But it's strange... it seems like it should be simple enough to have one counter for both figures and listings. I'm surprised that org seems to be really quite adamant that nobody would ever, ever want this.
hjh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Flattening references in ODT export
2017-09-09 9:16 ` James Harkins
@ 2017-09-10 8:18 ` Nicolas Goaziou
2017-09-10 8:31 ` James Harkins
0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2017-09-10 8:18 UTC (permalink / raw)
To: James Harkins; +Cc: emacs-orgmode
Hello,
James Harkins <jamshark70@zoho.com> writes:
> ---- On Sat, 09 Sep 2017 05:06:24 -0400 James Harkins <jamshark70@zoho.com> wrote ----
>> I guess next I'm going to try to hack ox-odt.el...
>
> Hm, that's going to be too complicated.
I can help you doing so.
> So I suppose my only other option is to make an SVG for every code example, and include only images. Or hack the xml by hand in the final editing stage.
>
> But it's strange... it seems like it should be simple enough to have
> one counter for both figures and listings.
AFAIK, other export back-ends distinguish them, too. At least "ox.el"
contains both `org-export-collect-figures' and
`org-export-collect-listings'.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Flattening references in ODT export
2017-09-10 8:18 ` Nicolas Goaziou
@ 2017-09-10 8:31 ` James Harkins
0 siblings, 0 replies; 5+ messages in thread
From: James Harkins @ 2017-09-10 8:31 UTC (permalink / raw)
To: Nicolas Goaziou; +Cc: emacs-orgmode
---- On Sun, 10 Sep 2017 04:18:08 -0400 Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote ----
> > ---- On Sat, 09 Sep 2017 05:06:24 -0400 James Harkins <jamshark70@zoho.com> wrote ----
> >> I guess next I'm going to try to hack ox-odt.el...
> >
> > Hm, that's going to be too complicated.
>
> I can help you doing so.
Thanks. At this point, I've decided to abandon org export so that I can have more direct control over the captions and indexes. A bit painful decision, because I really like the way org handles in-line formatting, but the final document needs to "just work."
But... it might be an enhancement to put on the wish list. As far as I can see, org assumes that figure categories should always be kept separate and indexed separately, and the assumption seems to be embedded pretty deeply. It would be worth having a switch in the export options to turn that off.
hjh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-09-10 8:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-09 3:52 Flattening references in ODT export James Harkins
2017-09-09 9:06 ` James Harkins
2017-09-09 9:16 ` James Harkins
2017-09-10 8:18 ` Nicolas Goaziou
2017-09-10 8:31 ` James Harkins
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.