emacs-orgmode
[Top][All Lists]
Advanced

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

Re: How to center an image directly in org-mode (without exporting)


From: Ihor Radchenko
Subject: Re: How to center an image directly in org-mode (without exporting)
Date: Fri, 04 Nov 2022 04:54:32 +0000

Cletip Cletip <clement020302@gmail.com> writes:

> My problem is quite simple to understand: when I activate
> "org-toggle-inline-images", I would like my images to be centered. Indeed,
> I tried this in a org-file
>
> #+ATTR_ORG: :width 800 :center t
>
> [[file:images/anImage.png]]
>
>
> But it obviously doesn't work.

AFAIK, there is no easy way to do this, especially if you want the
centering to be preserved on resize.

> Does anyone have a tip?
>
> (I'm thinking of creating a function that, each time the size of the window
> changes, readjusts the number of spaces to put so that my image is
> centered. It's not a very clean solution, but could it work?)

What you are thinking is probably the only sane way. Though you do not
have to insert actual spaces. May instead use display property. See
40.16.3 Pixel Specification for Spaces section of Elisp manual.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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