emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Edge case for preview image alignment
Date: Mon, 13 Jan 2025 10:17:36 -0800	[thread overview]
Message-ID: <87o70azigv.fsf@gmail.com> (raw)
In-Reply-To: <8734hqebxs.fsf@localhost>

>> Currently the value of `org-image-align' or of the `:align' attr_*
>> keyword is respected when previewing images in the following two
>> situations:
>>
>> [...]
>>
>
> These two situations are the same - standalone image in a paragraph.
> The second example is _two_ paragraphs. (affiliated keywords force-start
> a new paragraph)

Thanks for the clarification.

> Sure. Because it works for both inline and standalone images, unlike
> org-image-align:
>
>     org-image-align is a customizable variable defined in ol.el.
>     ...
>     Documentation
>     How to align images previewed using org-link-preview-region.
>     
>     Only stand-alone image links are affected by this setting.  These
>     are links without surrounding text.

I'm aware that only standalone image links are supported -- my question
was if we should change this behavior.

>> Should we support image alignment in case 3?
>>
>> The only situation in which I can see this being undesirable is when you
>> have hard-wrapped/filled lines and the image link coincidentally ends up
>> on its own line.  In this case it doesn't make sense for the image
>> preview to respect `org-image-align'.  There might be other syntactical
>> reasons why supporting case 3 doesn't make sense, so I am asking here.
>
> Maybe. Or not.
>
> Alignment is intersecting its syntax with export.
> But export will only align truly standalone images.
> There will be no notion of "image in a line of its own in the middle of
> paragraph"

This is another factor I hadn't considered.

> Also, what would you do if there are multiple images like that or when
> the purpose of :align attribute is to align the whole paragraph?
>
> Consider something like
>
> # Align the whole paragraph
> #+attr_html: :align center
> Paragraph with inlined
> [[file:image.png]]
> image and
> [[file:image2.png]]
> another one.

In this case no alignment rule would be applied to the image.

I didn't realize that

Some text in a paragraph,
#+attr_org: :align center
[[file:/path/to/file]]
followed by more text

is considered two paragraphs, and that the affiliated keyword applies to
the second paragraph and not just the link at the start of the second
paragraph.  So my proposal isn't consistent.

Please close this bug/issue.

Karthik


  reply	other threads:[~2025-01-13 18:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 21:38 [BUG] Edge case for preview image alignment Karthik Chikmagalur
2025-01-10 18:55 ` Ihor Radchenko
2025-01-13 18:17   ` Karthik Chikmagalur [this message]
2025-01-13 18:48     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o70azigv.fsf@gmail.com \
    --to=karthikchikmagalur@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).