From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8G7NLX9GHWPC2wAAbAwnHQ (envelope-from ) for ; Sun, 11 Sep 2022 04:22:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MOboLX9GHWMBHwEAauVa8A (envelope-from ) for ; Sun, 11 Sep 2022 04:22:55 +0200 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 99AC81169A for ; Sun, 11 Sep 2022 04:22:54 +0200 (CEST) Received: from localhost ([::1]:44284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXCcW-0004dj-Ok for larch@yhetil.org; Sat, 10 Sep 2022 22:22:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXCc8-0004db-Tf for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 22:22:28 -0400 Received: from [39.171.214.225] (port=7511 helo=Mac-mini.local) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXCc6-00087R-Tn for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 22:22:28 -0400 Received: by Mac-mini.local (Postfix, from userid 501) id CC1F162EEF70; Sun, 11 Sep 2022 10:22:08 +0800 (CST) References: User-agent: mu4e 1.8.9; emacs 29.0.50 From: "Christopher M. Miles" Cc: "Christopher M. Miles" , emacs-orgmode@gnu.org Subject: [SOLVED] Re: [QUESTION] How to specific image size attributes under headline scope? Date: Sun, 11 Sep 2022 10:20:12 +0800 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 39.171.214.225 (deferred) Received-SPF: softfail client-ip=39.171.214.225; envelope-from=numbchild@gmail.com; helo=Mac-mini.local X-Spam_score_int: 68 X-Spam_score: 6.8 X-Spam_bar: ++++++ X-Spam_report: (6.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MISSING_HEADERS=1.021, MSGID_MULTIPLE_AT=1, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_PBL=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, SPOOFED_FREEMAIL_NO_RDNS=0.019, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: reject 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: , Reply-To: numbchild@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662862974; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id: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; bh=KRVC+p0+46aws5i46YIuMplTiR7BTClJWYRev7Tm0B0=; b=MAsZY13q8RdvygRJy8Ndo1X2mRXvXtUHsm0V42D0KDCqHgNuudRORroz+bW6pKv/m90m3Q Ixh5xionxBb8q2dMYFEvfttM+glHhwLvK6yZFb0tVefwDYHFBWygkteeYBv43qvQ1afbBt 1u3rhLelIh452zkwkG1HdhvotuI+kfy7Ra12m2QA4IWDnoinCsSiXEQOfeAy+JjpF3XOfb 6KnodIVN1pGaeS6LaqwgxSr29Qox5X43fWv9vW61Pqg/EHTtbqhric3nHiQEd/XI5O6xYb pxlbnDhkUKOT9MEwXrcbRaZz5GlIOYxfubZYYMhBoYIccYlhyQ8w9Vja25IUNQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662862974; a=rsa-sha256; cv=none; b=u1GKXKitOWWSvwXB/XhvTQ+TrOw26lUJzU2Lk98GAtjRv/0xmfrH4GQ566dN5kA59ut0Fy taagbk497kOTDm6IkGWgdXhRaTXZT6BDecbXNN8j9zv6NRJM85GhBp/MS+Pwxe+7OFjNth h/zrMGp4Xdui6c1xUUzJ7lh9X2cCsr6zqZJLbRHt0gygpW9u1Z3Jgf/Vt/xZ99I93XvzYC 3+b9iphPv8iKxnW8H8CdWGJhorvKeXAq1N8dUbjgovm+UJ0qmQ+RV0dgvHC70KLP7ijF0F Sb0dcIDYwYbUCJ+qbI3PJmieYeSN3Bsg1xf2KxKbqiv0STZpvhUoaNP5wWCxGA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 4.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 99AC81169A X-Spam-Score: 4.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: wj2JYD3uESfL --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable "Christopher M. Miles" writes: > [[PGP Signed Part:Undecided]] > There is attributes setting above image link to specify image inline prev= iew size. Like this: > > #+begin_src org > ,#+ATTR_ORG: :width 500 > ,#+ATTR_LATEX: :width 5.0in > ,#+ATTR_HTML: :width 500px > [[file:kk/88320740_p0.jpg]] > > #+end_src > > When I put it on beginning of org document, then preview inline images, b= ut those global attributes > not affected. The inline images still display in actual image size. I wan= t to specify image size > under headline properties. Is it possible to do this? I implemented this feature by written a hook. Hope this can be helpful for someone who also has this needs. Here is the code: #+begin_src emacs-lisp ;;; auto display inline images under current TAB cycle expanded "visible" s= ubtree. (defun org-display-subtree-with-inline-images (&optional state) "Toggle the display of inline images under current expanded visible subtr= ee. INCLUDE-LINKED is passed to `org-display-inline-images'." (interactive) ;; (not (memq state '(overview folded contents))) ; global state change (let ((display-inline-images-local (lambda (beg end) (org-display-inline-images t t beg end) ;; display number of inline images which is intersection of two = image overlays lists. ;; (message "%d images displayed inline" ;; (length (cl-intersection org-inline-image-overlays (= overlays-in beg end)))) )) (hide-inline-images-local (lambda () (setq org-inline-image-overlays nil) ; (org-remove-inline-images) (message "Inline image display turned off"))) (inline-image-width-override ; get headline property value as inlin= e image width. (lambda () ;; The property "INLINE-IMAGE-WIDTH" value should be integer. (let* ((property-value (ignore-errors (org-property-or-variable-= value 'INLINE-IMAGE-WIDTH))) (width-integer (or (and property-value (if (numberp property-value) prop= erty-value (string-to-number property-value))) (- (/ (window-width (selected-window) = t) 2) 100)))) (setq-local org-image-actual-width width-integer))))) (pcase state ('children (save-excursion (save-restriction (org-narrow-to-subtree) ;; If has nested headlines, beg,end only from parent headline ;; to first child headline which reference to upper let-binding ;; `org-next-visible-heading'. (funcall display-inline-images-local (point-min) (progn (org-nex= t-visible-heading 1) (point)))))) ('subtree (save-excursion (save-restriction (org-narrow-to-subtree) (funcall inline-image-width-override) ;; If has nested headlines, also inline display images under all= sub-headlines. (funcall display-inline-images-local (point-min) (point-max))))) ('folded (funcall hide-inline-images-local))))) (add-to-list 'org-default-properties "INLINE-IMAGE-WIDTH") (add-hook 'org-cycle-hook #'org-display-subtree-with-inline-images) (define-key org-mode-map (kbd "C-c C-x C-v") 'org-display-subtree-with-inli= ne-images) #+end_src =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmMdRlAACgkQG13xyVro msO7jggAqzcYeqPOR5HIjkXdaVugPPv/bP1IzE+rjztwrsibQdFHG/ApO3HjAH5J 2zXzPxYtG9/Kh8JhSIwjukO7mEs5EVvPZadNcgOpiggSoaXJzkwvWJphDItm8yB9 vp21pqvDnjLZcwhyDVuTFj91nQh9MrN/v14DM0KqqrsUXO1OwwBrd5GEcLnJ3wj1 jg9P18ABreBKPSLD6wLyD9sy8jrTcq6VsxUHk4kUnckIO3A5/t3OFUnSGRDDVovq B7Q0Qzkyorg9Nx0SgT35T1+/RKBGcJBxxJYdfplfhKUOtVLnQmuP/OKHshMiaswp oZ8VFds8m5pyDCR8iRamNP84aLlN2Q== =KrIz -----END PGP SIGNATURE----- --=-=-=--