From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 4EBoAzAcZWNtIwAAbAwnHQ (envelope-from ) for ; Fri, 04 Nov 2022 15:05:36 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wOdUAzAcZWOI2gAAauVa8A (envelope-from ) for ; Fri, 04 Nov 2022 15:05:36 +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 CB1FCAB4B for ; Fri, 4 Nov 2022 15:05:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqxIu-0005rx-Pt; Fri, 04 Nov 2022 10:04:18 -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 1oqxIH-0005Vo-OW for emacs-orgmode@gnu.org; Fri, 04 Nov 2022 10:03:40 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqxIE-00073O-Ei for emacs-orgmode@gnu.org; Fri, 04 Nov 2022 10:03:35 -0400 Received: by mail-ej1-x633.google.com with SMTP id t25so13497842ejb.8 for ; Fri, 04 Nov 2022 07:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SAv0aTAeZcaZE86w1WdwLmXoJ56GbwLyMD+ljfHaf7M=; b=OEqZCMb6HWGDm/KfsVULAoluOi4+Hw3CcT+dKhzZLMen3O9K6sPegFOZTRaEXOkNtj xzLX2jriKXl5bYADW7z6bNT0PAzZtdhpO7czQK5W6QWo6IygkKmww7UM4Bf8YJKkHKvz ZatgSglop/0XSQkbTbt0nrl7XaGFkibye8pfR18tX2OpCuVB8NPvBYffpMDTnSCOPyn5 afPKvzfdWiH0uk60+Z72LBJiUpUPOIN+HoXD2h3xzkPK0vfCRS76PnxTwxGlb9IfgsbK CrC1FHQWTBLSoYwaXVD3mP7/JmpWttmA5T3jHmH2ZpJrta2T88TBbtU51ILxnNY+2JBZ MOVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SAv0aTAeZcaZE86w1WdwLmXoJ56GbwLyMD+ljfHaf7M=; b=5tZcsJIBx8NbWwSXqCm+Y1GliS2Q4gf91kurrEDncFD2xm37dNJXEQMcuYbNhv4eHZ 7qVbUGBAEJGrXLgxNMzNgspqxLEOeI4f+vTRol1X4WSjh5PHOcfK2xPkiVdp6DNUlsCr NbfZJscxbS2Ww/Vm40Tj9/f+vHhkUOiZ4GmcleGJZ5e85femyU5P4B1niK/p7Mw7j+w5 36LNFHaeh4a34epJzFyUxeM6v7s9VaODeW1zjDty/+4SJIHEvYZjSM5sKEnSQY3xg/O5 /9OSnNqdkP4KNUXfBZAWk5hbeSZn7ZH/iQsB7sSkE2Qrn52Rz0KOzre4jL5VKUqAEwKJ 0dhA== X-Gm-Message-State: ACrzQf0rR1IdQ8EO3SOpsBcQrJbrysucgxBbUgAUjHaCFt73ofNvfu1l rmoiIhy/oXOX9JWhBvRSw+4nrLyDvn65bSqYSc8= X-Google-Smtp-Source: AMsMyM7sfsw9VOQxJFXlGgIvOkVrtT+GKREBlUR/PeQpHCtdceS1BoSgyjpu9Z5QoG9JCA8AMC+BxSf22HU5FBwwsFs= X-Received: by 2002:a17:907:80b:b0:77a:86a1:db52 with SMTP id wv11-20020a170907080b00b0077a86a1db52mr34736637ejb.294.1667570612251; Fri, 04 Nov 2022 07:03:32 -0700 (PDT) MIME-Version: 1.0 References: <87sfiz48vr.fsf@localhost> In-Reply-To: <87sfiz48vr.fsf@localhost> From: Cletip Cletip Date: Fri, 4 Nov 2022 15:03:20 +0100 Message-ID: Subject: Re: How to center an image directly in org-mode (without exporting) To: Ihor Radchenko Cc: Org Mode List Content-Type: multipart/alternative; boundary="000000000000fb2e8d05eca58966" Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=clement020302@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=1667570735; 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=SAv0aTAeZcaZE86w1WdwLmXoJ56GbwLyMD+ljfHaf7M=; b=ugNBLkkHuSi4g1Ox4l4UvXfbdcoArZc/xHieI5fI73qiuyEj8PrCG52AvtIMonLR0aqt7Y pIpQSlWhVjryiOuwU1/qg/+MDTEGBTSPYStPH5VUE/bLcZKAg8zN1mhz+Iz7zheHcQG3RG NczxblEb8k5QWgMdqaz6SAC8dROH+Ka27oocr2S3Z3jBgbG7jyqTe3K0/ISp9sgXbg0y5t ilFtJRzVX7tMclmgbZSNeCSEZukRC2aV6KVcDqYodeGp8gRFZFDvxDRXacCE+46xoDnMC2 a8qcFFoDfBq3Sg9P16jg5V9CENia4xIG0FvQlbF1zWRWfh51aQTfCIRxR1AlyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667570735; a=rsa-sha256; cv=none; b=riMiJHuyqRbKTw3bQEHTpIM77pCVVPppU0khIGZ4Pt41vKeFrqLj7jastP0Ih12BZDgIrF BX6MOu94lhrms+orLtU2xDtkSlVXxGZCCwiF5y+xLhbluJ+g8gMamH/7z/ED1S6WlZDe80 /WLirT3Ilqe0OZ1uhVBUfd3j1RM1+WXHkvsn2kheEIB+Q+y9ICRe7J/YADljuG5Zn3QUOA g/7mlxNEV6jOZtrW1KDTa2IH8iRax/C5MV4l58vbae2ImXItWLKQEMHiClEKjN1hx1oYWw pjWObjdG/1RERmIEDY6FYNNmO2Dy8QlFeeuGTt0Q3NbCBafeaM2O5wo79B9kdg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OEqZCMb6; dmarc=pass (policy=none) header.from=gmail.com; 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: -5.30 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OEqZCMb6; dmarc=pass (policy=none) header.from=gmail.com; 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: CB1FCAB4B X-Spam-Score: -5.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: zzYun/uFfkX4 --000000000000fb2e8d05eca58966 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks you for your answer, thanks for the tips, I will see that in detail. Le ven. 4 nov. 2022 =C3=A0 05:53, Ihor Radchenko a = =C3=A9crit : > 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 > --000000000000fb2e8d05eca58966 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks you for your answer,
thanks for the tips, I will= see that in detail.

Le=C2=A0ven. 4 nov. 2022 =C3=A0=C2=A005:53, Ihor Radche= nko <yantar92@posteo.net> = a =C3=A9crit=C2=A0:
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 cen= tered. 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 t= he 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>
--000000000000fb2e8d05eca58966--