From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 MGZ0NiZhK2KZlQAAgWs5BA (envelope-from ) for ; Fri, 11 Mar 2022 15:48:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aJglLyZhK2KhGQEAG6o9tA (envelope-from ) for ; Fri, 11 Mar 2022 15:48:06 +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 9DE5C3C208 for ; Fri, 11 Mar 2022 15:48:05 +0100 (CET) Received: from localhost ([::1]:60726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSgYl-0003So-W9 for larch@yhetil.org; Fri, 11 Mar 2022 09:48:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSgWt-0001Re-2o for emacs-orgmode@gnu.org; Fri, 11 Mar 2022 09:46:07 -0500 Received: from zmta1.univ-littoral.fr ([195.220.130.150]:55920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSgWo-0005S3-8G for emacs-orgmode@gnu.org; Fri, 11 Mar 2022 09:46:06 -0500 Received: from localhost (localhost [127.0.0.1]) by zmta1.univ-littoral.fr (Postfix) with ESMTP id 900141403C2 for ; Fri, 11 Mar 2022 15:45:57 +0100 (CET) Received: from zmta1.univ-littoral.fr ([127.0.0.1]) by localhost (zmta1.univ-littoral.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id K0QPVcGTaun7 for ; Fri, 11 Mar 2022 15:45:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zmta1.univ-littoral.fr (Postfix) with ESMTP id 2A5941403C4 for ; Fri, 11 Mar 2022 15:45:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 zmta1.univ-littoral.fr 2A5941403C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=univ-littoral.fr; s=6CC8B4D8-72BE-11EC-B575-37C8EECE7675; t=1647009957; bh=D0xvRUJ9S5hn9VcVe+uao6t8FQ8mQ+eA5creU/pNT/M=; h=From:To:Date:Message-ID:MIME-Version; b=s6R7XP5AoJT7prDPKs2m/cENFODUAT+F0V4O82g5A7SCI1w1H/AkuiFzJnjdsYyzO hrA+ZPYS+oxBY3VvWjmv+bypsQZWHFiyQGU9ghuO6rPm4dFW8z0nUybPsws5D21eND lSUV4daUZmHYY/s94KOCw4dec1AH/R51dW0AtbyGQvLZooyHmCW0L4JX1QusW+fR8q WnaddB999Rr0lZOz8FFrZbV/yPprUu2iEjsn/5p2DCOfhtXpjCXOb4nTA51hfc8rS+ ZPF+N53rjAX1qltCfDtdYhdZXEUZ9Bcl+LNgiZYc7hvuC/TrElgPoP0Lc6C1o95lFk yJxglO/+dppKA== X-Virus-Scanned: amavisd-new at zmta1.univ-littoral.fr Received: from zmta1.univ-littoral.fr ([127.0.0.1]) by localhost (zmta1.univ-littoral.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id maopMI-O3yMX for ; Fri, 11 Mar 2022 15:45:57 +0100 (CET) Received: from drums-bis (flc16-h01-176-135-84-20.dsl.sta.abo.bbox.fr [176.135.84.20]) by zmta1.univ-littoral.fr (Postfix) with ESMTPSA id F319B1403C2 for ; Fri, 11 Mar 2022 15:45:56 +0100 (CET) From: =?utf-8?Q?Denis_Bitouz=C3=A9?= To: emacs-orgmode@gnu.org Subject: Export (to `LaTeX`) =?utf-8?Q?`~=E2=9F=A8code_snippet=E2=9F=A9~`?= into =?utf-8?Q?`=5Clstinline+=E2=9F=A8code_snippet=E2=9F=A9+`?= (just as does =?utf-8?Q?`src=5F=E2=9F=A8language=E2=9F=A9{=E2=9F=A8code_snippet?= =?utf-8?Q?=E2=9F=A9}`=29?= X-Url: http://gte.univ-littoral.fr/members/dbitouze/pub/latex X-Archive: encrypt Date: Fri, 11 Mar 2022 15:45:56 +0100 Message-ID: <87zglwbl97.fsf@example.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=195.220.130.150; envelope-from=denis.bitouze@univ-littoral.fr; helo=zmta1.univ-littoral.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647010086; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=D0xvRUJ9S5hn9VcVe+uao6t8FQ8mQ+eA5creU/pNT/M=; b=TfRTIszOsAWzcTfCiKn8ywfgfUd4eCERtI04J2SMKzZtdsC1VcxpLp3YbCRWT3arbH5Zy2 2ycapDq+0OV4XGafr+Fmhqd2Gf23yneKWeck96pb9Ujut66K9f63b1aWtOxMpdO2tCuddB 6jZXQfzuT2bNH7chsyaO9V3C3ZjjQakICuVFqwG+8wUfVrdWYnpBp5Z3blvc/EZde5XmW2 z0rHBTG7csm2oFhRfAg5m9s0EjKl+OIOFwfPPzV6vUCy+03Jv1TbKFfdq9L5pEYYiajKfK ScJnJ2IPSZea9+CP+QgRDSu7qDkOoGQ+1CGaVrDoHtAaPnvYjDOPXuQ7VnTQ/w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647010086; a=rsa-sha256; cv=none; b=l1rrC2DFVpdJO1iMj5m5yePz5LhXRj+wNTppmMrc6HFgHqvpsVSgryYZOM6MdncK4ehi2f +SFrvjNewYtu2DEDdyuIQq9+6xkHeNOPYsD9f+cSiTtj3txaaexVq7vmMdPSZaVHfd/TRX mi6XtIzwT0aFvO+M+UbhFmi11pkSBrXVkncBUh+3KX/J5Vu0n0SzY1RmTduCVNi7RnBVrx 0VrEfK2wSd7C6IS7pRCynjK7P7l9viwoSyXlEEyWrwcTrNfHFaBi8hYeFcy915M/sCCy0f 56FlcA5hT8kDpyIqz3m3qSm33sK+y+T+HOkixA2hR8e9GQ26HwBgwmDxZ+Xahw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=univ-littoral.fr header.s=6CC8B4D8-72BE-11EC-B575-37C8EECE7675 header.b=s6R7XP5A; dmarc=none; 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.88 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=univ-littoral.fr header.s=6CC8B4D8-72BE-11EC-B575-37C8EECE7675 header.b=s6R7XP5A; dmarc=none; 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: 9DE5C3C208 X-Spam-Score: -5.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: KjtkYDz9+5x8 Hi, here is a feature request about the LaTeX export (another one: the previous mine, https://list.orgmode.org/87zgmda67z.fsf@example.com/, sadly didn't get any answer). With `(setq org-latex-listings t)`, `src_=E2=9F=A8language=E2=9F=A9{=E2=9F= =A8code snippet=E2=9F=A9}` is exported from `org-mode` to `LaTeX` into `\lstinline[language=3D=E2=9F=A8language=E2=9F=A9]~=E2=9F=A8code snippet=E2= =9F=A9~` (here, `~` could be almost any token): so far, so good. But one could expect to get the same export with the usual `org-mode` syntax for code snippets: `~=E2=9F=A8code snippet=E2=9F=A9~` (this supposes= the =E2=9F=A8language=E2=9F=A9 to be declared globally), as in the following example: --8<---------------cut here---------------start------------->8--- #+OPTIONS: toc:nil title:nil #+LaTeX_HEADER: \usepackage{xcolor} #+LaTeX_HEADER: \usepackage{listings} #+LaTeX_HEADER: \lstset{language=3D[auto]lisp,basicstyle=3D\ttfamily,keywor= dstyle=3D\color{red}} #+PROPERTY: header-args :padline no :exports both :noweb yes :eval always src_lisp{defun} is fun! ~defun~ is fun! --8<---------------cut here---------------end--------------->8--- For this, it is possible to redefine the `org-latex-code` function: --8<---------------cut here---------------start------------->8--- ;; Inspired by https://emacs.stackexchange.com/q/70720/5267 (defun org-latex-code (code _contents info) "Transcode a CODE object from Org to LaTeX. CONTENTS is nil. INFO is a plist used as a communication channel." (format "\\lstinline+%s+" (org-element-property :value code))) --8<---------------cut here---------------end--------------->8--- but, IMHO, this should be the default. WDYT? --=20 Denis