From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mFsVBrYsvWCQBAEAgWs5BA (envelope-from ) for ; Sun, 06 Jun 2021 22:14:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KDV0AbYsvWDEfQAAbx9fmQ (envelope-from ) for ; Sun, 06 Jun 2021 20:14:46 +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 46CFF156D4 for ; Sun, 6 Jun 2021 22:14:45 +0200 (CEST) Received: from localhost ([::1]:54314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpzAS-00025Q-AN for larch@yhetil.org; Sun, 06 Jun 2021 16:14:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpzA1-00025A-Mh for emacs-orgmode@gnu.org; Sun, 06 Jun 2021 16:14:17 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:46201) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpz9y-0002Ls-Ez for emacs-orgmode@gnu.org; Sun, 06 Jun 2021 16:14:17 -0400 Received: (Authenticated sender: admin@nicolasgoaziou.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 9DACA20009; Sun, 6 Jun 2021 20:14:09 +0000 (UTC) From: Nicolas Goaziou To: Timothy Subject: Re: [BUG] LaTeX: verbatim cannot be used in caption References: <87k0n64zph.fsf@gmail.com> Mail-Followup-To: Timothy , org-mode-email Date: Sun, 06 Jun 2021 22:14:08 +0200 In-Reply-To: <87k0n64zph.fsf@gmail.com> (Timothy's message of "Mon, 07 Jun 2021 02:26:02 +0800") Message-ID: <87a6o2bvjj.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.200; envelope-from=mail@nicolasgoaziou.fr; helo=relay7-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: org-mode-email 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=1623010485; 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; bh=2MHp9V3Jrzrf47p7TST4cNsK1bIWJy1uJhEFEkSLPgw=; b=EYrXtU4gGPCWL3UEzPbxtufR9g6r9yaSZhxNALFpDclON20Kp25yw66rlKduBQ8nXiuln8 hWVJjRykjjLUe0eX6+wXX3F1jDMcqsFEIm1aUxLntGs7NTtc6AFLknZbzG44HMpd3/EWRs TdmVoEn/CmSCO2LUbdJ9sjjN8+0TQ56og/EbD9R8RRemLxe8HiLakWv+U/jk17c8C2e0yo C3JMLXGAPAYwNvdfFvTcbFRdn3gN1sS6+XoOXO+1lDgIUp3m03dD078HRmI++TIpTY6Tj1 pGHPx8J8JU2RJg7tEmvdFTvS1abLvdrL46sngQfgXLOuH6BTCLAmdu/GR7zSMA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623010485; a=rsa-sha256; cv=none; b=D09EcX4ODDtONmUacvPr1/x1Y7+VSL0iDpXFI1jhl006plloijk95mkB6TNSm/SIDBVdBZ uHW6lyzR7tB+PbN8u+RumEm7jykdbpGSUISuvCrB3vkT03LvAnYHU8V7THK3xLjI1nvAvK x3sYVaARwa2sMYQ6X0PPwbqWKvtuvz4g98mYVQSma7MVs8m8AVdRjyf9+YaPYgr+v3BFGr tvXNnPg1nxQlbDngFBGJC7OXG334XjIwiJkRIaHJg6E7KWxG7uh/H2ZkDbuaQcu4HsgGe7 /YRyxesMX8amTAPkuoybfpiaxIArOj6XWDkaC85Xn/qtc21lpW9XFIL54BuppQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 46CFF156D4 X-Spam-Score: -2.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: Bhhlt2GbsSG+ Hello, Timothy writes: > In exactly the same vein as > https://orgmode.org/list/87mtujfj8k.fsf@tecosaur.com/, verbatim text in > captions is very problematic with LaTeX (breaks compilation). > > I'd like to be submitting a patch instead of a bug, but I'm not sure > what the best method of addressing this within ox-latex.el is. > Do share if you have any ideas :) I guess the solution is like the problem you mentioned above. You can create a temporary back-end that exports code and verbatim objects as \textt, using `org-latex--protect-texttt' function. The calls to `org-export-data' at the end of `org-latex--caption/label-string' can use this back-end instead. I think it would be better to derive current back-end instead of `latex' like we did in `org-latex-headline'. You can get current back-end with (plist-get info :back-end). HTH, -- Nicolas Goaziou