* new odt-exporter: problems with formatting in captions
@ 2013-12-16 13:45 Martin Gürtler
2013-12-16 19:09 ` Jambunathan K
2013-12-16 22:31 ` Andreas Leha
0 siblings, 2 replies; 4+ messages in thread
From: Martin Gürtler @ 2013-12-16 13:45 UTC (permalink / raw)
To: emacs-orgmode
Hi,
I just converted a 150 page document I used to convert to odt with the old
exporter. Following problems occurred:
1. table with #+CAPTION
If the caption contains formatting (~, ==, _, ^), the exporter
produces an invalid content.xml.
minimal example:
---8<------------------------------------------------------------
#+OPTIONS: num:t toc:nil \n:nil @:t ::t |:t ^:{} -:t f:t *:t <:nil
* First paragraph
#+CAPTION: A_{1}^{2}
| head 1 | head2 |
|-----------+----------|
| content 1 | content2 |
---8<------------------------------------------------------------
The problem can be seen in the following xml fragment:
---8<------------------------------------------------------------
<table:table table:style-name="OrgTable"
table:name="A<text:span
text:style-name="OrgSubscript">1</text:span><text:span
text:style-name="OrgSuperscript">2</text:span>">
---8<------------------------------------------------------------
The table:name attribute ends prematurely at the "OrgSubscript". This
could probably be mended by using single quotes for these attributes
inside attributes.
2. again #+CAPTION
if the caption contains a string with /escaped/ underlines (please
note the #+OPTION ^:t)
---8<------------------------------------------------------------
#+OPTIONS: num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:nil
* First paragraph
#+CAPTION: YYYYMMDD\_hhmmss.csv.
| head 1 | head2 |
|-----------+----------|
| content 1 | content2 |
---8<------------------------------------------------------------
The escaped _ is not detected; instead, a literal \ and subscript
are detected, and teh document is invalid as above. This escaping
seems not to be mentioned in the documentation, probably because it
is no longer valid. Might be of interest to people who want to
convert old documents.
3. the \ref syntax seems not to work anymore; substituting by \ref{text}
by [[text]] worked.
4. Empty lines between #+NAME and the respective table are no longer tolerated
remarks: I like the new smart quotes. More comfortable than putting in
the utf characters via C-8-RET (which is handy, though, for simple
formulae).
Regards
Martin
--
Dr. Martin Gürtler
Phone: +49-341-2254303
Mobile: +49-1578-4469069
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: new odt-exporter: problems with formatting in captions
2013-12-16 13:45 new odt-exporter: problems with formatting in captions Martin Gürtler
@ 2013-12-16 19:09 ` Jambunathan K
2013-12-18 10:15 ` Martin Gürtler
2013-12-16 22:31 ` Andreas Leha
1 sibling, 1 reply; 4+ messages in thread
From: Jambunathan K @ 2013-12-16 19:09 UTC (permalink / raw)
Cc: emacs-orgmode
Wrt items (1) and (2), I am planning to remove the support for short
captions. (The caption going as part of table:name or draw:name) as
part of fix for
http://lists.gnu.org/archive/html/emacs-orgmode/2013-12/msg00100.html
The fix is not ready yet. I am just feeling lazy after having not
looked at the code for almost an year now.
NOTE: If someone knows how to accommodate short captions (so that an
that an Index/TOC could be generated from within LibreOffice based on
it, please let me know.)
----------------------------------------------------------------
For the benefit of audience, if you use embedded images in your document
the document produced by the ODT exporter will be openable by
LibreOffice < 4.0 but not with LibreOffice > 4.1. (In other words,
LibreOffice folks have introduced some backward incompatible changes.)
To ensure that the document produced by the exporter is usable resave
the document from within LibreOffice. (i.e., make some trivial changes
to the ODT document and do a save again). This way the XML produced by
the exporter will be re-written by LibreOffice and the problem will be
averted.
----------------------------------------------------------------
As a side note, I am discussing with Emacs maintainers whether they
would be comfortable about having me maintain the exporter right from
within Emacs repo. I am not sure how the discussion will go.
http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00509.html
martin.guertler@gmx.de (Martin Gürtler) writes:
> Hi,
>
> I just converted a 150 page document I used to convert to odt with the old
> exporter. Following problems occurred:
>
> 1. table with #+CAPTION
> If the caption contains formatting (~, ==, _, ^), the exporter
> produces an invalid content.xml.
>
> minimal example:
>
> ---8<------------------------------------------------------------
> #+OPTIONS: num:t toc:nil \n:nil @:t ::t |:t ^:{} -:t f:t *:t <:nil
>
> * First paragraph
> #+CAPTION: A_{1}^{2}
> | head 1 | head2 |
> |-----------+----------|
> | content 1 | content2 |
> ---8<------------------------------------------------------------
>
> The problem can be seen in the following xml fragment:
>
> ---8<------------------------------------------------------------
> <table:table table:style-name="OrgTable"
> table:name="A<text:span
> text:style-name="OrgSubscript">1</text:span><text:span
> text:style-name="OrgSuperscript">2</text:span>">
> ---8<------------------------------------------------------------
>
> The table:name attribute ends prematurely at the "OrgSubscript". This
> could probably be mended by using single quotes for these attributes
> inside attributes.
>
> 2. again #+CAPTION
>
> if the caption contains a string with /escaped/ underlines (please
> note the #+OPTION ^:t)
>
> ---8<------------------------------------------------------------
> #+OPTIONS: num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:nil
>
> * First paragraph
> #+CAPTION: YYYYMMDD\_hhmmss.csv.
> | head 1 | head2 |
> |-----------+----------|
> | content 1 | content2 |
> ---8<------------------------------------------------------------
>
> The escaped _ is not detected; instead, a literal \ and subscript
> are detected, and teh document is invalid as above. This escaping
> seems not to be mentioned in the documentation, probably because it
> is no longer valid. Might be of interest to people who want to
> convert old documents.
>
> 3. the \ref syntax seems not to work anymore; substituting by \ref{text}
> by [[text]] worked.
>
> 4. Empty lines between #+NAME and the respective table are no longer tolerated
>
> remarks: I like the new smart quotes. More comfortable than putting in
> the utf characters via C-8-RET (which is handy, though, for simple
> formulae).
>
> Regards
>
> Martin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: new odt-exporter: problems with formatting in captions
2013-12-16 13:45 new odt-exporter: problems with formatting in captions Martin Gürtler
2013-12-16 19:09 ` Jambunathan K
@ 2013-12-16 22:31 ` Andreas Leha
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Leha @ 2013-12-16 22:31 UTC (permalink / raw)
To: emacs-orgmode
martin.guertler@gmx.de (Martin Gürtler) writes:
> Hi,
>
> I just converted a 150 page document I used to convert to odt with the old
> exporter. Following problems occurred:
>
> 1. table with #+CAPTION
> If the caption contains formatting (~, ==, _, ^), the exporter
> produces an invalid content.xml.
>
> minimal example:
>
> ---8<------------------------------------------------------------
> #+OPTIONS: num:t toc:nil \n:nil @:t ::t |:t ^:{} -:t f:t *:t <:nil
>
> * First paragraph
> #+CAPTION: A_{1}^{2}
> | head 1 | head2 |
> |-----------+----------|
> | content 1 | content2 |
> ---8<------------------------------------------------------------
>
> The problem can be seen in the following xml fragment:
>
> ---8<------------------------------------------------------------
> <table:table table:style-name="OrgTable"
> table:name="A<text:span
> text:style-name="OrgSubscript">1</text:span><text:span
> text:style-name="OrgSuperscript">2</text:span>">
> ---8<------------------------------------------------------------
>
> The table:name attribute ends prematurely at the "OrgSubscript". This
> could probably be mended by using single quotes for these attributes
> inside attributes.
>
> 2. again #+CAPTION
>
> if the caption contains a string with /escaped/ underlines (please
> note the #+OPTION ^:t)
>
> ---8<------------------------------------------------------------
> #+OPTIONS: num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:nil
>
> * First paragraph
> #+CAPTION: YYYYMMDD\_hhmmss.csv.
> | head 1 | head2 |
> |-----------+----------|
> | content 1 | content2 |
> ---8<------------------------------------------------------------
>
> The escaped _ is not detected; instead, a literal \ and subscript
> are detected, and teh document is invalid as above. This escaping
> seems not to be mentioned in the documentation, probably because it
> is no longer valid. Might be of interest to people who want to
> convert old documents.
>
> 3. the \ref syntax seems not to work anymore; substituting by \ref{text}
> by [[text]] worked.
>
> 4. Empty lines between #+NAME and the respective table are no longer tolerated
>
> remarks: I like the new smart quotes. More comfortable than putting in
> the utf characters via C-8-RET (which is handy, though, for simple
> formulae).
>
> Regards
>
> Martin
Hi Martin,
I think 1-2 are related to an earlier report [fn:1]. As it seems this
is on the todo-list of the right person.
Regards,
Andreas
Footnotes:
[fn:1] http://article.gmane.org/gmane.emacs.orgmode/77937
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: new odt-exporter: problems with formatting in captions
2013-12-16 19:09 ` Jambunathan K
@ 2013-12-18 10:15 ` Martin Gürtler
0 siblings, 0 replies; 4+ messages in thread
From: Martin Gürtler @ 2013-12-18 10:15 UTC (permalink / raw)
To: Jambunathan K; +Cc: emacs-orgmode
>>>>> "J" == Jambunathan K <kjambunathan@gmail.com> writes:
J> NOTE: If someone knows how to accommodate short captions (so that an
J> that an Index/TOC could be generated from within LibreOffice based on
J> it, please let me know.)
The openDocument standard says in 7.4.1
Use Caption
Each object contained in a text document has a name. In addition, images also have a caption.
The image caption or the image name can be gathered for the index of illustrations.
<define name="text-illustration-index-source-attrs" combine="interleave">
<optional>
<attribute name="text:use-caption" a:defaultValue="true">
<ref name="boolean"/>
</attribute>
</optional>
</define>
Looks to me like one should have #+NAME and #+CAPTION in the org file,
I'd consider the former a candidate for the short caption.
HTH,
Martin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-18 10:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-16 13:45 new odt-exporter: problems with formatting in captions Martin Gürtler
2013-12-16 19:09 ` Jambunathan K
2013-12-18 10:15 ` Martin Gürtler
2013-12-16 22:31 ` Andreas Leha
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).