From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AI7ONI7GWmGMOgEAgWs5BA (envelope-from ) for ; Mon, 04 Oct 2021 11:17:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YASnMI7GWmFSYAAA1q6Kng (envelope-from ) for ; Mon, 04 Oct 2021 09:17:02 +0000 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 4C9B62BF4E for ; Mon, 4 Oct 2021 11:17:02 +0200 (CEST) Received: from localhost ([::1]:33962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXK5j-0004ny-TT for larch@yhetil.org; Mon, 04 Oct 2021 05:16:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXJVr-0004Uk-Q3 for emacs-orgmode@gnu.org; Mon, 04 Oct 2021 04:39:57 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:38622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXJVq-0004n0-7M for emacs-orgmode@gnu.org; Mon, 04 Oct 2021 04:39:55 -0400 Received: by mail-lf1-x12c.google.com with SMTP id x27so68457791lfu.5 for ; Mon, 04 Oct 2021 01:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=RKGvIwKLGPnwdvwVq86kcQYuCuKMgBrUR3QuA+cAwtA=; b=ksqXSn+/QJ0RZGnGMJGFshG2bbr2D3jTJ0GkZkGGCmb9cDo5P/2WCU0h0osAUdACWr cRgBQftAY0HK8nbG90744wgSW+c5crWOZNsWCEcTVp3PLZyv945JR9TCJqoJR+OY6n3c QRVsqzPP4DlqkBZvNgr3LnNKEyCtD/jGAY2TkHp07rBfC3v76k7OHysUOzWrNVf2S+CD v27zoJxwwRK2nXbGgVph8uiYXBxhy7w9yxwWpVBmjNPMntpn+ZWrS889WKc5q0+V/sPa w0g1jtyfdwrP3GQoEyJS9G1oQjh+McmL45vTYuj02fWxuti9iM495GClumbyCKNZDBZB pbow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=RKGvIwKLGPnwdvwVq86kcQYuCuKMgBrUR3QuA+cAwtA=; b=S5N6iHECL/Mk73dIrz2UE/nYcpUfTxY6GG5TrDVkI5dP1tUarB4fa2jFm/qEivopoN aS1pAl5C4VgkQybAFbalA2wEh2vapi/xqtONR0HtleSD3dEz7abyVb2tuXwxa3C3xp6K 0uPFQs/qtC3n0U0R3ui+OKh9p7jeYJous2evErCWjHRPP9j6MyG+tnDMGx5gUJDOj3ic K4mlLk/j0NeQVunpU3SRO8gIypcoxuqviKvB5qAezwUQZsHfK1jA+mbpRghhqws4VI0/ INEfcQsFNZk1zc3wrDI8kRDvBEI87K5QehzXv6MPmQX5smaJmfyhBo3saj7epcCZRCaY YoZg== X-Gm-Message-State: AOAM533UbansZdiv5vEz8eU8WnUN3xZAD4kz1E54tYiTupnNAJVKrA6y RFb2CvmYTHuyqNqsM0z/ZpE= X-Google-Smtp-Source: ABdhPJxoUOH2gOS4NzFj1lezS1xOgI6VVC0jE4mD25tObu4+N2QZTw0li+c5dfaRCSywxYKYQIa6Jg== X-Received: by 2002:a05:6512:b08:: with SMTP id w8mr12977061lfu.505.1633336792348; Mon, 04 Oct 2021 01:39:52 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id d11sm153176lfm.308.2021.10.04.01.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 01:39:52 -0700 (PDT) From: Ihor Radchenko To: Jason Ross Subject: Re: Best way to include METAPOST in ConTeXt exporter In-Reply-To: References: Date: Mon, 04 Oct 2021 16:41:08 +0800 Message-ID: <87wnmtb2sb.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=yantar92@gmail.com; helo=mail-lf1-x12c.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, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633339022; 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=RKGvIwKLGPnwdvwVq86kcQYuCuKMgBrUR3QuA+cAwtA=; b=lVtV+BgayuFt5oWqUt1LrFLLdL+akYeQrM4disKYEJTheLTttB8k8yvuZCFijJ4+zDoxgK 4dEw+U1z6dZfb/SBX+M5ufLGcde46uNR5HfGk/mUL+FKj/iKJk8fZ8sExPcibGmPy4ufPq T2Qr5yKm0NYBwf9ZCj+w9XH2aXiLsDRn3YeaYJyoXxsh3L3Hhg/NzpniNITuvweb760zo/ 81rZUPDz/YojgOH8E8f6LltvebSxZ9sxPaszhWB/xat7apTnz8PpJNhvaKHMUaHwNuP8do bBDsCi9gWQp19SjsblWz8Y/Q0EVZLAOfochLAxMMChXU0Z1cR9wFsRUuAOhSMQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633339022; a=rsa-sha256; cv=none; b=pSgO6FWFMWz53WlZUGOz1D1gE/bcS7in/fL6KS2pX2WCUKtgropll90+NwIpemWwCV8u0M XbsKc7F94ClYLKKn1C71oguur2BzScPARblGNfDAr1Fo19R7NhxMvp1/EfXVLDgxkV8Xrh iI+gN/xWM1lsQmaGwUIPzpv0Ul3H4/OA2TvSnG6pcY9aFNQGM8aE3UEeep8My1AiacFqJF AtmQgwbXi0Vm1HMB59Fqu7cR+DzT1Nl+2grdKIG2YUkxXpzGKH3/J83CExRr0zmW0IQJ9c 1c3KclLSOHjZAzdsCPTt09zIS9+2yJq9M44FfZf467xxvIo2+r7UM3hZXbPVQQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ksqXSn+/"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ksqXSn+/"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4C9B62BF4E X-Spam-Score: -2.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: jQvBjNLRR0DQ Jason Ross writes: > Hello, > > I'd like to include METAPOST figures in the ConTeXt exporter backend I'm > developing. However, I don't know of an idiomatic way to add captions and > references for the figures. You can use affiliated keywords: (defconst org-element-affiliated-keywords '("CAPTION" "DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT" "RESULTS" "SOURCE" "SRCNAME" "TBLNAME") "List of affiliated keywords as strings. By default, all keywords setting attributes (e.g., \"ATTR_LATEX\") are affiliated keywords and need not to be in this list.") > Currently, I export METAPOST with `#+BEGIN_EXPORT metapost` / `#+END_EXPORT` > tags. However, this feature seems to be intended for completely "raw" > outputs > with no markup or tagging in the resulting export. I'm interested in > supporting > at least `#+NAME` and `#+CAPTION` keywords for METAPOST figures so that they > can be referred to in the Org file and also in the exported pdf. > What are some better ways of doing something like this? Source blocks? How > would > a user expect to use a feature like this? You can use a special block: #+caption: Sample caption #+attr_context: :field value #+begin_metapost ... #+end_metapost The parsed representation of this element in exporter will be something like: (special-block (:type "metapost" :begin 292 :end 382 :contents-begin 364 :contents-end 368 :post-blank 0 :post-affiliated 347 :caption (((#("Sample caption" 0 14 (:parent #4))))) :attr_context (":field value"))) Best, Ihor