From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uHMcMD6KumW6HgAA62LTzQ:P1 (envelope-from ) for ; Wed, 31 Jan 2024 18:58:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id uHMcMD6KumW6HgAA62LTzQ (envelope-from ) for ; Wed, 31 Jan 2024 18:58:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Lk05iopY; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706723902; 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:dkim-signature; bh=2wbZDUUQlt7ao1x/z62noDanEJ+V8RbfVvwqpmfdOJA=; b=socJweKHIgWkaTcv42KECY8ADTOn4aOx7Kr4qMXFbks93PzLi0MxzM4kvSK38SLUUKfWiD zt14EKzlIlqQBUxF1F/SUTKMaGXnomPA+W8DlC7g1HSlav2LQVBiLeoV7/RDFf4b04UvyM pzWZRMjxqVixahlpXcy+MBOSLoKKajWh+0JLHk+bTf2l8+qjpDL7OgYtdIFuACJzRzGfhX dS3yoABiyA41ZFN3Q9bsvkJ5IZAT2SC3ADzazzYw0vWDJvCEhHlm+MK2eYQKqjZMgoBICS SifZoYlk0j6tZK815/E0Ul6+TAIgfNqZjkbg3oYlEthbqJWZho9V+J0+Ej38Qw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Lk05iopY; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706723902; a=rsa-sha256; cv=none; b=BIJDxHs3zLuYNDgcx5lzVl2wMRm1L7FQGRHwOgUTe4G5D3LKmQFgvEN0908S6kgyEhCzVE gQsUQygIt7XZZEPnkXSg7A78sEicL1JYvOunBHBBozMn/sB4PQYglrdgQjVTHJeXGuvCKo GmMZqRv65UtePIjqL/IvBivcObEWtNcwtii434JozU8Y+dAyUroUnm4YmdPq0MNGZJCUuD Q6tI4hdv+i6vULZcrynP8r2QSkKILpNymnKS3qceSSPzFQxW8V1BO3bl9Uh5fpA2gltjuR XTT2RoLLgY0vrRAAG98uXDgB6RWUhzxwSLza4OWBIVNqAm9VBLpU5u/hc99XAg== 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 A1FED218FC for ; Wed, 31 Jan 2024 18:58:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rVEqC-0005iy-Ld; Wed, 31 Jan 2024 12:57:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rVEq9-0005ii-S9 for emacs-orgmode@gnu.org; Wed, 31 Jan 2024 12:57:38 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rVEq7-00028T-2r for emacs-orgmode@gnu.org; Wed, 31 Jan 2024 12:57:37 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A7C01240101 for ; Wed, 31 Jan 2024 18:57:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1706723850; bh=BXLf3V7nXogKitGSiPFAagvPe7ebIDTw5Z0r9wgb0GQ=; h=MIME-Version:Content-Type:Date:From:To:Subject:Message-ID:From; b=Lk05iopY3bLyfoAjLifP3YTZw4BqOeZqGPUdrDMSz41lq3FCwqW8On5A2k5H6UDOY aTv3flOWtFfuk8PcQ14MwMvvlxUkOGVMLoZDvUmLDVvT/vY4uEAz3jTHoA+zuAcKhP WOsIounuBvW3k8AaJFW9A4exyIoZigmDE72ynAf11dauqUtA1z8NV/E7acwxIDwgao 2QF0WhU/rX4tvCRglHI+xo8z79WROdDKfohD8sQedt1G36P193MwThO9vIgXpu1G47 /EtyLBL0aP/R1NOhmZIJeEcb2xIm+9DOBAH3DcWBg79VpKbTOSoAWYKdsqu9vPUgS+ RJtYYu42218pQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TQ8rV0ZSSz6tyf; Wed, 31 Jan 2024 18:57:29 +0100 (CET) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_6ab45932e21b670874671c1a0d52253d" Date: Wed, 31 Jan 2024 17:57:29 +0000 From: gerard.vermeulen@posteo.net To: Emacs orgmode , Ihor Radchenko Subject: [PATCH] lisp/ox-latex.el: improve org-latex-toc-command docstring Message-ID: <5aea82a3f1b242f574578baefce57fcc@posteo.net> Received-SPF: pass client-ip=185.67.36.66; envelope-from=gerard.vermeulen@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.26 X-Spam-Score: -7.26 X-Migadu-Queue-Id: A1FED218FC X-Migadu-Scanner: mx12.migadu.com X-TUID: 5B73gsASzzQT --=_6ab45932e21b670874671c1a0d52253d Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hi, I have read the docstring of `org-latex-toc-command' too literally to discover that specifying anything else than "toc:nil" works. The attached patch contains a proposal for improvement. Below there is a not so small mwe. --- begin mwe --- #+title: Table of Contents Test #+latex_class: article #+options: author:nil date:nil toc:1 #+latex_header: \usepackage{listings} #+latex_header: \usepackage{minted} * Test ~toc:~ and ~org-latex-toc-command~ Anything else than ~toc:nil~ in ~#+options:~ above exports the TOC. #+caption: Execute this block before exporting to a LaTeX buffer or file. #+begin_src emacs-lisp :results silent (when (require 'ox-latex nil 'noerror) (setq-local org-latex-src-block-backend 'listings) (setq-local org-latex-toc-command (cond ((eq org-latex-src-block-backend 'verbatim) "\\tableofcontents\n\\vspace{10pt}\n") ((eq org-latex-src-block-backend 'listings) "\\tableofcontents\n\\lstlistoflistings\n\\vspace{10pt}\n") ((memq org-latex-src-block-backend '(minted engraved)) "\\tableofcontents\n\\listoflistings\n\\vspace{10pt}\n")))) #+end_src --- end mwe --- Regards -- Gerard --=_6ab45932e21b670874671c1a0d52253d Content-Transfer-Encoding: base64 Content-Type: application/octet-stream; name=0001-lisp-ox-latex.el-improve-org-latex-toc-command-docst.patch Content-Disposition: attachment; filename=0001-lisp-ox-latex.el-improve-org-latex-toc-command-docst.patch; size=1161 RnJvbSBkZjA1YWY3YjJhNDQyNTA2N2I4YTNlZTNjM2NmOGZiMzkyM2YxYzViIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBHZXJhcmQgVmVybWV1bGVuIDxnZXJhcmQudmVybWV1bGVuQHBv c3Rlby5uZXQ+CkRhdGU6IFdlZCwgMzEgSmFuIDIwMjQgMTg6Mjg6MzUgKzAxMDAKU3ViamVjdDog W1BBVENIXSBsaXNwL294LWxhdGV4LmVsOiBpbXByb3ZlIG9yZy1sYXRleC10b2MtY29tbWFuZCBk b2NzdHJpbmcKCiogbGlzcC9veC1sYXRleC5lbCAob3JnLWxhdGV4LXRvYy1jb21tYW5kKTogc3Bl Y2lmeSBjbGVhcmVyIHdoaWNoCm9wdGlvbiBzZXR0aW5ncyB1c2UgYG9yZy1sYXRleC10b2MtY29t bWFuZCcuICBUaGlzIHNob3dzIGFsc28gaG93CnRvIHNwZWNpZnkgYSB0YWJsZSBvZiBjb250ZW50 cyBkZXB0aC4KLS0tCiBsaXNwL294LWxhdGV4LmVsIHwgNSArKystLQogMSBmaWxlIGNoYW5nZWQs IDMgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNwL294LWxh dGV4LmVsIGIvbGlzcC9veC1sYXRleC5lbAppbmRleCBkZjIwMzQ1ZjguLjNlYjQwNzY2ZSAxMDA2 NDQKLS0tIGEvbGlzcC9veC1sYXRleC5lbAorKysgYi9saXNwL294LWxhdGV4LmVsCkBAIC02MjAs OCArNjIwLDkgQEAgd2hpY2ggaXMgcmVwbG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