Hi Matt,

> Unfortunately, I think this makes a valid use case
> impossible. Specifically, I like to be able to set an image width
> explicitly with #+attr_org (or some other attr_ for the corresponding
> export) and fall back to the actual image width when this isn’t
> specified. This includes the ability to use the actual image width in an
> org buffer, but an explicitly-set image width for export. For example,
> for my blog I often have attr_html set, but I want the image to use its
> actual width when displayed in org.

Thanks for explaining a use case! That’s most helpful.

> I don’t see how this is possible with the current implementation.But, it
> works naturally with the implementation I have in mind

Actually, it’s almost possible with the current implementation. Consider this
example:
┌────
│ #+attr_org: :width t
│ #+attr_html: :width 20%
│ [[file:image.png]]
└────

At the moment Org tries to interpret `t' as a number (and obviously fails),
however with a small tweak that I think would be very reasonable to make, this
would cause the behaviour you describe.

What do you think?

> (IIRC this is how it previously worked, but I could be mistaken).

You are mistaken. The previous implementation looked for `#+attr_*' too, but
didn’t recognise proportional values.

> Maybe a solution to accomplish all goals would be to add an #+attr_fallback
> (or attr_default, attr_any, attr_all, etc.) that is used for any backend
> unless a specific setting is made for that backend.

Hmmm, I’m not sure this is called for.

All the best,
Timothy

Reply via email to