emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Flattening references in ODT export


From: James Harkins
Subject: Re: [O] Flattening references in ODT export
Date: Sat, 09 Sep 2017 05:06:24 -0400
User-agent: Zoho Mail

---- On Fri, 08 Sep 2017 23:52:33 -0400 James Harkins <address@hidden> 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




reply via email to

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