emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG][ODT] Subtree export fails when link references target on higher level
@ 2013-11-21 21:33 Christian Moe
  2013-11-21 22:51 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Moe @ 2013-11-21 21:33 UTC (permalink / raw)
  To: Emacs-orgmode; +Cc: Nicolas Goaziou


The two examples below illustrate an odd ODT export failure that occurs in
restricted circumstances: only when the target of the link is on a
higher level of the tree than the link. 

* This fails

** A subheader

This paragraph is bookmarked. <<target1>> 

When I try to export this subtree to ODT (`C-c C-e C-s o O' at point), I get
: user-error: No such file: /Users/CM/org/OpenDocument export failed: FIXME?

*** A sub-subheader

Here's a ref to the bookmark at [[target1]].

* This works

Here, I reverse the positions of reference and target from the first example.

** A subheader

Here's a ref to the bookmark at [[target2]].

I can do subtree export from here with no problem.

*** A sub-subheader

This paragraph is bookmarked. <<target2>>

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

* Re: [BUG][ODT] Subtree export fails when link references target on higher level
  2013-11-21 21:33 [BUG][ODT] Subtree export fails when link references target on higher level Christian Moe
@ 2013-11-21 22:51 ` Nicolas Goaziou
  2013-11-22  8:04   ` Christian Moe
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-11-21 22:51 UTC (permalink / raw)
  To: Christian Moe; +Cc: Emacs-orgmode

Hello,

Christian Moe <mail@christianmoe.com> writes:

> The two examples below illustrate an odd ODT export failure that occurs in
> restricted circumstances: only when the target of the link is on a
> higher level of the tree than the link. 
>
> * This fails
>
> ** A subheader
>
> This paragraph is bookmarked. <<target1>> 
>
> When I try to export this subtree to ODT (`C-c C-e C-s o O' at point), I get
> : user-error: No such file: /Users/CM/org/OpenDocument export failed: FIXME?
>
> *** A sub-subheader
>
> Here's a ref to the bookmark at [[target1]].

In this case, <<target1>> doesn't belong to any headline. What is the
expected output for [[target]]?


Regards,

-- 
Nicolas Goaziou

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

* Re: [BUG][ODT] Subtree export fails when link references target on higher level
  2013-11-21 22:51 ` Nicolas Goaziou
@ 2013-11-22  8:04   ` Christian Moe
  2013-11-22  8:09     ` Nicolas Goaziou
  2013-11-25  9:49     ` Jambunathan K
  0 siblings, 2 replies; 8+ messages in thread
From: Christian Moe @ 2013-11-22  8:04 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode


Nicolas Goaziou writes:

> Hello,
>
> Christian Moe <mail@christianmoe.com> writes:
>
>> The two examples below illustrate an odd ODT export failure that occurs in
>> restricted circumstances: only when the target of the link is on a
>> higher level of the tree than the link. 
>>
>> * This fails
>>
>> ** A subheader
>>
>> This paragraph is bookmarked. <<target1>> 
>>
>> When I try to export this subtree to ODT (`C-c C-e C-s o O' at point), I get
>> : user-error: No such file: /Users/CM/org/OpenDocument export failed: FIXME?
>>
>> *** A sub-subheader
>>
>> Here's a ref to the bookmark at [[target1]].
>
> In this case, <<target1>> doesn't belong to any headline. What is the
> expected output for [[target]]?

Oh... right. But in that case, the output should be "No description for
this link", as happens with HTML export. More helpful and informative
than an export failure.

In ODT, the link can be useful anyway, as the ODT output is a reference
field that can be automatically updated to a different format, e.g. to
refer to a page number instead of the (missing) headline text.

Yours,
Christian

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

* Re: [BUG][ODT] Subtree export fails when link references target on higher level
  2013-11-22  8:04   ` Christian Moe
@ 2013-11-22  8:09     ` Nicolas Goaziou
  2013-11-22  9:08       ` Christian Moe
  2013-11-25  9:49     ` Jambunathan K
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-11-22  8:09 UTC (permalink / raw)
  To: Christian Moe; +Cc: Emacs-orgmode

Hello,

Christian Moe <mail@christianmoe.com> writes:

> In ODT, the link can be useful anyway, as the ODT output is a reference
> field that can be automatically updated to a different format, e.g. to
> refer to a page number instead of the (missing) headline text.

I don't know ODT syntax, but if you provide that useful syntax in this
case, I can add it to ox-odt.el.


Regards,

-- 
Nicolas Goaziou

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

* Re: [BUG][ODT] Subtree export fails when link references target on higher level
  2013-11-22  8:09     ` Nicolas Goaziou
@ 2013-11-22  9:08       ` Christian Moe
  2013-11-22  9:42         ` Nicolas Goaziou
  2013-11-22 11:19         ` Dan Griswold
  0 siblings, 2 replies; 8+ messages in thread
From: Christian Moe @ 2013-11-22  9:08 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode, Christian Moe

Hi,

What I described already works out of the box, as long as a bookmark and
cross-reference are generated. In LibreOffice, you can then right-click
on the field of the cross-reference to display e.g. the target's chapter
heading number or page number instead of a textual description.

But on reflection, I think there's a strong case to change the default
ODT output of links with dedicated targets to page number
references. Under the new exporter, such <<targets>> are hidden in
output, i.e. they no longer contain text that will serve as a
description, and as shown by my example they may not always belong to a
heading. But in an ODT document they will always belong to a page, and
page number references would be a customary choice for printed media.

If that sounds reasonable I'll send a mini-patch later today.

Yours,
Christian



Nicolas Goaziou writes:

> Hello,
>
> Christian Moe <mail@christianmoe.com> writes:
>
>> In ODT, the link can be useful anyway, as the ODT output is a reference
>> field that can be automatically updated to a different format, e.g. to
>> refer to a page number instead of the (missing) headline text.
>
> I don't know ODT syntax, but if you provide that useful syntax in this
> case, I can add it to ox-odt.el.
>
>
> Regards,

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

* Re: [BUG][ODT] Subtree export fails when link references target on higher level
  2013-11-22  9:08       ` Christian Moe
@ 2013-11-22  9:42         ` Nicolas Goaziou
  2013-11-22 11:19         ` Dan Griswold
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2013-11-22  9:42 UTC (permalink / raw)
  To: Christian Moe; +Cc: Emacs-orgmode

Hello,

Christian Moe <mail@christianmoe.com> writes:

> But on reflection, I think there's a strong case to change the default
> ODT output of links with dedicated targets to page number
> references. Under the new exporter, such <<targets>> are hidden in
> output, i.e. they no longer contain text that will serve as a
> description, and as shown by my example they may not always belong to a
> heading. But in an ODT document they will always belong to a page, and
> page number references would be a customary choice for printed media.
>
> If that sounds reasonable I'll send a mini-patch later today.

You seem to forget a use-case here: when the target belongs to an item,
[[target1]] returns its number. Displaying the page, albeit correct,
would be less interesting in that situation.

Also, that would introduce an incompatibility with every other major
back-end. At the moment, the compatible way to handle it would just be
to ignore [[target1]] altogether (and keep section/list/whatever number
for other calls).

What do you think?


Regards,

-- 
Nicolas Goaziou

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

* Re: [BUG][ODT] Subtree export fails when link references target on higher level
  2013-11-22  9:08       ` Christian Moe
  2013-11-22  9:42         ` Nicolas Goaziou
@ 2013-11-22 11:19         ` Dan Griswold
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Griswold @ 2013-11-22 11:19 UTC (permalink / raw)
  To: Christian Moe; +Cc: Emacs-orgmode, Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 932 bytes --]

On Fri, Nov 22, 2013 at 4:08 AM, Christian Moe <mail@christianmoe.com>wrote:

> Hi,
>
> But on reflection, I think there's a strong case to change the default
> ODT output of links with dedicated targets to page number
> references. Under the new exporter, such <<targets>> are hidden in
> output, i.e. they no longer contain text that will serve as a
> description, and as shown by my example they may not always belong to a
> heading. But in an ODT document they will always belong to a page, and
> page number references would be a customary choice for printed media
>

I can say that this describes my typical needs very well. I have a project
with a fair number of targets (at least 26) that all will be referred to by
page number. Like this:

<<this target>

.
.
.

See above, on p. [[this target]].


I don't know if mine would be the odd or typical use. But it is what I am
needing.

Gratefully,

Dan Griswold
Rochester, NY

[-- Attachment #2: Type: text/html, Size: 1413 bytes --]

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

* Re: [BUG][ODT] Subtree export fails when link references target on higher level
  2013-11-22  8:04   ` Christian Moe
  2013-11-22  8:09     ` Nicolas Goaziou
@ 2013-11-25  9:49     ` Jambunathan K
  1 sibling, 0 replies; 8+ messages in thread
From: Jambunathan K @ 2013-11-25  9:49 UTC (permalink / raw)
  To: Christian Moe; +Cc: Emacs-orgmode, Nicolas Goaziou

Christian Moe <mail@christianmoe.com> writes:

> In ODT, the link can be useful anyway, as the ODT output is a
> reference field that can be automatically updated to a different
> format, e.g. to refer to a page number instead of the (missing)
> headline text.

When using page numbers, one may have to use "Update Fields" - an
extraneous step - to have a consistent doc.

With the use of section numbers, the extraneous step and the
inconsistency are altogether avoided.  Remember the "section numbers"
are computed by ODT exporter by hand (i.e., these section numbers are
NOT "auto-magically" plugged in by LibreOffice.)

It is more important to have a consistent document.  So, use of page
numbers can be an configurable option.  It should NOT be the default
option.  When using page numbers, please mention in the docstring/manual
that updating of fields is a user responsibility.

----------------------------------------------------------------

A potential patch will touch `org-odt-label-styles' and
`org-odt-category-map-alist' or steal significantly from these
variables.

----------------------------------------------------------------

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

end of thread, other threads:[~2013-11-25  9:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21 21:33 [BUG][ODT] Subtree export fails when link references target on higher level Christian Moe
2013-11-21 22:51 ` Nicolas Goaziou
2013-11-22  8:04   ` Christian Moe
2013-11-22  8:09     ` Nicolas Goaziou
2013-11-22  9:08       ` Christian Moe
2013-11-22  9:42         ` Nicolas Goaziou
2013-11-22 11:19         ` Dan Griswold
2013-11-25  9:49     ` Jambunathan K

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).