On 08/05/2024 17:54, Ihor Radchenko wrote:
Max Nikulin writes:

#+attr_html: :alt Image width test
#+attr_beamer: :width \linewidth
#+attr_latex: :width +.5\textwidth
#+attr_md: :width 75%
[[file:babelfish.png]]

- I do not mind that just "\linewidth" is ignored.
- The case of "+.5" should either be supported or at least documented
since it is a valid floating number.

Was it supported before?

No. It is my expectation based on earlier discussions that fractional numbers were added namely for LaTeX. I used leading dot in \includegraphics[width=...]{}, so I was surprised that Org ignores it. Explicit "+" is just generalization, this form is supported by LaTeX and elisp.

- It is really confusing that #+attr_html casts shadow on #+attr_md.

No, it is not. I see no reason to prioritize markdown attributes.

Above #+attr_html does not specify :width while #+attr_md has a valid value. It is the reason why I do like current behavior.

+++ b/etc/ORG-NEWS

I think, it is better to avoid "is ignored" here.

May you convert your suggestion into a patch?

See the attachment.
From 7bc9d909867bf2f99a77d5d1554cd41e4fc664ae Mon Sep 17 00:00:00 2001
From: Max Nikulin <maniku...@gmail.com>
Date: Thu, 9 May 2024 17:32:54 +0700
Subject: [PATCH] ORG-NEWS: Reword inline image width note

* etc/ORG-NEWS: Avoid possible confusion related to
"#+attr_org: :width" example.
---
 etc/ORG-NEWS | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 3c597db40..a34307295 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -15,16 +15,16 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 ** Important announcements and breaking changes
 *** Inline image width value in =#+attr_org= is preferred over other =#+attr_...= keywords
 
-Previously, when ~org-image-actual-width~ is a list, Org used the
+Previously, when ~org-image-actual-width~ is a list or nil, Org used the
 first =#+attr_...= keyword containing =:width ...= to compute the inline
-image width:
+image width.  Now, =#+attr_org=, if present, takes precedence.
+In the following example the image preview has width of 75%
+while earlier versions pick 33%.
 
-: #+attr_html: :width 30%
-: #+attr_org:  :width is ignored
+: #+attr_html: :width 33%
+: #+attr_org:  :width 0.75
 : [[image.png]]
 
-Now, =#+attr_org=, if present, takes precedence.
-
 *** =ox-html=: When exporting footnotes with custom non-number names, the names are used as link anchors
 
 Previously, link anchors for footnote references and footnote
-- 
2.39.2

Reply via email to