From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MPHTCkdA12FQjQAAgWs5BA (envelope-from ) for ; Thu, 06 Jan 2022 20:17:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qHamA0dA12HI4wAAG6o9tA (envelope-from ) for ; Thu, 06 Jan 2022 20:17:27 +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 A7C8C3BFE9 for ; Thu, 6 Jan 2022 20:17:26 +0100 (CET) Received: from localhost ([::1]:51594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5YGL-0002Al-O6 for larch@yhetil.org; Thu, 06 Jan 2022 14:17:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5YDm-00028e-E9 for emacs-orgmode@gnu.org; Thu, 06 Jan 2022 14:14:46 -0500 Received: from [2a00:1450:4864:20::42f] (port=41982 helo=mail-wr1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5YDk-0000Gu-Vk for emacs-orgmode@gnu.org; Thu, 06 Jan 2022 14:14:46 -0500 Received: by mail-wr1-x42f.google.com with SMTP id v6so6718393wra.8 for ; Thu, 06 Jan 2022 11:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4wPmjkg4+Fo+h04yz5m2hAe1VyIva4z3vx3xSIBNhxc=; b=HCm9O6fZpS66iPCLmpaMz+Zm75j/9rxLuQfVqEiTKj0QirFkAR03kypS9GUIrdYW7D XC3B/+SwjexPNJDu+H6IqAGUTqeMLPevCKfU77HkVh6HnNKg6saCe8HQ5Glk3/xdqwC6 XldUqyptVDEoCif7XjLFmMqsFEN+cMPNh1x0r4HgZECo20S2BW/T1WpsVm6WLmzioz5+ 2D2BD9ychvUP9PvhzY2T3tprhCwlX9yA911ZOqNWhRLe115afQNikzGVYZNbVjTs/GKG jBCPEkRRNPDEkslR53mCl7Tl5enZnSRCzkrvrgysIB4QCSwvYCF50n2bm5gFPE+6awC5 DhyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4wPmjkg4+Fo+h04yz5m2hAe1VyIva4z3vx3xSIBNhxc=; b=KpHad6Cs3MB0gAr3fewfIU0l0zUzZeJtkeInLc38TkK4r4eJeMkabyK7trZ9euikvv F604dPL5NRe2S0LTT0WHaOjpRROVCZ2JYUsld5LaJUmYB9Qc9D7lmjyl0600NTsYd42c BuP9A1XIBiIQFz/mkjsS9DmuRVDlvNRh7BSVREbDs1c7z8nJLvD8WiWscJxocNpelYXt 3E5qsPAwAlV3rHJj9FrGLH7Hlo6r/g+8niVBxGr6FjLoYqO/HwN15JmoXYCthUmTqVIM ZgVa+o3xt1fx6Ks4t5fuKTaroscs9Vx+W/gaqSrYHXbzId8NY10wAuPh+bnkKzmvI9Sg Dc4Q== X-Gm-Message-State: AOAM532w62/TWHFG3MUNazO36XybN/YYmtuOGyKRhwU8HsDNP0XTTPnC J4/bvxF6ZJYZRMOs/qB/l0V/NUkswvsoUvMkIlg2HSRs4yE= X-Google-Smtp-Source: ABdhPJz2zXrL8V/xou90m9h7s9duveZIVuRYK4o2SJ9EA9MFUHmPYIy0xLCT9AYqenu3drM1q/QVvT1cVlrUT1X/fu0= X-Received: by 2002:adf:e706:: with SMTP id c6mr2951456wrm.116.1641496483530; Thu, 06 Jan 2022 11:14:43 -0800 (PST) MIME-Version: 1.0 References: <87ee5kwwht.fsf@posteo.net> In-Reply-To: <87ee5kwwht.fsf@posteo.net> From: Kaushal Modi Date: Thu, 6 Jan 2022 14:14:07 -0500 Message-ID: Subject: Re: Way to mark contents of an Org special block as verbatim? To: =?UTF-8?Q?Juan_Manuel_Mac=C3=ADas?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=kaushal.modi@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" 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=1641496646; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=4wPmjkg4+Fo+h04yz5m2hAe1VyIva4z3vx3xSIBNhxc=; b=ce2uVZuToBVEpjitpeShOUFacQd/ncIbmIlGRe5H4vByfJuBCeszuzTkhZwccWnG/n3nuw sjpIRba8bU2OTabYrQjB7HPPnyDocvmhR+c8HpZZ2Pom10Ab7ehH5lb6OYd8k0+ASTRX9l TbpX5NM1KFAM1KsWh55LT/yz5XUngBJUPkEa5ZY6aTnkTD0rWuZg1z7krJkf4smzlEaPM3 GfvK9ZF5DB2mAOdG/2fPTB6Y/gZy1DxLLaflHCMldZ80bjiQ7zahIHA3wtt0LY5n7GrJ6L GSqAczfkvGa9zh4ihNP3t9DDekxK+4VkEIUzfRdqqP4Emxp2/8m1KWz/ZZ5sqQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641496646; a=rsa-sha256; cv=none; b=dnkslIUJF4GNr3V9Urv8TKZENrlkxtxqvKMK3oJqPIPSn3HZDZW0ZANbHMJV2sJogVCNb3 HTqf3VrdMLTHxdEOisbN7A67L98bTzqMTI6MmiDCsgRv1g8kGAfMFtuDgoInMxqb7lZVAG UvIVZ8FeUNLZjTp+TSUBKQ450oinlE4oZEUkViH9fTMKY3BUhBZ7WRzk4SyREhNHCkjze1 l5osvgZ5m8WsOE/krpam2NcdcYGM5pYeRHsqKF2Tr4dcAwerMsNw+kQGZMai1Wztq/Vzhv Z/OD7fgk0y+zGQceycEr68rs1I7g6R72UqKNxJb2KYHyxRRUKI60fjGmD7Yxvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HCm9O6fZ; 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: -3.30 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HCm9O6fZ; 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: A7C8C3BFE9 X-Spam-Score: -3.30 X-Migadu-Scanner: scn1.migadu.com X-TUID: PHzda/sKkWqW On Thu, Jan 6, 2022 at 1:27 PM Juan Manuel Mac=C3=ADas wrote: > I think one possibility would be using a parse tree export filter: > > #+BIND: org-export-filter-parse-tree-functions (katex-verbatim) > #+begin_src emacs-lisp :exports results :results none > (defun katex-verbatim (tree backend info) > (when (org-export-derived-backend-p backend 'latex) > (org-element-map tree 'special-block > (lambda (block) > (when (equal "katex" (org-element-property :type block)) > (let ((cont (org-element-interpret-data (org-element-contents= block))) > (create-export-snippet ;; idea from Nicolas Goaziou > (lambda (v) > (org-element-create 'export-snippet (list :back-end = "latex" :value v))))) > (apply #'org-element-set-contents > block > (list (funcall create-export-snippet cont)))))) > info) > tree)) > #+end_src > > #+begin_katex > E =3D -J \sum_{i=3D1}^N s_i s_{i+1} > #+end_katex > > =3D=3D> > > \begin{katex} > E =3D -J \sum_{i=3D1}^N s_i s_{i+1} > \end{katex} Wow, thanks for that complete code. I didn't know about the parse tree functions. I was thinking if below is possible as any user running my exporter would need to use this feature easily. #+begin_katex :verbatim t E =3D -J \sum_{i=3D1}^N s_i s_{i+1} #+end_katex Is it possible to do anything inside the org-hugo-special-block function that's defined in the exporter?