From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6M20Deb6ZmCDVgEAgWs5BA (envelope-from ) for ; Fri, 02 Apr 2021 13:07:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8ASfB+b6ZmDDCAAA1q6Kng (envelope-from ) for ; Fri, 02 Apr 2021 11:07:18 +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 D83CFE77C for ; Fri, 2 Apr 2021 13:07:17 +0200 (CEST) Received: from localhost ([::1]:40072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSHe0-0006j9-By for larch@yhetil.org; Fri, 02 Apr 2021 07:07:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRfHW-0001M4-3I for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 14:09:32 -0400 Received: from se6g-iad1.servconfig.com ([173.231.241.29]:43627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRfHG-0006e8-R6 for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 14:09:26 -0400 Received: from biz215.inmotionhosting.com ([192.145.239.51]) by se6-iad1.servconfig.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1lRfHD-0013yY-Oq for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 14:09:13 -0400 Received: from [180.150.91.8] (port=58170 helo=localhost) by biz215.inmotionhosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lRfHC-004Nv3-Ik for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 11:09:10 -0700 References: <87mtujfj8k.fsf@tecosaur.com> <87blazfe6i.fsf@tecosaur.com> User-agent: mu4e 1.4.15; emacs 28.0.50 From: Timothy To: org-mode-email Subject: Re: [PATCH] ox-latex: Replace \verb instances in headings with \texttt In-reply-to: <87blazfe6i.fsf@tecosaur.com> Date: Thu, 01 Apr 2021 02:09:09 +0800 Message-ID: <878s63fb5m.fsf@tecosaur.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Get-Message-Sender-Via: biz215.inmotionhosting.com: authenticated_id: tec@tecosaur.com X-Authenticated-Sender: biz215.inmotionhosting.com: tec@tecosaur.com X-Originating-IP: 192.145.239.51 X-SpamExperts-Domain: biz215.inmotionhosting.com X-SpamExperts-Username: 192.145.239.51 X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.22) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT8Vk/xqCdpYf+inOt8KhtHrPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5xiExUbNqvmdkLSOzf1W2Y3z8hkeSqZT0W1YMl0fRDa99cV PSoHm0W/3adFfiYl2nufEAFc/iP3Ph1N7XNcMtr2/T4GcPvCLvSpAEEGy7kYxliK3gm3N53ijDzm +3YL8glMsdJeKEN5AWxsLnBRGh3Z+9ttxR97s+TeO39h+N6x9wRo87oeATC+hGtbNyLqD79cX9mp boLU5NXrux+Ucr7+oDm2qN3QrTttzefsEtutw5ya4EnB7foI3WDAWEIqQR6++xNtScGbh4/+BIAb OXbfzRrIdLp/AwmQcey+hPKVq9dnf3S1NcNv3U2dp/UbPvviEnzvvDcGs5qmm9XDE2pdZWZmIMWJ G2DzNierwWd45v2o1X92Cn4UU9JJ17dQkS7izDj4VfLGYhV5rU4pWppWzIndJvewrBLxFH/rMdOE aKeiqzwpJQJp5aGHp7lTCYrcG6hsRQZiAIgw+z837AqgX7ewI8e1h7RITgN14BHmGVt/ReJ9Mfhz zmbKTH7wI9GEU1utNskUAORCV2WFZX0jjIMG83p/IH0bUF197sorKF7lLXQUcNAszDsnoUOr0Bjj CZB+trPXFBQX59ZFnDoKdb61PE5RKCTgk25wBKKClDgD/qH41dfbtLotmR3aBVpRyBl07OVp2D/S 9ogT8aIXGC2MiQURX8aHPcppCXYMmlAtEhxUWbr1tJ5gqImHlcgEdFNRMVuNoBr08U0QzseQFdAk Wyz+jV4JqK/+vQbx80HQafb2x2Th1nRYzkXYaFIhu1/rdU1t/SWu+yxj6TsA1/4G28eR/u9q/0jD 7Kl4vHSbzAfVUTrTBNfLaxl0Sa2ggSmFoojM+dNJydB2l4SlVgUVN12b1Ctfih74/Kdn2k4/fhUZ GjkvwzYwDZm/LTskATYQU4J7mqw6JaKO7FaYp6KrPCklAmnloYenuVMJijTmDyM+MpzGu6WUOIYv xxofW7sZcXCoO0A05IGUpFxrDuiMjPRTVWNyTJ7O0CWtBzEvuGslKTrRIXcXpFg5ivY= X-Report-Abuse-To: spam@se1-lax1.servconfig.com Received-SPF: pass client-ip=173.231.241.29; envelope-from=tec@tecosaur.com; helo=se6g-iad1.servconfig.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-Mailman-Approved-At: Fri, 02 Apr 2021 07:06:05 -0400 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: , 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=1617361637; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=+aTxKWQTD7yHVdS/ZJ/5yufgdF5+VAj/BUk2dJMx0Ik=; b=QlbibQQIQhHWTVbWZ9gu6nF98ueH5omtRiOMZNXtYj6GIiPzQ/XA+TT7Noij8phb6p/M5R 7jF64ZSkT1Bl6i1qHgCviORYxF/mVgBPAQzhEd9LcPIXtfOPGVYQxP6RXu4M87cXFxSwEp 3VcVumDFeUNUycw2n7yGFz2uePZs8JWOGf3nmW6kMnaSU5NkA6oR2m+Mmuei0VgR4Ixs5E Fz6hApYUoRfT+oO7bhHaLezctbktHR969KxSXl5rMZEFHpQ5LKGd0jrMH4HAtf2j2almuD /4IgIvC5XtPto3PeVm1tZS31LuyaZ8mEXI8nOcF8GzAvVti/L1thBwMgOnH9sA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617361637; a=rsa-sha256; cv=none; b=L6T3+NgTCQ15s7H9bO3/NQy4ogT7ABY2C4mcgCMrvZv6nFbfZLIyCRjxO1ldSMa9RVBil9 nutclCZDgzTRTXTlfdtvziG6WwX3tty5ip/Yl/XsG63AyvgewG8xpQQyZfet5Ne+Eb4ZcJ 6q+3zR1A9UNcra97FypIv6lZlUg89Y6LeYKjHsHlq5KlSAIDtU3O3tvTAutIneLakohrWz n9IAReIL7LJkUmneXHroKUt43eRcRjXkuRkLjBNAJK8+ECVEFLWtc47XivEixUHvGXCibI exobqIHj4Uct4lAdFw+OND8q94FwonX2NX9KcYg2ga7M+owADtTw3M4zzGed6Q== 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: 0.07 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: D83CFE77C X-Spam-Score: 0.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: hgWaK8IWnZDK --=-=-= Content-Type: text/plain ... and somehow I forgot to remove the old `text' :facepalm: Third time's the charm. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ox-latex-convert-verbatim-text-in-headings-to-tt.patch >From ee6ec00145c442804d945bae292c199689f626ed Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 31 Mar 2021 23:06:14 +0800 Subject: [PATCH] ox-latex: convert verbatim text in headings to tt * lisp/ox-latex.el (org-latex-format-headline-default-function): Convert any instances of \verb text with \texttt. This is required to work around LaTeX peculiarities that would otherwise cause compilation to fail (see the code comment for more information). --- lisp/ox-latex.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index da3c3f815..13de07728 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2054,7 +2054,19 @@ (defun org-latex-format-headline-default-function (concat (and todo (format "{\\bfseries\\sffamily %s} " todo)) (and priority (format "\\framebox{\\#%c} " priority)) - text + ;; LaTeX isn't happy when you try to use \verb inside the argument of other + ;; commands (like \section, etc.), and this causes compilation to fail. + ;; So, within headings it's a good idea to replace any instances of \verb + ;; with \texttt. + (replace-regexp-in-string + "\\\\verb\\(.\\).+?\\1" + (lambda (verb-string) + (replace-regexp-in-string + "\\\\" "\\\\\\\\" + (org-latex--text-markup (substring verb-string 6 -1) + 'code + '(:latex-text-markup-alist ((code . protectedtexttt)))))) + text) (and tags (format "\\hfill{}\\textsc{%s}" (mapconcat #'org-latex--protect-text tags ":"))))) -- 2.30.1 --=-=-=--