From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cGy3L2wcXWMv0wAAbAwnHQ (envelope-from ) for ; Sat, 29 Oct 2022 14:28:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ADe8L2wcXWM2ogAA9RJhRA (envelope-from ) for ; Sat, 29 Oct 2022 14:28:28 +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 8B5C8289F9 for ; Sat, 29 Oct 2022 14:28:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ookVE-0008Ne-G8; Sat, 29 Oct 2022 07:59:52 -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 1ookVB-0008K7-36 for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 07:59:50 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ookV9-0003xI-F0 for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 07:59:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1667044780; bh=bsGMGapKt+8MbLkq5qIdDTEnrc0Cx7nhKK4yDLxCtZw=; h=X-UI-Sender-Class:From:To:Subject:Date; b=rjkktPurlNP6iERxj3OwOv3wQA+aJYQVG7VCefgReY6QjK8C4BjNLSSt8+/GWtImZ IcMPdAQ+34IwIkxywYeBS+TJYLz1ql9+NM+tqWvdi5PQCowPAtMQZF/DbN9mNr2Itx 9mlwW5nN9sfv/ZfsuuZL2qD8CvW9SFQEKDlwXrVrEtwmHRTJ94NoHh5XiN8kXr/ab1 ktOFL7uk0S9YTr7EZGJjICSteSR2a+QdB1J3KUaAlPJgfs2tFvqfQFyGR65rrE+OVg xCw9DhZHl1JK0cLpHyrCZUb3gTrMyN4IfDHd6SAbwjQUp6bnq5mkizaynflHXf1ZKk ufaMGt0WbFhlg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stella.c0t0d0s0.de ([46.114.111.130]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MGhuU-1otiZd3dqM-00DnSX for ; Sat, 29 Oct 2022 13:59:39 +0200 Received: from stella (stella.c0t0d0s0.de [192.168.42.1]) by stella.c0t0d0s0.de (Postfix) with ESMTP id B05E4180824 for ; Sat, 29 Oct 2022 13:52:20 +0200 (CEST) From: Michael Welle To: emacs-orgmode@gnu.org Subject: Exporting images to different output formats User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 29 Oct 2022 13:52:20 +0200 Message-ID: <87wn8ic0ej.fsf@luisa.c0t0d0s0.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:tUZrsHJrWolTdXDGKvakbI36dyWRy8wwyQ5J9KfIQJGLXq81Co7 r91fwyVnYtBkD2poDO6XBUzTMfbo/2b3RBIv0KGYfOgdNxQASvdxttblPTdAdmbG+zv+u2D mQ6jneEAcqg8iwzIHgWcd6GdImpz1GcNG0kGdvtt1aI3dFtjTJQstuEdclhQRHysK4SUm7l OXU5QcqXwRJ2Ujmk06P4A== UI-OutboundReport: notjunk:1;M01:P0:elq1Cp/2izo=;gWiDruiu3u9aOQMPBC7flqe3W6Q 2mDMNqExJIbkN1KgKGbOjEmVOHEBn+KTWiRFMacJZfBEI/gfRps+6Gxb9Vw07di9aF7NfclI6 zzsmjpzN2hrK7rWRIiT3Ws0zm47QJIfdIDpl7EmltbRQRIgSZAofBrU4d9OrloCibtJGNWKQg xhLw7cjnWA3s/3tzS69bcCZqecSPg2Icwl52HikwPRKuw71aB6XAYzLISVoG8cv0yQe8PEIkD WPV6fIOT9e9UIM8KeiuqT2oCOq8AaKa8oR/tvLd8FNcQ5FQtjZ65pbBMJSNxIaBGBXtgOeiG/ sgXybi9DNYdCPr6poYl4JMtw48UQg88tUAwtQ7+8BQBntNIKf4ewgZtIeLWSDQDARinxeN2IJ 54ma8graGwq1M3gDVO/6GpdJsVFDi5/n6sLZ6FoAgM8vwWulg4oYEBgRqPNMF5ouz1v1vEjq5 ABbM27heKlzdk0nYkztbqCfAYZ6x200VGN0uvPbmL8Sqs1KVIIv+esVZWJcnRU4LQ++bFTzvi 9II47KhwTTFvIaBNLP7FfS/2Uusn7yGwqdBbg0yThwESk+5/iQTGfKLX1eGs7cWRkemSOZdMM wNj9uQwJ/RPXPj4H+qtt/nV3nKazbQstwvpTK4GpST25VyVBJPnok5m3+6/13humdQl/u5Rl4 sn/SJodPL0BXdz/Gn8pRTRVOXv+k2g1BGhcBRpGEoV2AQabL1PohlycmrvE4/yHi0tWyNa+hf naVXLbhmJIFUJW/3sAxcberc83wd5lYOaQzetTYzjHetx5IzbReBGPFcyBcgKTKYefYrJ4RNn 0j6/OZ1/vYlzweY/AQ4DOaD+uglEkcQ2gWFuICPdwnz0XSBMxcsUGhmBh7He8SGDNKXQ/VOIY dY7fGNWMtPDrgQXKLTc+Esu3JTdYbBfZAwCyeb5m0XgJ1eZ7OXx93N0E40VTqd4wPzKvmuomw tApkkE7kaaFFLLU/X4pvEMKdoRA= Received-SPF: pass client-ip=212.227.17.20; envelope-from=mwe012008@gmx.net; helo=mout.gmx.net X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 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, RCVD_IN_DNSWL_LOW=-0.7, 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=1667046508; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XxhTnL3i9zJhkj3eUt7DU2ESB/yQrWgCQK1auVuYdT0=; b=LG9Jt3aZIYOz8GWNvWEmpc0dSw5411C0juG2VdBLcbtgHBD+Exct9/d+RkaBaCAPSqNFL2 1ZX88vCDBXlPydvce8gi1KwyGsZnG7AX5/nNVrIf3d7e6J8NOWQducjAn3hgB0UoHwitY+ 66vO+hBR8rV/yuYsxO9Qm8qel05ATPEoLhCnQCquL7hmK5l+PeU/6n2LQyLViw0uA4pCfo A4OoOdrS64TyV4dB9SOFjq43jVVbdUUPixiaI3nfYEpAaypuWr8W+E6a1Gz1Xam5jb+Sxv klAD3GiJ2yXVnIO+pnJjplqUPKhyrcfJBrGXq6k9RZE95y0fqsI0ULueAPcqJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667046508; a=rsa-sha256; cv=none; b=ZuVgvRKfDskotAjciD4t+Mtjy3xKC0SYom/ztCXqlcpL9ZtDQ96v70HO745i7tr/zTl1TF 0Jeba7mlOpLqyRLs/lkXsAH/afec1pMnekCQWSCHEOfO0JQ7PDfuTx+pkcZi4FyODThLfC bAgh7cYtGoIwVYKE9WCbYpNXdyZTwqjJW6P7fm/pSisFJr+lf3WG4bWCDLeQ53ZkpqJ2e9 /SyNKWEeTZdIPfq0TJfraRz84yG7wKO68zLJ6rQCl8hfHfCbT0M2wn4k+O9lQqVjRw92YD EDJlhtXgqaqh5azJlIP+B9thZ/956SjBHwD1L5RTwNmk02xvDMICVJmEarOxYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=s31663417 header.b=rjkktPur; dmarc=pass (policy=none) header.from=gmx.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: -5.23 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=s31663417 header.b=rjkktPur; dmarc=pass (policy=none) header.from=gmx.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: 8B5C8289F9 X-Spam-Score: -5.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: IJfMc43+xPgE Hello, I want to export to different output formats. Trouble is the way ox-gfm exports images. So I thought, hm, why not utilise macros to abstract away the differences. Well, that escalated quickly: #+macro: img_gfm (eval (concat "#+begin_export md\n![img](" $1 " \"" $2 "\")\n*Abb.: " $2 "* (Quelle: " $3 ")\n#+end_export")) #+macro: img_latex (eval "foobar") # Image export for Github flavoured markdown # $1 path to image # $2 caption # $3 source #+macro: img (eval (cl-case org-export-current-backend ('gfm (concat "{{{img_gfm(" $1 "," $2 "," $3")}}}")) ('latex "{{{img_latex}}}") (t "barfoo"))) {{{img(./foo, foo, barfoo)}}} That kind of works (and breaks if I want commas in the caption), but is ugly as... and doesn't get better if I implement the other output formats. Maybe syntax like @@latex: ...@@ would help. But no, I think that is defined in the specific backends, not as a general mechanism. So, how can I do it better? All the best, hmw