From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 8D10F8F0gWeOWAAAe85BDQ:P1 (envelope-from ) for ; Fri, 10 Jan 2025 19:28:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8D10F8F0gWeOWAAAe85BDQ (envelope-from ) for ; Fri, 10 Jan 2025 20:28:01 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DUgNj5of; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736537281; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zLSY/N3RV3UvVwvYmFy028gx+9sBexnF5IAgl8iTgtY=; b=c2wTd7ATkv2KYER5tcRwIzCtoYYKLYD6wzuHTQavl3Tt1P0i9059VgNbwE3ho3s/7IMdhK cxDf2q9+qrDVHjznNnKT9Zm7hrGUJXi4jg5XnGDd6Ks+VUtVS3+tOtKG+QP1DPxGbdaS4H oWwG1BwMpHOGZO8B2ESF/kgAYqOJ4b0tPQMpe/nEmhrUkCvs80nLSj7S/vVgp0NvBivbNP uHNnFJTbLMZtMMvHmVv16a19ce2MyRIEvjKlJe5IMjlE/6dft+u3mI2WQNDguC6KoS7W6j QJaNVzDOPuWraqUvkSCNWI2gF9h7E1XmUFn5D1vlPLlP68cXIZNxBSpsa9CaRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DUgNj5of; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736537281; a=rsa-sha256; cv=none; b=XAN/zzKQdnbWkF3jiWoj2qXlkapTu/aA+cyjCa08waklkmAe2iPA8OVJd8RhWmnBZ1VLVr ABFlMfdiGxNV1ipLbOVNaG5HNQ+UhDadFcE2/d92b0o0ADZc8VZRg7cyZ8zAxGlOzjS+Mg +9PCq2F8nnIuSKqyiq6g7eVWBI2MOL6wH7iUfI0MKHLh0iY6ffVM/D8gSbBVvSOv4eVqDJ EgoSy1z95yJ38F2qW8a1iYJMNANfDhML+QrJOC/x1hWhWC7i5mRcttPn7+xUn5DNVQIENS R+8vqjd1mApVUwazjT5g6CTWY5Ipq4R72kra+TfmKrynxxFPOyvQoGyGuoQZrQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 18F7C33A72 for ; Fri, 10 Jan 2025 20:28:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWK8O-0006eU-FD; Fri, 10 Jan 2025 13:53:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWK7v-00066X-LR for emacs-orgmode@gnu.org; Fri, 10 Jan 2025 13:53:09 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWK7p-0001zL-PM for emacs-orgmode@gnu.org; Fri, 10 Jan 2025 13:52:58 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 55F67240101 for ; Fri, 10 Jan 2025 19:52:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1736535171; bh=m1xTAIdZiEA+o9HbCm+5z/aWeqqmIw+BlU3IjQDojdY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=DUgNj5ofwbTc3lc0QRYuLmGLXdHSJeufOMYil8jJW5Dqnp/Lz9pmsV6xIAuodp4bR pXYWVpquO8w832ISiWf37cA5CrGEK52JCZJMmPPCb7DJF7XOXrax7cRGGR93vnRdaq 6IiOQwHeUIet7GpbwTfkxFsdXV0f0L+OzChDo41oKBNW88Yn+eQpskeR38Qe5K9YCu 9V3z/PDitYXdk/2l7Xnj+D20MNbVfm9zxo0mqA3JuV5Nqsqn6ux7QJnGPyiD7dtwyj FFDe1vkh63IqMFl99ej4ZsSDRU+/2Bl81Wy68GFybar0HN2E3oJC/evBrqmcMJ8M4F L6YshJOUSsH/g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YV9l66yzcz9rxD; Fri, 10 Jan 2025 19:52:50 +0100 (CET) From: Ihor Radchenko To: Karthik Chikmagalur Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Edge case for preview image alignment In-Reply-To: <87ed1br7la.fsf@gmail.com> References: <87ed1br7la.fsf@gmail.com> Date: Fri, 10 Jan 2025 18:55:11 +0000 Message-ID: <8734hqebxs.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.73 X-Spam-Score: -5.73 X-Migadu-Queue-Id: 18F7C33A72 X-TUID: UU7/Ea5uk0FN Karthik Chikmagalur writes: > Currently the value of `org-image-align' or of the `:align' attr_* > keyword is respected when previewing images in the following two > situations: > > 1. Image link in its own paragraph: > > #+attr_org: :align center > [[file:/path/to/image.png]] > > 2. Image link at the end of a paragraph, on its own line: > > Some text in a paragraph > #+attr_org: :align center > [[file:/path/to/image.png]] These two situations are the same - standalone image in a paragraph. The second example is _two_ paragraphs. (affiliated keywords force-start a new paragraph) > OR > > Some text in a paragraph > [[file:/path/to/image.png]] This will be ignored. > But it is ignored when the > > 3. image link is on its own line "inside" a paragraph: > > Some text in a paragraph > #+attr_org: :align center > [[file:/path/to/image.png]] > followed by more text in the paragraph. This is the same as just #+attr_org: :align center [[file:/path/to/image.png]] followed by more text in the paragraph. > In contrast, the value of `org-image-max-width', > `org-image-actual-width' (and the attr_* :width attribute) are respected > in all three cases. 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. > 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" 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. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at