emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* odt-Export and #+CAPTION: [reference text]{caption text}
@ 2012-03-29  6:39 Martin Gürtler
  2012-03-29 19:34 ` Jambunathan K
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Gürtler @ 2012-03-29  6:39 UTC (permalink / raw)
  To: Jambunathan K; +Cc: org-mode mailing list

Hi,

does the odt export regard the short version of captions for figures and
tables? Looking at the document structure in libreoffice's navigator,
figures and tables are referenced by strings like "Table4" or, in the
case of graphics, plain numbers. Also, when I include manually (in
libreoffice) a list if figures or tables, the entries are described by
the long version of the caption, regardless of the choice between
'reference text' and 'caption' in the properties of the 'List of figures
(tables)' in libreoffice.


org documentation says

Optionally, the caption can take the form:
  #+CAPTION: [Caption for list of figures]{Caption for table (or link).}

, but this seems to be unsupported in the moment. 

Regards,

Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-29  6:39 odt-Export and #+CAPTION: [reference text]{caption text} Martin Gürtler
@ 2012-03-29 19:34 ` Jambunathan K
  2012-03-30  6:08   ` Martin Gürtler
  2012-03-30  6:27   ` odt-export: localisation of table and figure captions and references to chapter numbers Martin Gürtler
  0 siblings, 2 replies; 10+ messages in thread
From: Jambunathan K @ 2012-03-29 19:34 UTC (permalink / raw)
  To: Martin Gürtler; +Cc: org-mode mailing list


Martin

> Hi,
>
> does the odt export regard the short version of captions for figures and
> tables? Looking at the document structure in libreoffice's navigator,
> figures and tables are referenced by strings like "Table4" or, in the
> case of graphics, plain numbers. Also, when I include manually (in
> libreoffice) a list if figures or tables, the entries are described by
> the long version of the caption, regardless of the choice between
> 'reference text' and 'caption' in the properties of the 'List of figures
> (tables)' in libreoffice.
>
>
> org documentation says
>
> Optionally, the caption can take the form:
>   #+CAPTION: [Caption for list of figures]{Caption for table (or link).}
>
> , but this seems to be unsupported in the moment. 


May be you are trying to build an index out of object names... Or pick
and choose objects of interest.  Please upgrade to the following commit
and report back any problems or suggestions.

I have pushed the commit to master branch.  If you are quick enough with
your feedback, I can commit this change to hotfix-7.8.06 branch so that
it can reach Emacs-24.1.

,----
| commit 67694297fa0f9b32cf4bfe812ba8a5c5cf4a0859
| Author: Jambunathan K <kjambunathan@gmail.com>
| Date:   Fri Mar 30 00:30:46 2012 +0530
| 
|     org-odt.el: Honor short caption for table, figure etc
`----

Btw, any feedback on these two fixes?

http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00798.html
http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00797.html

> Regards,
>
> Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-29 19:34 ` Jambunathan K
@ 2012-03-30  6:08   ` Martin Gürtler
  2012-03-30 13:08     ` Jambunathan K
  2012-03-30  6:27   ` odt-export: localisation of table and figure captions and references to chapter numbers Martin Gürtler
  1 sibling, 1 reply; 10+ messages in thread
From: Martin Gürtler @ 2012-03-30  6:08 UTC (permalink / raw)
  To: Jambunathan K; +Cc: org-mode mailing list

Hi Jambunathan, 

thanks for the quick help.

Am Freitag, den 30.03.2012, 01:04 +0530 schrieb Jambunathan K:

> May be you are trying to build an index out of object names... Or pick
> and choose objects of interest.  Please upgrade to the following commit
> and report back any problems or suggestions.
> 
> I have pushed the commit to master branch.  If you are quick enough with
> your feedback, I can commit this change to hotfix-7.8.06 branch so that
> it can reach Emacs-24.1.
> 

I just pulled from orgmode.org.

It does what I want. Unless there is some formatting in the caption.
Then you get an invalid content.xml, even if you don't use the new
feature (ie with a simple '#+CAPTION: a_i').

minimal example:

#+CAPTION: [*a_i*]{a_i is named =A\_i=}
#+LABEL: tab:referenced table
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |
 
Best regards,

Martin

> ,----
> | commit 67694297fa0f9b32cf4bfe812ba8a5c5cf4a0859
> | Author: Jambunathan K <kjambunathan@gmail.com>
> | Date:   Fri Mar 30 00:30:46 2012 +0530
> | 
> |     org-odt.el: Honor short caption for table, figure etc
> `----
> 
> Btw, any feedback on these two fixes?
> 
> http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00798.html
> http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00797.html
> 
> > Regards,
> >
> > Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* odt-export: localisation of table and figure captions and references to chapter numbers
  2012-03-29 19:34 ` Jambunathan K
  2012-03-30  6:08   ` Martin Gürtler
@ 2012-03-30  6:27   ` Martin Gürtler
  1 sibling, 0 replies; 10+ messages in thread
From: Martin Gürtler @ 2012-03-30  6:27 UTC (permalink / raw)
  To: Jambunathan K; +Cc: org-mode mailing list

Am Freitag, den 30.03.2012, 01:04 +0530 schrieb Jambunathan K:

> Btw, any feedback on these two fixes?
> 
> http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00798.html
> http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00797.html
> 

I am just using both, localisation and the numbering. No problems so
far.

What might be confusing is the different syntax/appearance of references
in the org file. Figures and tables in my documents look
\ref{fig:some_figure}, while references to sections appear as
id:12adea34-13124123-12341234. Or can headlines also carry #+LABEL:s?

Best regards,

Martin



> > Regards,
> >
> > Martin
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-30  6:08   ` Martin Gürtler
@ 2012-03-30 13:08     ` Jambunathan K
  2012-03-30 14:47       ` Martin Gürtler
  2012-03-30 14:49       ` Jambunathan K
  0 siblings, 2 replies; 10+ messages in thread
From: Jambunathan K @ 2012-03-30 13:08 UTC (permalink / raw)
  To: Martin Gürtler; +Cc: org-mode mailing list


> It does what I want. 
I have applied my patch to the hotfix branch.

> Unless there is some formatting in the caption.

This is a limitation that we need to live with.  

That said, if you want the short captions in bold, then the right thing
to do would be to apply the style to the index entry and not to
individual captions.  Have you experimented with the styles tab in the
Index creator...I haven't checked it myself though.

> Then you get an invalid content.xml, even if you don't use the new
> feature (ie with a simple '#+CAPTION: a_i').

> minimal example:
>
> #+CAPTION: [*a_i*]{a_i is named =A\_i=}
> #+LABEL: tab:referenced table
> | a | b | c |
> |---+---+---|
> | 1 | 2 | 3 |

If you unzip the file you will see that the short caption goes as an
attribute while long caption goes as body text.

LibreOffice doesn't even allow entering space in the object names.  If
you know of any workarounds that will help "mimic" short captions, I can
add it.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-30 13:08     ` Jambunathan K
@ 2012-03-30 14:47       ` Martin Gürtler
  2012-03-30 14:52         ` Jambunathan K
  2012-03-30 14:49       ` Jambunathan K
  1 sibling, 1 reply; 10+ messages in thread
From: Martin Gürtler @ 2012-03-30 14:47 UTC (permalink / raw)
  To: Jambunathan K; +Cc: org-mode mailing list

Hi Jambunathan,

Am Freitag, den 30.03.2012, 18:38 +0530 schrieb Jambunathan K:
> > It does what I want. 
> I have applied my patch to the hotfix branch.
> 
> > Unless there is some formatting in the caption.
> 
> This is a limitation that we need to live with.  

(Unfortunately, this seems to be so for super/subscripts as well.)

I just found out that now the exporter depends on supplying a short
caption, if the caption contains formatting (which also means
subscripts). If you just give it one version (ala #+CAPTION: a_i), and
the caption contains ,say, a subscript, content.xml becomes invalid. It
works only, if you supply it in the form #+CAPTION: []{a_i}. (Probably,
you take the long versionalso for the short one, if only one is
supplied.) I think this should be fixed as it could break existing
documents.

Regards,

Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-30 13:08     ` Jambunathan K
  2012-03-30 14:47       ` Martin Gürtler
@ 2012-03-30 14:49       ` Jambunathan K
  2012-03-30 20:41         ` Jambunathan K
  1 sibling, 1 reply; 10+ messages in thread
From: Jambunathan K @ 2012-03-30 14:49 UTC (permalink / raw)
  To: Martin Gürtler; +Cc: org-mode mailing list


> I have applied my patch to the hotfix branch.

I am having second thoughts.  I will slightly re-work the patch so it
doesn't bomb the ODT file in unexpected ways.  I will drop a note once I
am done with it.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-30 14:47       ` Martin Gürtler
@ 2012-03-30 14:52         ` Jambunathan K
  0 siblings, 0 replies; 10+ messages in thread
From: Jambunathan K @ 2012-03-30 14:52 UTC (permalink / raw)
  To: Martin Gürtler; +Cc: org-mode mailing list

Martin Gürtler <martin.guertler@gmx.de> writes:

> (Probably,
> you take the long versionalso for the short one, if only one is
> supplied.) I think this should be fixed as it could break existing
> documents.

Our mails crossed and we have arrived at the same conclusion.  Give me
few hours to fix it.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-30 14:49       ` Jambunathan K
@ 2012-03-30 20:41         ` Jambunathan K
  2012-03-31  8:41           ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Jambunathan K @ 2012-03-30 20:41 UTC (permalink / raw)
  To: Martin Gürtler; +Cc: org-mode mailing list

Jambunathan K <kjambunathan@gmail.com> writes:

>> I have applied my patch to the hotfix branch.
>
> I am having second thoughts.  I will slightly re-work the patch so it
> doesn't bomb the ODT file in unexpected ways.  I will drop a note once I
> am done with it.

Short captions if not provided will take their values from long caption.
See the commit message for more information.

I am not checking in this change to hotfix-7.8.06 branch.  If it bombs
again and someone else complains, I will revoke the fix.

If you need index entries to be in bold, fix the paragraph style.

Btw, I wonder why LibreOffice UI doesn't allow space (apart from other
characters) in the object names. The OpenDocument v1.1 explicitly has
the following example and as you can see the table name has spaces.
Anyways, looks like LibreOffice behaviour is buggy.

,----
| <table:table table:name="Table 1" table:style-name="Table 1">
| ...
| </table:table>
`----

,----
| commit 8a02f48547df4f11b0402aa0a4fe339e3b85c608
| Author: Jambunathan K <kjambunathan@gmail.com>
| Date:   Sat Mar 31 02:03:10 2012 +0530
| 
| org-odt.el: Consider short captions not as org text but as plain text
| 
| * lisp/org-lparse.el (org-lparse-insert-org-table): Consider
| short caption as plain text and not as org text.
| * lisp/org-odt.el (org-export-odt-format-formula)
| (org-export-odt-format-image): ditto.
| 
| Fixes earlier checkin.  See
| http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg01212.html
| 
| Handling of short captions is only a convenience feature.
| 
| From within LibreOffice one can always create an "unprotected"
| editable index and later manually delete unwanted index entries (for
| example, delete uncaptioned entries which are given automatic names)
| or modify existing entries (for example, fix long captions to their
| short versions).
`----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: odt-Export and #+CAPTION: [reference text]{caption text}
  2012-03-30 20:41         ` Jambunathan K
@ 2012-03-31  8:41           ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2012-03-31  8:41 UTC (permalink / raw)
  To: Jambunathan K; +Cc: org-mode mailing list, Martin Gürtler

Jambunathan K <kjambunathan@gmail.com> writes:

> Jambunathan K <kjambunathan@gmail.com> writes:
>
>>> I have applied my patch to the hotfix branch.

Thanks for the diligent action taken Jambunathan.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-31  9:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29  6:39 odt-Export and #+CAPTION: [reference text]{caption text} Martin Gürtler
2012-03-29 19:34 ` Jambunathan K
2012-03-30  6:08   ` Martin Gürtler
2012-03-30 13:08     ` Jambunathan K
2012-03-30 14:47       ` Martin Gürtler
2012-03-30 14:52         ` Jambunathan K
2012-03-30 14:49       ` Jambunathan K
2012-03-30 20:41         ` Jambunathan K
2012-03-31  8:41           ` Bastien
2012-03-30  6:27   ` odt-export: localisation of table and figure captions and references to chapter numbers Martin Gürtler

Code repositories for project(s) associated with this 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).