From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 68cqMkHh9F+KbgAA0tVLHw (envelope-from ) for ; Tue, 05 Jan 2021 21:59:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WDJ6LUHh9F8tIAAA1q6Kng (envelope-from ) for ; Tue, 05 Jan 2021 21:59:29 +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 532ED9404D5 for ; Tue, 5 Jan 2021 21:59:29 +0000 (UTC) Received: from localhost ([::1]:44578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwuMS-0003yh-AH for larch@yhetil.org; Tue, 05 Jan 2021 16:59:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwuLh-0003xW-2F for emacs-orgmode@gnu.org; Tue, 05 Jan 2021 16:58:41 -0500 Received: from mout01.posteo.de ([185.67.36.65]:52571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwuLf-0005fb-B9 for emacs-orgmode@gnu.org; Tue, 05 Jan 2021 16:58:40 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3284F16005C for ; Tue, 5 Jan 2021 22:58:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1609883916; bh=/u0Sf9hkg1l+CrIuxnGtBdQ5v1ZflTDMWUqX+2CbmOg=; h=From:To:Cc:Subject:Date:From; b=B5iADdKTJZakezUZperQscGLiYGAfBs09R0thUjCwlUiEdxYG9si29psq6JK09WmV 8bIDXGOnXZMkSdK1egbTizCaBDe0ihiI8SZsuV3/0zw8deWD5JTJv5LKoyBcp19tf8 Fie+qy7Cnbznh6TuKj1mQAwGxawY0lJcMkKweYkXdlLn7dsRTaZqWe+AEfFVmQsKyI DTT1BgupbCsl8Ww75qezYFr7YcGZ2sdrQ5cMyGNGRlif0FgsA3ItpBbPcU3kyRUNTj m4Nc0YCGqtqNZvLMqRC43udiaJCWLb8m8pLcPARM1nwG06UborT/THCQuYkRmHz69q HhfB+LH0+6UxA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4D9RG33W2xz6tmK; Tue, 5 Jan 2021 22:58:35 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Mart van de Wege Subject: Re: Inserting LaTex expressions using a filter fails References: <875z4bcjyz.fsf@gaheris.vdwege.eu> Date: Tue, 05 Jan 2021 22:58:33 +0100 In-Reply-To: <875z4bcjyz.fsf@gaheris.vdwege.eu> (Mart van de Wege's message of "Tue, 05 Jan 2021 19:33:08 +0100") Message-ID: <874kjvavw6.fsf@posteo.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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-Spam-Score: -3.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=B5iADdKT; dmarc=pass (policy=none) header.from=posteo.net; 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: 532ED9404D5 X-Spam-Score: -3.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: q4zDp9vX6lUQ Hello, Mart van de Wege writes: > I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2} during > export to LaTex, and obviously I'm doing something wrong, or I don't > understand the documentation. > > I use the following code to set up the filter: > > #+BIND: org-export-filter-item-functions (latex-replace-half) > #+BEGIN_SRC emacs-lisp :exports results :results none > > (defun latex-replace-half (text backend info) > (when (org-export-derived-backend-p backend 'latex) > (replace-regexp-in-string "=C2=BD" "\\sfrac{1}{2}" text))) > #+END_SRC You must add a double escape character to the backslash: ... (replace-regexp-in-string "=C2=BD" "\\\\sfrac{1}{2}" text))) ... Regards, Juan Manuel=20