From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WGGVAQKbZGOTXAAAbAwnHQ (envelope-from ) for ; Fri, 04 Nov 2022 05:54:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WL+1AAKbZGOm0AAAG6o9tA (envelope-from ) for ; Fri, 04 Nov 2022 05:54:26 +0100 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 A7E243A649 for ; Fri, 4 Nov 2022 05:54:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqoiM-0005NQ-59; Fri, 04 Nov 2022 00:53:58 -0400 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 1oqoiL-0005N7-3Y for emacs-orgmode@gnu.org; Fri, 04 Nov 2022 00:53:57 -0400 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 1oqoiI-0000BE-TK for emacs-orgmode@gnu.org; Fri, 04 Nov 2022 00:53:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 92E45240103 for ; Fri, 4 Nov 2022 05:53:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667537633; bh=OUv2OfLYozA7s+QS8qHixZ2ZnzIJU3HRGq3QbDr8GnE=; h=From:To:Cc:Subject:Date:From; b=UK/G531w8kRJ7LiYo10Dx7PrfhFQMeztHesdVfHJbvPYwTBodlmar252KHTzOMwfW Co3jDwEqI3wc7voHw2a8LJPznWXSM/xdWfjExS3HHuBsM137mcReV543D1+arpl+bS 3tPrrRxpD8xop5XaBSkv5HWBuxQK4Hj09GHkmUXCDUoNnSFI8qq7EddYDXvH2KJuzV pmHDg0cx94UAxi6GnE3vXASn0aecp5lBs9cJez4nw9WPJmutkWLnDfIKVikFL0muyD r9ms8UPHvGB/LIrwwOR4/3dfhakGOrNSflmub/71vBFaJogrcU13NBV3Jz2tl3sZyR kCqYQ5048vuDA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N3SvN21lPz6tmN; Fri, 4 Nov 2022 05:53:51 +0100 (CET) From: Ihor Radchenko To: Cletip Cletip Cc: Org Mode List Subject: Re: How to center an image directly in org-mode (without exporting) In-Reply-To: References: Date: Fri, 04 Nov 2022 04:54:32 +0000 Message-ID: <87sfiz48vr.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667537665; 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=Igx9mTp3hy3/Fa3xY6JqNWF58yCD5LRCPUi4r75cBA0=; b=iBF+K665+bs82R5dJru0y5aVwxkQksY12okQLm79bfXQoKy2GDSR4xpz/zh+Cd2Hf6zWSq Mx6hXXOSFXnuxRAmTX2tZJ7NjcVtDRlDYV4jBTWF03RjVwLYh8NQ2YLr1pBrAfJq6l31xR oqdt7gXpWpKjZ/tEvC0I5jn7H6y4uD9TyEA6oph3IjyOCGbuBhNOyINtIb5ugtPaKZIuuI X8gy+ybCR0vSMQCtcucwRriuI9ZJ6fwkWcIET+dBUJIWSHWVjGZ29GoLPykNFT+awNiXTS 1MY7S1QwmXNNwcy1Wnmjf4ZFPe/EHxGP9oy70+bxI/M938syuNFT22j7yLY3ug== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667537665; a=rsa-sha256; cv=none; b=gAMhmqQz9WKa/nTgcsJaD2FobC5dw6QFbjip/0R7t2Y1M3gnN5zN5mYeVFqbl4DzUuQyqD YZ9zOffFy/un/i8xY++ie81HUn1CUhpKKtVj6kOxP3iEAS/ezJbiwr+uK+EpIc725aTONu Hc1QW1AS1XVCSYA6zvbpUHv2+09yJfbuE4brJdE7CADLldAme0talZHOLtZBHWOenVMLGW c19TuvZPIcgSGpytTKe7UjH2AjDJJULuYvHVgu5mCvUdSgynmiwOlLukDfj3a/9BanLU// 7iLGqDDaNZqNgRdnJ0ysQdMUrYXOFC4eahNdY0ItkYDMWkOhnwhn1+z0HjWhUQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="UK/G531w"; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Spam-Score: -7.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="UK/G531w"; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Queue-Id: A7E243A649 X-Spam-Score: -7.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6ef8X+PswYao Cletip Cletip 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 . Support Org development at , or support my work at