[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] lisp/ox-latex.el: improve org-latex-toc-command docstring
From: |
gerard . vermeulen |
Subject: |
[PATCH] lisp/ox-latex.el: improve org-latex-toc-command docstring |
Date: |
Wed, 31 Jan 2024 17:57:29 +0000 |
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
0001-lisp-ox-latex.el-improve-org-latex-toc-command-docst.patch
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] lisp/ox-latex.el: improve org-latex-toc-command docstring,
gerard . vermeulen <=