emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix regex for determining image width from attribute


From: Max Nikulin
Subject: Re: [PATCH] Fix regex for determining image width from attribute
Date: Wed, 8 May 2024 17:36:08 +0700
User-agent: Mozilla Thunderbird

On 02/05/2024 23:28, Ihor Radchenko wrote:

1. #+attr_org is prioritised

I ma afraid, the code is a bit fragile. Consider

#+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.
- It is really confusing that #+attr_html casts shadow on #+attr_md.

+++ b/etc/ORG-NEWS
@@ -13,6 +13,18 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
* Version 9.7 (not released yet)
 ** 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
+first =#+attr_...= keyword containing =:width ...= to compute the inline
+image width:
+
+: #+attr_html: :width 30%
+: #+attr_org:  :width is ignored
+: [[image.png]]
+
+Now, =#+attr_org=, if present, takes precedence.

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

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.
Now, =#+attr_org=, if present, takes precedence.
In the following example the image preview has width of 70%
while earlier versions take 33%.

: #+attr_html: :width 33%
: #+attr_org:  :width 0.7
: [[image.png]]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]