From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gEKeK+Q+12EHgwAAgWs5BA (envelope-from ) for ; Thu, 06 Jan 2022 20:11:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4NhBKOQ+12GAvQAAauVa8A (envelope-from ) for ; Thu, 06 Jan 2022 20:11:32 +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 ED25C2B11C for ; Thu, 6 Jan 2022 20:11:31 +0100 (CET) Received: from localhost ([::1]:50470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5XXh-00059z-Fy for larch@yhetil.org; Thu, 06 Jan 2022 13:31:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5XTr-0001UP-RD for emacs-orgmode@gnu.org; Thu, 06 Jan 2022 13:27:19 -0500 Received: from mout01.posteo.de ([185.67.36.65]:33563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5XTp-0001NO-A9 for emacs-orgmode@gnu.org; Thu, 06 Jan 2022 13:27:19 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3C7C6240027 for ; Thu, 6 Jan 2022 19:27:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1641493634; bh=BNQa+6qQhAg3VawX2xbvbOGQpeYfdy4jMkSwJJlgrvg=; h=From:To:Cc:Subject:Date:From; b=WwWzxBajlMBLof5k7xxJAVekx1avVVI+oJqYE+tx7qS/nh85DVU26FKGmvbC3MvLr jvm1bdCzdcNrIqvVChNWV+mzgpdtO+cFxbQQAAvE1HfRg2Hj9VH74kf0pGdcWGxoAl 0a5i2hc8KX5Zz6iTQ9DXi7MuIwldJ4vF+aFwFSbgGeIOeNL3UXxh862c7weWv4bj9d Las+KUqbqdAOpWUqu5ZnWeSAbcp02l57ZKzKjWZuUdnnVo3pt3So+kuDOOX/JSgNXG eqFOG2ahqY5v5HWsAB/LmaOamrazK53t/hGDnauWINLcgNlap+p1z5WSxP4IBdi6wB 6L8zHj8CDQ34A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JVFFF3ylmz9rxP; Thu, 6 Jan 2022 19:27:13 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Kaushal Modi Subject: Re: Way to mark contents of an Org special block as verbatim? References: Date: Thu, 06 Jan 2022 18:27:10 +0000 In-Reply-To: (Kaushal Modi's message of "Thu, 6 Jan 2022 12:00:31 -0500") Message-ID: <87ee5kwwht.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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: , 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=1641496292; 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=vh+EsHVCbllQcJjqxyuhmj7xmKXLFcp7sqmzxULXBGw=; b=Nc67uhTVCym7YOQeLHVzraKDAN8fHNZ4NGm4fYSqn5Tb4ZkknvvweblFtF6eoRT77RKjLI Aeoo22JaA1WPQKFQhjSPrBl4XKtUWZAoDQxlscxU1+wQGdsPZqf8LP00N8ogCCZsmTJl+j nBVNZOWN2OqgqH+7YfMyjWLeE+vE4lnQfznTgCHz+8REXrUR7SwsdkxWm71fPa+QZP0F64 sAlp3MLjlhKWNV6ICNrvG2/N/qFlW3W5SQpt4AxxLzkbZLITeAcSKnV24EVschQqKvjZeJ 1x84gLiLUqAGYGYFapk82P3sFZW3Dyngw79s2h9fTO8lB09O+/siZwnvmJi0VA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641496292; a=rsa-sha256; cv=none; b=fmmSc+rnE6mIDsPwAAUYFL5nILzmydHHRehqAoITndH8xyvaRLS6aJxNydSwZOgCj3EHLC pRkHRh5daps6fED+EelCdYll+bCTn+6p/wfLxkKWiB+vha6Iezs9e05Z3TOQyPj3reWdSg GFWyQ5Bk5pAUdMh1+4fp2xutlZs/tG2U3Hb9geDyhET0TPJBT0unm9QlbIwp+uxn5VrxcY QQAn+WexnKTcca2vBRp0XAo1me+iNUuY0cmoxCygHYMWvIut+g7j4uCH7QmmgbB+n9T7+l +sZGXiA6/9qQoj2REGByQCEM5DSeXgGuAst3aiYlTz51+nspjAouCODTLl7k5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=WwWzxBaj; dmarc=pass (policy=none) header.from=posteo.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: -3.50 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=WwWzxBaj; dmarc=pass (policy=none) header.from=posteo.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: ED25C2B11C X-Spam-Score: -3.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2oT5eXmQCl+P Hi Kaushal, Kaushal Modi writes: > I would like to treat that block /like/ how Org treats the latex > environment blocks, but it needs to be a special block as > begin_katex/end_katex here is special and it could be a different > equation rendering backend for another user. > > So is that a header switch or arg that can be passed on to this > special block that enables the verbatim mode (prevent Org from > replacing the Org entities, do the sub/superscript expansion, etc.)? 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 = -J \sum_{i=1}^N s_i s_{i+1} #+end_katex ==> \begin{katex} E = -J \sum_{i=1}^N s_i s_{i+1} \end{katex} Best regards, Juan Manuel