From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +IdGETb7ZmB1WAEAgWs5BA (envelope-from ) for ; Fri, 02 Apr 2021 13:08:38 +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 EBAqCzb7ZmC+MwAAbx9fmQ (envelope-from ) for ; Fri, 02 Apr 2021 11:08:38 +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 B817C18C64 for ; Fri, 2 Apr 2021 13:08:37 +0200 (CEST) Received: from localhost ([::1]:46366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSHfI-0000xV-Sz for larch@yhetil.org; Fri, 02 Apr 2021 07:08:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lReG7-0000z0-1M for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 13:03:59 -0400 Received: from se4n-iad1.servconfig.com ([199.250.217.17]:34023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lReG3-0003Jn-C4 for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 13:03:58 -0400 Received: from biz215.inmotionhosting.com ([192.145.239.51]) by se4-iad1.servconfig.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1lReG0-000Mn2-8H for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 13:03:54 -0400 Received: from [180.150.91.8] (port=57186 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 1lReFz-001rqM-3K for emacs-orgmode@gnu.org; Wed, 31 Mar 2021 10:03:51 -0700 References: <87mtujfj8k.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: <87mtujfj8k.fsf@tecosaur.com> Date: Thu, 01 Apr 2021 01:03:49 +0800 Message-ID: <87blazfe6i.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: unsure X-SpamExperts-Outgoing-Evidence: Combined (0.33) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT+J6QVWW4I4JnMKLQjHFBxsPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5xiExUbNqvmdkLSOzf1W2Y3z8hkeSqZT0W1YMl0fRDa99cV PSoHm0W/3adFfiYl2nugbkzWqoyYCNZqtshgGS47/T4GcPvCLvSpAEEGy7kYxliK3gm3N53ijDzm +3YL8glMsdJeKEN5AWxsLnBRGh3Z+9ttxR97s+TeO39h+N6x9wRo87oeATC+hGtbNyLqD7/aSxs4 AQ25vcF4a8PWKauIoDm2qN3QrTttzefsEtutw9zZqrrsu03WRFccpjwfEvECZ7McMtbybAwv7WDG ymUz6cTrAfIBtLJVe62uoyOAUpYIiHqfCgG4wrA3w4/kQTYKxDHA9JN9J4k4XZq11JQkMemT4rxn nByU11Ftkqf3f/PF3GUV+KdBBqrnCX8j0Gi8Ksk+aedMfNWSnJswrtlNjgLjf+W9+Od3FppjIbpl 2L0u6idzMuZn3S2rshs9hEUgr/U0flMcy2Vi/IcBgY4arPaiJ1W6hAyiRC61jekdwIcXNugoOEbH RyFULpSjm7jZ1h/HfDRQ5Ig8VhPsPE8N4CjDohvY2lv1A3af86C0VNEVSpuciF3GryEUH73wIGGg A44j/0T1mbMZahN4GwQ9/Hsg/tpnX3zRzNRyZ9AHqNaDT8nZLGdHevWWyPSYg7btCB3G1CwpaI3Z 4ESkMWDVstAo3ykmSlgO7hcVlj7/dLmNQ/32qASrcCwj0vbqkVMRwusdS4GFqVHXFW5WReuVawzm P+W6Wc4NZ5X2w0rM/JmMSoApMcEP7dsYELO1UOZmMRr+w2X69ygMahiTQMBdAfDc2QL3uwLNoGb3 rhdixvoPFZIShBSdpVJW5HbjQTD0k1L2iNQA7kbf5p1C6Qnj7duugWgmqZHBDDH3Mm//g/VSoffW 7VAGp45zAgB9nKNjzpm0lxYA3q6cDY3g7yjrRH1hNwTDHehLmTlW0tbLmDBtUD9+Z7GHz/OHPkRS tyq2EZfcqxqBwWQHqA7FiTEGYzoQEQJvI4pHSb0rwDYLSQ== X-Report-Abuse-To: spam@se1-lax1.servconfig.com Received-SPF: pass client-ip=199.250.217.17; envelope-from=tec@tecosaur.com; helo=se4n-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, 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=1617361717; 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=9pVLFHYyfP6M8I7A8gaTypOaeTrQbVe7XYRoH9qaRHE=; b=MZmYodLc1Fklq+HcPDcu+e935SLUi017wgysXAwvsgylJcZiKOm6VEbqm0feV+HWF/GHpJ 2KHjF74C/y0KEU6peUftnHboJUH0nVjkK9xlWstVRNMmRbZcwNrHmSIYg/QKPzuUmFLosQ tbvcy4OQNyXFQv7CG6lYeXeuNRUoDj/DzBNorbQcXkO5dmLvjL8qAvjE6kDuR39DdjoWNY Zpj10Bfmo5MtCR4aTTnAPoigX/FM0cvhXZpi2n1rXh0kPNufUqZXKy1OnHmJVXmaUtkMLt wIwUqiov6oAZmZlmEUx07hnaR+2IfmxN+f8GDRWCuUcrW7Jwg24uM37fmCRVqw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617361717; a=rsa-sha256; cv=none; b=o3wXK9aUwtJqPwii/PEB2iZ6LkeCuQ1MMqb42eSD+UAfUfB1dVUb2y1rUtyVxE6izLtcys 1+K+lg+CF1YmalY2cuACmgHO/oe1dvdZIN8a1l57MFOcsmBFn29kv7JXcqxbQXa9sHIcu8 VhvpeZMvDraeTIi5K5T+ncywjtX9j70hGg3aR2PSCZskk6I4hhUU14vZkkVJaKFQo91Vf6 RAGWWGfSFtbDlWyishv6WKPrA6S++nL7M3Nx7qyX6YvArbr45CeV/FroCzg1Yj4R49JQ9K jTz6DcU5GJeJCY+e4dk7otOabLUqhHfy2/p2W0qeYTrjRTPqVV00QafSr3H2SQ== 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: B817C18C64 X-Spam-Score: 0.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: gCLSjjo0a/48 --=-=-= Content-Type: text/plain Ooops, I spotted a minor in my patch. Try this instead. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ox-latex-convert-verbatim-text-in-headings-to-tt.patch >From 1065e1ee71c1f169ca419f5cbfc94409088c44e6 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index da3c3f815..c00667f34 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2055,6 +2055,19 @@ (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)))))) + text) (and tags (format "\\hfill{}\\textsc{%s}" (mapconcat #'org-latex--protect-text tags ":"))))) -- 2.30.1 --=-=-=--