emacs-orgmode
[Top][All Lists]
Advanced

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

[PATCH]


From: Timothy
Subject: [PATCH]
Date: Sun, 26 Sep 2021 19:51:15 +0800
User-agent: mu4e 1.6.5; emacs 28.0.50

Hi Everyone,

I’ve recently been wondering why it is that for sensibly sized images in a LaTeX-export-oriented document I need to do both:

#+attr_org: :width 400
#+attr_latex: :width 0.4\linewidth

When in HTML, just

#+attr_html: :width 400px

is fine.

This has lead me to have a look at org-display-inline-images, and I’ve realised that the #+attr_latex width of 0.4\linewidth is actually picked up, and interpreted as a width of 0.4 pixels. I think it would make much more sense for fractional values between zero and one to be interpreted as that portion of the text width in the buffer. On second thoughts, given that the document width can be slightly larger than the text width, perhaps an upper bound just a bit higher — say 2, could be better.

I’ve prepared a patch which implements this logic, by converting extracted widths that are:

and sizes them as that proportion of the text width in the buffer, which is determined by checking

  1. visual-fill-column-width, when that package is installed and the mode active
  2. fill-column, when auto fill is active
  3. (window-text-width), if neither of the above two cases hold

Please let me know what you think 🙂.

All the best,
Timothy

Attachment: 0001-org-Display-proportional-image-widths.patch
Description: Text Data


reply via email to

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