From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gMbWHuT6ZmDeWAEAgWs5BA (envelope-from ) for ; Fri, 02 Apr 2021 13:07:16 +0200 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 AE/FGOT6ZmBQCQAA1q6Kng (envelope-from ) for ; Fri, 02 Apr 2021 11:07:16 +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 E6B89D42A for ; Fri, 2 Apr 2021 13:07:15 +0200 (CEST) Received: from localhost ([::1]:40070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSHdz-0006j6-2x for larch@yhetil.org; Fri, 02 Apr 2021 07:07:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRcYg-0008UK-8H for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 11:15:02 -0400 Received: from se1f-lax1.servconfig.com ([173.231.224.6]:50611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRcYd-0008NX-Np for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 11:15:01 -0400 Received: from biz215.inmotionhosting.com ([192.145.239.51]) by se1-lax1.servconfig.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1lRcYH-000UTo-TQ for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 11:14:55 -0400 Received: from [180.150.91.8] (port=55462 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 1lRcYG-00FMKt-TI for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 08:14:37 -0700 User-agent: mu4e 1.4.15; emacs 28.0.50 From: Timothy To: org-mode-email Subject: [PATCH] ox-latex: Replace \verb instances in headings with \texttt Date: Wed, 31 Mar 2021 23:14:35 +0800 Message-ID: <87mtujfj8k.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.25) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT9mIGapQpU1yYO62Uluk/xVPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5xiExUbNqvmdkLSOzf1W2Y3z8hkeSqZT0W1YMl0fRDa99cV PSoHm0W/3adFfiYl2ns1gCxicwqwaIv+Acs1gnaz/T4GcPvCLvSpAEEGy7kYxliK3gm3N53ijDzm +3YL8glMsdJeKEN5AWxsLnBRGh3Z+9ttxR97s+TeO39h+N6x9wRo87oeATC+hGtbNyLqD7+2x8IY nBNAocuBjUdXExwjoDm2qN3QrTttzefsEtutw5ya4EnB7foI3WDAWEIqQR6++xNtScGbh4/+BIAb OXbfzRrIdLp/AwmQcey+hPKVq9dnf3S1NcNv3U2dp/UbPvviEnzvvDcGs5qmm9XDE2pdZWZmIMWJ G2DzNierwWd45v2o1X92Cn4UU9JJ17dQkS7izDj4VfLGYhV5rU4pWppWzIndJvewrBLxFH/rMdOE aKeiqzwpJQJp5aGHp7lTCYrcG6hsRQZiAIgw+z837AqgX7ewI8e1h7RITgN14BHmGVt/ReJ9Mfhz zmbKTH7wI9GEU1utNskUAORCV2WFZX0jOKXM4Jr2s1wzwikzE0u2maTeVLW3pB0Q/PTyowo5Afv4 rwe99X3iW+WeLBnK04F2PCDV6HR5afjE/XgWTctgk0aMcDYdZ75kCTkFmjl8fO7vIUzTXkDAiiJi mGhLUFuS3wpvriFmPmsMKEYb4BlrOtn4ftpC6O/sPXSNe/OhFqUrUSvDfpbfkx1WbfKbU8vqGAAE wapezbGGa+722sjaMJMnvPwRBmdQxzcUovOJVZFRXxKF5tPxTxfD0dMN+t5ZEhApw5unjrNLIqpm yTcqfE81K7Mn3dW7cW+WhJKEMZBznonGHlV5dkwEQeCqCqd2rw06R6bxmsiw7FImj0yCexflwisS BvVzBIEQ3WlqbwrIW7Iogayn8ZtRCzzW/RGgORbv56tZn3arxsj+0ETJrmRCocjQL9Td+ZGFmhHY C7om6qPDNtCFNSWLWxwHmHGQO90Xhry7OoHIK26RsGtmhjEvuGslKTrRIXcXpFg5ivY= X-Report-Abuse-To: spam@se1-lax1.servconfig.com Received-SPF: pass client-ip=173.231.224.6; envelope-from=tec@tecosaur.com; helo=se1f-lax1.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, 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=1617361636; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=9MVDPZQxEx/eWTm4t1h5+fmDO7QOcUneaCEJA15920s=; b=biMjHlcewD1lEYy4GIZ1UREd6lFCpiVXRDhGxIXLQQOvKFgSshfuLWj8e4xrc0QqKw1kZ1 xJ3z0aCkf1NRerduCv4299E3mHBTe04+ioNcZDD+M8ioSXW05QyYuXW8ff5R3K5EXWurUo qMYguUUcw7wHCpeFfkUwKUhSgGQMVI8EItYRI7ojC/R9ZJ5k7L3XfZ7PXHBzNkd64wqczx uHINtFDEP/LF4WjL88FeiM1WjmOm8vVPIG0hHuTi9trhn5cmIf/S2Rjpulj9iqVsodddoD pFBHj9u1oW+GxNqwYrQhlC11KTSOYUX5iYxS1OVLe1LRFQQGzKkhvsCDw5gOMQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617361636; a=rsa-sha256; cv=none; b=lxavnyM/xIzFawQvAUoqbBJQ9IoWMXANGCnhbyKYucSVaWtTvMSWoEkqSFhJLBsoM5OLPA WZo5dso9enWBbZPe5vRVGalEnWaH79qg7sjLhVBMnoGwllAOmxYfgYwHS4j2rVo7e+zXkf HZJSAhod6qbuSWk0kTyLXWdQO5RBNZSksydLiGTJ+BqK3n0usZDNr5qnETwKmANQnlYT7Y K3UDJBy5UTeFPW75OVbDRi9+Hlp+PhmV95DPkY1fd4SPXKzyMFEtVeuJ3Qrt7wwIYjOey3 SDCX1SuYTKmxgYFFpQcoaZcBZDerDlrEaKmUO28rHtQfv/KVhIRS42uGAxuIFQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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: E6B89D42A X-Spam-Score: 0.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: EtgymGRwpUEN --=-=-= Content-Type: text/plain Hello again, This time with a smaller patch that works around LaTeX peculiarities. When LaTeX encounters \verb inside another command it's expanding, it can panic and compilation fails. This occurs inside \section commands, and so it's worth modifying the default header format function to convert any instances of \verb to \texttt, as that can actually compile successfully. See https://www.texfaq.org/FAQ-verbwithin for more info. -- Timothy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ox-latex-convert-verbatim-text-in-headings-to-tt.patch >From b15af4ac23fabe501121e0fd45de603367cb12ed 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index da3c3f815..8a2787a62 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2055,6 +2055,18 @@ (defun org-latex-format-headline-default-function (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))))))) (and tags (format "\\hfill{}\\textsc{%s}" (mapconcat #'org-latex--protect-text tags ":"))))) -- 2.30.1 --=-=-=--