2023-04-20 12:11:19 +00:00
|
|
|
|
;;; ox-texinfo.el --- Texinfo Backend for Org Export Engine -*- lexical-binding: t; -*-
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2024-01-02 01:47:10 +00:00
|
|
|
|
;; Copyright (C) 2012-2024 Free Software Foundation, Inc.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; Author: Jonathan Leech-Pepin <jonathan.leechpepin at gmail dot com>
|
2023-12-30 17:01:48 +00:00
|
|
|
|
;; Keywords: outlines, hypermedia, calendar, text
|
2013-02-23 08:56:24 +00:00
|
|
|
|
|
2013-02-23 07:59:23 +00:00
|
|
|
|
;; This file is part of GNU Emacs.
|
2013-02-23 08:56:24 +00:00
|
|
|
|
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
2013-02-23 08:56:24 +00:00
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;; See Org manual for details.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2022-08-04 13:53:05 +00:00
|
|
|
|
(require 'org-macs)
|
|
|
|
|
(org-assert-version)
|
|
|
|
|
|
2016-07-25 13:59:28 +00:00
|
|
|
|
(require 'cl-lib)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(require 'ox)
|
2023-11-14 18:07:47 +00:00
|
|
|
|
(require 'org-element-ast)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2023-02-06 21:33:40 +00:00
|
|
|
|
(eval-when-compile (require 'subr-x))
|
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(defvar orgtbl-exp-regexp)
|
2022-03-26 15:46:47 +00:00
|
|
|
|
(defvar org-texinfo-supports-math--cache)
|
2012-09-09 11:08:52 +00:00
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2023-04-20 12:11:19 +00:00
|
|
|
|
;;; Define Backend
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(org-export-define-backend 'texinfo
|
|
|
|
|
'((bold . org-texinfo-bold)
|
|
|
|
|
(center-block . org-texinfo-center-block)
|
|
|
|
|
(clock . org-texinfo-clock)
|
|
|
|
|
(code . org-texinfo-code)
|
|
|
|
|
(drawer . org-texinfo-drawer)
|
|
|
|
|
(dynamic-block . org-texinfo-dynamic-block)
|
|
|
|
|
(entity . org-texinfo-entity)
|
|
|
|
|
(example-block . org-texinfo-example-block)
|
2014-09-08 09:57:27 +00:00
|
|
|
|
(export-block . org-texinfo-export-block)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(export-snippet . org-texinfo-export-snippet)
|
|
|
|
|
(fixed-width . org-texinfo-fixed-width)
|
|
|
|
|
(footnote-definition . org-texinfo-footnote-definition)
|
|
|
|
|
(footnote-reference . org-texinfo-footnote-reference)
|
|
|
|
|
(headline . org-texinfo-headline)
|
|
|
|
|
(inline-src-block . org-texinfo-inline-src-block)
|
|
|
|
|
(inlinetask . org-texinfo-inlinetask)
|
|
|
|
|
(italic . org-texinfo-italic)
|
|
|
|
|
(item . org-texinfo-item)
|
|
|
|
|
(keyword . org-texinfo-keyword)
|
2022-03-26 15:46:47 +00:00
|
|
|
|
(latex-environment . org-texinfo-latex-environment)
|
|
|
|
|
(latex-fragment . org-texinfo-latex-fragment)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(line-break . org-texinfo-line-break)
|
|
|
|
|
(link . org-texinfo-link)
|
2013-09-25 19:27:29 +00:00
|
|
|
|
(node-property . org-texinfo-node-property)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(paragraph . org-texinfo-paragraph)
|
|
|
|
|
(plain-list . org-texinfo-plain-list)
|
|
|
|
|
(plain-text . org-texinfo-plain-text)
|
|
|
|
|
(planning . org-texinfo-planning)
|
|
|
|
|
(property-drawer . org-texinfo-property-drawer)
|
|
|
|
|
(quote-block . org-texinfo-quote-block)
|
|
|
|
|
(radio-target . org-texinfo-radio-target)
|
|
|
|
|
(section . org-texinfo-section)
|
|
|
|
|
(special-block . org-texinfo-special-block)
|
|
|
|
|
(src-block . org-texinfo-src-block)
|
|
|
|
|
(statistics-cookie . org-texinfo-statistics-cookie)
|
2016-06-04 20:37:13 +00:00
|
|
|
|
(strike-through . org-texinfo-strike-through)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(subscript . org-texinfo-subscript)
|
|
|
|
|
(superscript . org-texinfo-superscript)
|
|
|
|
|
(table . org-texinfo-table)
|
|
|
|
|
(table-cell . org-texinfo-table-cell)
|
|
|
|
|
(table-row . org-texinfo-table-row)
|
|
|
|
|
(target . org-texinfo-target)
|
|
|
|
|
(template . org-texinfo-template)
|
|
|
|
|
(timestamp . org-texinfo-timestamp)
|
2016-06-04 20:37:13 +00:00
|
|
|
|
(underline . org-texinfo-underline)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(verbatim . org-texinfo-verbatim)
|
|
|
|
|
(verse-block . org-texinfo-verse-block))
|
2012-09-09 11:08:52 +00:00
|
|
|
|
:filters-alist
|
2015-05-26 07:22:53 +00:00
|
|
|
|
'((:filter-headline . org-texinfo--filter-section-blank-lines)
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(:filter-parse-tree . (org-texinfo--normalize-headlines
|
|
|
|
|
org-texinfo--separate-definitions))
|
2017-10-24 11:55:38 +00:00
|
|
|
|
(:filter-section . org-texinfo--filter-section-blank-lines)
|
|
|
|
|
(:filter-final-output . org-texinfo--untabify))
|
2012-09-09 11:08:52 +00:00
|
|
|
|
:menu-entry
|
2013-03-19 15:24:40 +00:00
|
|
|
|
'(?i "Export to Texinfo"
|
|
|
|
|
((?t "As TEXI file" org-texinfo-export-to-texinfo)
|
2015-05-25 21:55:00 +00:00
|
|
|
|
(?i "As INFO file" org-texinfo-export-to-info)
|
|
|
|
|
(?o "As INFO file and open"
|
|
|
|
|
(lambda (a s v b)
|
|
|
|
|
(if a (org-texinfo-export-to-info t s v b)
|
|
|
|
|
(org-open-file (org-texinfo-export-to-info nil s v b)))))))
|
2012-09-09 11:08:52 +00:00
|
|
|
|
:options-alist
|
2014-08-04 09:48:09 +00:00
|
|
|
|
'((:texinfo-filename "TEXINFO_FILENAME" nil nil t)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(:texinfo-class "TEXINFO_CLASS" nil org-texinfo-default-class t)
|
|
|
|
|
(:texinfo-header "TEXINFO_HEADER" nil nil newline)
|
|
|
|
|
(:texinfo-post-header "TEXINFO_POST_HEADER" nil nil newline)
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 21:09:19 +00:00
|
|
|
|
(:subtitle "SUBTITLE" nil nil parse)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(:subauthor "SUBAUTHOR" nil nil newline)
|
|
|
|
|
(:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t)
|
2024-03-05 19:15:55 +00:00
|
|
|
|
(:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t) ;Obsolete.
|
|
|
|
|
(:texinfo-dirname "TEXINFO_DIR_NAME" nil nil t)
|
2014-05-21 07:06:59 +00:00
|
|
|
|
(:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t)
|
2014-08-08 20:07:45 +00:00
|
|
|
|
(:texinfo-printed-title "TEXINFO_PRINTED_TITLE" nil nil t)
|
2014-05-21 07:06:59 +00:00
|
|
|
|
;; Other variables.
|
|
|
|
|
(:texinfo-classes nil nil org-texinfo-classes)
|
|
|
|
|
(:texinfo-format-headline-function nil nil org-texinfo-format-headline-function)
|
|
|
|
|
(:texinfo-node-description-column nil nil org-texinfo-node-description-column)
|
|
|
|
|
(:texinfo-active-timestamp-format nil nil org-texinfo-active-timestamp-format)
|
|
|
|
|
(:texinfo-inactive-timestamp-format nil nil org-texinfo-inactive-timestamp-format)
|
|
|
|
|
(:texinfo-diary-timestamp-format nil nil org-texinfo-diary-timestamp-format)
|
|
|
|
|
(:texinfo-link-with-unknown-path-format nil nil org-texinfo-link-with-unknown-path-format)
|
|
|
|
|
(:texinfo-tables-verbatim nil nil org-texinfo-tables-verbatim)
|
|
|
|
|
(:texinfo-table-scientific-notation nil nil org-texinfo-table-scientific-notation)
|
2017-06-14 17:11:33 +00:00
|
|
|
|
(:texinfo-table-default-markup nil nil org-texinfo-table-default-markup)
|
2014-05-21 07:06:59 +00:00
|
|
|
|
(:texinfo-text-markup-alist nil nil org-texinfo-text-markup-alist)
|
|
|
|
|
(:texinfo-format-drawer-function nil nil org-texinfo-format-drawer-function)
|
2022-01-31 23:45:40 +00:00
|
|
|
|
(:texinfo-format-inlinetask-function nil nil org-texinfo-format-inlinetask-function)
|
2022-03-26 15:46:47 +00:00
|
|
|
|
(:texinfo-compact-itemx nil "compact-itemx" org-texinfo-compact-itemx)
|
|
|
|
|
;; Redefine regular options.
|
|
|
|
|
(:with-latex nil "tex" org-texinfo-with-latex)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; User Configurable Variables
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defgroup org-export-texinfo nil
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Options for exporting Org mode files to Texinfo."
|
|
|
|
|
:tag "Org Export Texinfo"
|
2013-03-06 16:31:28 +00:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-08-15 20:00:20 +00:00
|
|
|
|
:group 'org-export)
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Preamble
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-03-19 09:24:30 +00:00
|
|
|
|
(defcustom org-texinfo-coding-system nil
|
2013-04-23 13:25:46 +00:00
|
|
|
|
"Default document encoding for Texinfo output.
|
|
|
|
|
|
2015-05-21 17:04:45 +00:00
|
|
|
|
If nil it will default to `buffer-file-coding-system'."
|
2013-03-19 09:24:30 +00:00
|
|
|
|
:type 'coding-system)
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-default-class "info"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"The default Texinfo class."
|
|
|
|
|
:type '(string :tag "Texinfo class"))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-classes
|
2012-08-15 20:00:20 +00:00
|
|
|
|
'(("info"
|
2014-08-04 09:47:40 +00:00
|
|
|
|
"@documentencoding AUTO\n@documentlanguage AUTO"
|
2017-10-08 07:55:06 +00:00
|
|
|
|
("@chapter %s" "@unnumbered %s" "@chapheading %s" "@appendix %s")
|
|
|
|
|
("@section %s" "@unnumberedsec %s" "@heading %s" "@appendixsec %s")
|
|
|
|
|
("@subsection %s" "@unnumberedsubsec %s" "@subheading %s"
|
|
|
|
|
"@appendixsubsec %s")
|
|
|
|
|
("@subsubsection %s" "@unnumberedsubsubsec %s" "@subsubheading %s"
|
|
|
|
|
"@appendixsubsubsec %s")))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Alist of Texinfo classes and associated header and structure.
|
2014-08-04 09:47:40 +00:00
|
|
|
|
If #+TEXINFO_CLASS is set in the buffer, use its value and the
|
2017-06-22 09:54:16 +00:00
|
|
|
|
associated information. Here is the structure of a class
|
|
|
|
|
definition:
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-09-17 23:08:20 +00:00
|
|
|
|
(class-name
|
2012-08-15 20:00:20 +00:00
|
|
|
|
header-string
|
2017-10-08 07:55:06 +00:00
|
|
|
|
(numbered-1 unnumbered-1 unnumbered-no-toc-1 appendix-1)
|
|
|
|
|
(numbered-2 unnumbered-2 unnumbered-no-toc-2 appendix-2)
|
2014-08-04 09:47:40 +00:00
|
|
|
|
...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The header string
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
The header string is inserted in the header of the generated
|
|
|
|
|
document, right after \"@setfilename\" and \"@settitle\"
|
|
|
|
|
commands.
|
|
|
|
|
|
|
|
|
|
If it contains the special string
|
|
|
|
|
|
|
|
|
|
\"@documentencoding AUTO\"
|
|
|
|
|
|
|
|
|
|
\"AUTO\" will be replaced with an appropriate coding system. See
|
|
|
|
|
`org-texinfo-coding-system' for more information. Likewise, if
|
|
|
|
|
the string contains the special string
|
|
|
|
|
|
|
|
|
|
\"@documentlanguage AUTO\"
|
|
|
|
|
|
|
|
|
|
\"AUTO\" will be replaced with the language defined in the
|
|
|
|
|
buffer, through #+LANGUAGE keyword, or globally, with
|
|
|
|
|
`org-export-default-language', which see.
|
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
The sectioning structure
|
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
|
|
The sectioning structure of the class is given by the elements
|
|
|
|
|
following the header string. For each sectioning level, a number
|
|
|
|
|
of strings is specified. A %s formatter is mandatory in each
|
2017-06-22 09:54:16 +00:00
|
|
|
|
section string and will be replaced by the title of the section."
|
2017-10-08 07:55:06 +00:00
|
|
|
|
:version "27.1"
|
|
|
|
|
:package-version '(Org . "9.2")
|
2012-08-15 20:00:20 +00:00
|
|
|
|
:type '(repeat
|
|
|
|
|
(list (string :tag "Texinfo class")
|
|
|
|
|
(string :tag "Texinfo header")
|
|
|
|
|
(repeat :tag "Levels" :inline t
|
|
|
|
|
(choice
|
2017-06-22 09:54:16 +00:00
|
|
|
|
(list :tag "Heading"
|
2017-10-08 07:55:06 +00:00
|
|
|
|
(string :tag " numbered")
|
|
|
|
|
(string :tag " unnumbered")
|
|
|
|
|
(string :tag "unnumbered-no-toc")
|
|
|
|
|
(string :tag " appendix")))))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Headline
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(defcustom org-texinfo-format-headline-function
|
|
|
|
|
'org-texinfo-format-headline-default-function
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Function to format headline text.
|
|
|
|
|
|
|
|
|
|
This function will be called with 5 arguments:
|
|
|
|
|
TODO the todo keyword (string or nil).
|
|
|
|
|
TODO-TYPE the type of todo (symbol: `todo', `done', nil)
|
|
|
|
|
PRIORITY the priority of the headline (integer or nil)
|
|
|
|
|
TEXT the main headline text (string).
|
|
|
|
|
TAGS the tags as a list of strings (list of strings or nil).
|
|
|
|
|
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
The function result will be used in the section format string."
|
|
|
|
|
:type 'function
|
2017-01-26 04:39:18 +00:00
|
|
|
|
:version "26.1"
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
:package-version '(Org . "8.3"))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Node listing (menu)
|
2013-02-25 15:44:18 +00:00
|
|
|
|
|
|
|
|
|
(defcustom org-texinfo-node-description-column 32
|
2014-08-03 22:17:20 +00:00
|
|
|
|
"Column at which to start the description in the node listings.
|
2013-02-25 15:44:18 +00:00
|
|
|
|
If a node title is greater than this length, the description will
|
|
|
|
|
be placed after the end of the title."
|
|
|
|
|
:type 'integer)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Timestamps
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-active-timestamp-format "@emph{%s}"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"A printf format string to be applied to active timestamps."
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-inactive-timestamp-format "@emph{%s}"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"A printf format string to be applied to inactive timestamps."
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-diary-timestamp-format "@emph{%s}"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"A printf format string to be applied to diary timestamps."
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Links
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-link-with-unknown-path-format "@indicateurl{%s}"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Format string for links with unknown path type."
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Tables
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-tables-verbatim nil
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"When non-nil, tables are exported verbatim."
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2018-03-30 20:16:56 +00:00
|
|
|
|
(defcustom org-texinfo-table-scientific-notation nil
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Format string to display numbers in scientific notation.
|
2017-06-07 20:38:02 +00:00
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
The format should have \"%s\" twice, for mantissa and exponent
|
|
|
|
|
\(i.e. \"%s\\\\times10^{%s}\").
|
|
|
|
|
|
|
|
|
|
When nil, no transformation is made."
|
|
|
|
|
:type '(choice
|
|
|
|
|
(string :tag "Format string")
|
2014-08-03 22:17:20 +00:00
|
|
|
|
(const :tag "No formatting" nil)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-06-14 17:11:33 +00:00
|
|
|
|
(defcustom org-texinfo-table-default-markup "@asis"
|
2017-06-07 20:38:02 +00:00
|
|
|
|
"Default markup for first column in two-column tables.
|
|
|
|
|
|
|
|
|
|
This should an indicating command, e.g., \"@code\", \"@kbd\" or
|
2017-06-14 17:11:33 +00:00
|
|
|
|
\"@samp\".
|
2017-06-07 20:38:02 +00:00
|
|
|
|
|
|
|
|
|
It can be overridden locally using the \":indic\" attribute."
|
2017-06-14 17:11:33 +00:00
|
|
|
|
:type 'string
|
|
|
|
|
:version "26.1"
|
|
|
|
|
:package-version '(Org . "9.1")
|
|
|
|
|
:safe #'stringp)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Text markup
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-texinfo-text-markup-alist '((bold . "@strong{%s}")
|
|
|
|
|
(code . code)
|
|
|
|
|
(italic . "@emph{%s}")
|
2017-06-06 22:00:31 +00:00
|
|
|
|
(verbatim . samp))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Alist of Texinfo expressions to convert text markup.
|
|
|
|
|
|
2016-06-04 20:37:13 +00:00
|
|
|
|
The key must be a symbol among `bold', `code', `italic',
|
|
|
|
|
`strike-through', `underscore' and `verbatim'. The value is
|
|
|
|
|
a formatting string to wrap fontified text with.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-06-06 22:00:31 +00:00
|
|
|
|
Value can also be set to the following symbols: `verb', `samp'
|
|
|
|
|
and `code'. With the first one, Org uses \"@verb\" to create
|
|
|
|
|
a format string and selects a delimiter character that isn't in
|
|
|
|
|
the string. For the other two, Org uses \"@samp\" or \"@code\"
|
|
|
|
|
to typeset and protects special characters.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-06-06 22:00:31 +00:00
|
|
|
|
When no association is found for a given markup, text is returned
|
|
|
|
|
as-is."
|
|
|
|
|
:version "26.1"
|
|
|
|
|
:package-version '(Org . "9.1")
|
2012-08-15 20:00:20 +00:00
|
|
|
|
:type 'alist
|
2016-06-04 20:37:13 +00:00
|
|
|
|
:options '(bold code italic strike-through underscore verbatim))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Drawers
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defcustom org-texinfo-format-drawer-function (lambda (_name contents) contents)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Function called to format a drawer in Texinfo code.
|
|
|
|
|
|
|
|
|
|
The function must accept two parameters:
|
|
|
|
|
NAME the drawer name, like \"LOGBOOK\"
|
|
|
|
|
CONTENTS the contents of the drawer.
|
|
|
|
|
|
|
|
|
|
The function should return the string to be exported.
|
|
|
|
|
|
2013-11-14 13:05:18 +00:00
|
|
|
|
The default function simply returns the value of CONTENTS."
|
|
|
|
|
:version "24.4"
|
2014-08-03 22:17:20 +00:00
|
|
|
|
:package-version '(Org . "8.2")
|
2012-08-15 20:00:20 +00:00
|
|
|
|
:type 'function)
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Inlinetasks
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(defcustom org-texinfo-format-inlinetask-function
|
|
|
|
|
'org-texinfo-format-inlinetask-default-function
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Function called to format an inlinetask in Texinfo code.
|
|
|
|
|
|
|
|
|
|
The function must accept six parameters:
|
|
|
|
|
TODO the todo keyword, as a string
|
|
|
|
|
TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
|
|
|
|
|
PRIORITY the inlinetask priority, as a string
|
|
|
|
|
NAME the inlinetask name, as a string.
|
|
|
|
|
TAGS the inlinetask tags, as a list of strings.
|
|
|
|
|
CONTENTS the contents of the inlinetask, as a string.
|
|
|
|
|
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
The function should return the string to be exported."
|
2012-08-15 20:00:20 +00:00
|
|
|
|
:type 'function)
|
|
|
|
|
|
2022-03-26 15:46:47 +00:00
|
|
|
|
;;;; LaTeX
|
|
|
|
|
|
|
|
|
|
(defcustom org-texinfo-with-latex (and org-export-with-latex 'detect)
|
|
|
|
|
"When non-nil, the Texinfo exporter attempts to process LaTeX math.
|
|
|
|
|
|
|
|
|
|
When set to t, the exporter will process LaTeX environments and
|
|
|
|
|
fragments as Texinfo \"@displaymath\" and \"@math\" commands
|
|
|
|
|
respectively. Alternatively, when set to `detect', the exporter
|
|
|
|
|
does so only if the installed version of Texinfo supports the
|
|
|
|
|
necessary commands."
|
2022-11-13 07:29:15 +00:00
|
|
|
|
:package-version '(Org . "9.6")
|
2022-03-26 15:46:47 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Detect" detect)
|
|
|
|
|
(const :tag "Yes" t)
|
|
|
|
|
(const :tag "No" nil)))
|
|
|
|
|
|
2022-01-31 23:45:40 +00:00
|
|
|
|
;;;; Itemx
|
|
|
|
|
|
|
|
|
|
(defcustom org-texinfo-compact-itemx nil
|
|
|
|
|
"Non-nil means certain items in description list become `@itemx'.
|
|
|
|
|
|
|
|
|
|
If this is non-nil and an item in a description list has no
|
|
|
|
|
body but is followed by another item, then the second item is
|
|
|
|
|
transcoded to `@itemx'. See info node `(org)Plain lists in
|
|
|
|
|
Texinfo export' for how to enable this for individual lists."
|
|
|
|
|
:package-version '(Org . "9.6")
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:safe t)
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Compilation
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-07-27 11:52:12 +00:00
|
|
|
|
(defcustom org-texinfo-info-process '("makeinfo --no-split %f")
|
2013-03-19 09:01:42 +00:00
|
|
|
|
"Commands to process a Texinfo file to an INFO file.
|
2016-11-27 11:07:11 +00:00
|
|
|
|
|
|
|
|
|
This is a list of strings, each of them will be given to the
|
|
|
|
|
shell as a command. %f in the command will be replaced by the
|
|
|
|
|
relative file name, %F by the absolute file name, %b by the file
|
|
|
|
|
base name (i.e. without directory and extension parts), %o by the
|
|
|
|
|
base directory of the file and %O by the absolute file name of
|
|
|
|
|
the output file."
|
2017-07-27 11:52:12 +00:00
|
|
|
|
:version "26.1"
|
|
|
|
|
:package-version '(Org . "9.1")
|
2012-08-15 20:00:20 +00:00
|
|
|
|
:type '(repeat :tag "Shell command sequence"
|
|
|
|
|
(string :tag "Shell command")))
|
|
|
|
|
|
2013-03-19 09:31:23 +00:00
|
|
|
|
(defcustom org-texinfo-logfiles-extensions
|
|
|
|
|
'("aux" "toc" "cp" "fn" "ky" "pg" "tp" "vr")
|
|
|
|
|
"The list of file extensions to consider as Texinfo logfiles.
|
|
|
|
|
The logfiles will be remove if `org-texinfo-remove-logfiles' is
|
|
|
|
|
non-nil."
|
|
|
|
|
:type '(repeat (string :tag "Extension")))
|
|
|
|
|
|
|
|
|
|
(defcustom org-texinfo-remove-logfiles t
|
|
|
|
|
"Non-nil means remove the logfiles produced by compiling a Texinfo file.
|
|
|
|
|
By default, logfiles are files with these extensions: .aux, .toc,
|
|
|
|
|
.cp, .fn, .ky, .pg and .tp. To define the set of logfiles to remove,
|
|
|
|
|
set `org-texinfo-logfiles-extensions'."
|
|
|
|
|
:group 'org-export-latex
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-02-14 16:59:03 +00:00
|
|
|
|
;;; Constants
|
2014-08-06 21:53:42 +00:00
|
|
|
|
|
2013-02-14 16:59:03 +00:00
|
|
|
|
(defconst org-texinfo-max-toc-depth 4
|
2014-08-11 00:11:32 +00:00
|
|
|
|
"Maximum depth for creation of detailed menu listings.
|
|
|
|
|
Beyond this depth, Texinfo will not recognize the nodes and will
|
|
|
|
|
cause errors. Left as a constant in case this value ever
|
|
|
|
|
changes.")
|
2013-02-14 16:59:03 +00:00
|
|
|
|
|
2013-11-11 09:09:21 +00:00
|
|
|
|
(defconst org-texinfo-supported-coding-systems
|
|
|
|
|
'("US-ASCII" "UTF-8" "ISO-8859-15" "ISO-8859-1" "ISO-8859-2" "koi8-r" "koi8-u")
|
|
|
|
|
"List of coding systems supported by Texinfo, as strings.
|
|
|
|
|
Specified coding system will be matched against these strings.
|
|
|
|
|
If two strings share the same prefix (e.g. \"ISO-8859-1\" and
|
|
|
|
|
\"ISO-8859-15\"), the most specific one has to be listed first.")
|
|
|
|
|
|
2015-05-25 22:55:13 +00:00
|
|
|
|
(defconst org-texinfo-inline-image-rules
|
|
|
|
|
(list (cons "file"
|
|
|
|
|
(regexp-opt '("eps" "pdf" "png" "jpg" "jpeg" "gif" "svg"))))
|
|
|
|
|
"Rules characterizing image files that can be inlined.")
|
|
|
|
|
|
2022-01-31 23:45:37 +00:00
|
|
|
|
(defvar org-texinfo--quoted-keys-regexp
|
|
|
|
|
(regexp-opt '("BS" "TAB" "RET" "ESC" "SPC" "DEL"
|
|
|
|
|
"LFD" "DELETE" "SHIFT" "Ctrl" "Meta" "Alt"
|
|
|
|
|
"Cmd" "Super" "UP" "LEFT" "RIGHT" "DOWN")
|
|
|
|
|
'words)
|
|
|
|
|
"Regexp matching keys that have to be quoted using @key{KEY}.")
|
|
|
|
|
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(defconst org-texinfo--definition-command-alist
|
|
|
|
|
'(("deffn Command" . "Command")
|
|
|
|
|
("defun" . "Function")
|
|
|
|
|
("defmac" . "Macro")
|
|
|
|
|
("defspec" . "Special Form")
|
|
|
|
|
("defvar" . "Variable")
|
|
|
|
|
("defopt" . "User Option")
|
|
|
|
|
(nil . "Key"))
|
|
|
|
|
"Alist mapping Texinfo definition commands to output in Info files.")
|
|
|
|
|
|
|
|
|
|
(defconst org-texinfo--definition-command-regexp
|
|
|
|
|
(format "\\`%s: \\(.+\\)"
|
|
|
|
|
(regexp-opt
|
|
|
|
|
(delq nil (mapcar #'cdr org-texinfo--definition-command-alist))
|
|
|
|
|
t))
|
|
|
|
|
"Regexp used to match definition commands in descriptive lists.")
|
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
;;; Internal Functions
|
|
|
|
|
|
2017-10-24 11:55:38 +00:00
|
|
|
|
(defun org-texinfo--untabify (s _backend _info)
|
|
|
|
|
"Remove TAB characters in string S."
|
|
|
|
|
(replace-regexp-in-string "\t" (make-string tab-width ?\s) s))
|
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo--filter-section-blank-lines (headline _backend _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Filter controlling number of blank lines after a section."
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" headline))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo--normalize-headlines (tree _backend info)
|
2014-08-08 23:54:51 +00:00
|
|
|
|
"Normalize headlines in TREE.
|
|
|
|
|
|
2023-04-20 12:11:19 +00:00
|
|
|
|
BACKEND is the symbol specifying backend used for export.
|
2021-09-16 10:32:43 +00:00
|
|
|
|
INFO is a plist used as a communication channel.
|
2014-08-08 23:54:51 +00:00
|
|
|
|
|
|
|
|
|
Make sure every headline in TREE contains a section, since those
|
2014-08-09 00:01:18 +00:00
|
|
|
|
are required to install a menu. Also put exactly one blank line
|
2014-08-14 09:44:52 +00:00
|
|
|
|
at the end of each section.
|
2014-08-08 23:54:51 +00:00
|
|
|
|
|
|
|
|
|
Return new tree."
|
|
|
|
|
(org-element-map tree 'headline
|
|
|
|
|
(lambda (hl)
|
2014-08-09 00:01:18 +00:00
|
|
|
|
(org-element-put-property hl :post-blank 1)
|
2014-08-08 23:54:51 +00:00
|
|
|
|
(let ((contents (org-element-contents hl)))
|
|
|
|
|
(when contents
|
|
|
|
|
(let ((first (org-element-map contents '(headline section)
|
|
|
|
|
#'identity info t)))
|
2023-05-16 10:41:53 +00:00
|
|
|
|
(unless (org-element-type-p first 'section)
|
2023-12-16 14:00:42 +00:00
|
|
|
|
(apply #'org-element-set-contents
|
|
|
|
|
hl
|
|
|
|
|
(org-element-create 'section `(:parent ,hl)) contents))))))
|
2014-08-08 23:54:51 +00:00
|
|
|
|
info)
|
|
|
|
|
tree)
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo--find-verb-separator (s)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Return a character not used in string S.
|
|
|
|
|
This is used to choose a separator for constructs like \\verb."
|
|
|
|
|
(let ((ll "~,./?;':\"|!@#%^&-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<>()[]{}"))
|
2016-07-25 13:59:28 +00:00
|
|
|
|
(cl-loop for c across ll
|
|
|
|
|
when (not (string-match (regexp-quote (char-to-string c)) s))
|
|
|
|
|
return (char-to-string c))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo--text-markup (text markup _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Format TEXT depending on MARKUP text markup.
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
INFO is a plist used as a communication channel. See
|
|
|
|
|
`org-texinfo-text-markup-alist' for details."
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(pcase (cdr (assq markup org-texinfo-text-markup-alist))
|
2017-06-06 22:00:31 +00:00
|
|
|
|
(`nil text) ;no markup: return raw text
|
|
|
|
|
(`code (format "@code{%s}" (org-texinfo--sanitize-content text)))
|
|
|
|
|
(`samp (format "@samp{%s}" (org-texinfo--sanitize-content text)))
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(`verb
|
|
|
|
|
(let ((separator (org-texinfo--find-verb-separator text)))
|
2017-06-06 22:00:31 +00:00
|
|
|
|
(format "@verb{%s%s%s}" separator text separator)))
|
2015-11-05 23:11:00 +00:00
|
|
|
|
;; Else use format string.
|
|
|
|
|
(fmt (format fmt text))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-06-06 00:05:09 +00:00
|
|
|
|
(defun org-texinfo--get-node (datum info)
|
|
|
|
|
"Return node or anchor associated to DATUM.
|
2017-11-05 09:32:13 +00:00
|
|
|
|
DATUM is a headline, a radio-target or a target. INFO is a plist
|
|
|
|
|
used as a communication channel. The function guarantees the
|
|
|
|
|
node or anchor name is unique."
|
2014-08-10 21:10:57 +00:00
|
|
|
|
(let ((cache (plist-get info :texinfo-node-cache)))
|
2017-06-06 00:05:09 +00:00
|
|
|
|
(or (cdr (assq datum cache))
|
2017-06-06 00:14:36 +00:00
|
|
|
|
(let* ((salt 0)
|
|
|
|
|
(basename
|
|
|
|
|
(org-texinfo--sanitize-node
|
2017-11-05 09:32:13 +00:00
|
|
|
|
(pcase (org-element-type datum)
|
|
|
|
|
(`headline
|
|
|
|
|
(org-texinfo--sanitize-title
|
|
|
|
|
(org-export-get-alt-title datum info) info))
|
|
|
|
|
(`radio-target
|
2019-01-21 17:40:54 +00:00
|
|
|
|
(org-export-data (org-element-contents datum) info))
|
2017-11-05 09:32:13 +00:00
|
|
|
|
(`target
|
2019-01-21 17:40:54 +00:00
|
|
|
|
(org-element-property :value datum))
|
|
|
|
|
(_
|
|
|
|
|
(or (org-element-property :name datum)
|
|
|
|
|
(org-export-get-reference datum info))))))
|
2017-06-06 00:14:36 +00:00
|
|
|
|
(name basename))
|
2017-11-05 11:22:18 +00:00
|
|
|
|
;; Org exports deeper elements before their parents. If two
|
|
|
|
|
;; node names collide -- e.g., they have the same title --
|
|
|
|
|
;; within the same hierarchy, the second one would get the
|
2021-04-19 12:32:53 +00:00
|
|
|
|
;; smaller node name. This is counter-intuitive.
|
|
|
|
|
;; Consequently, we ensure that every parent headline gets
|
|
|
|
|
;; its node beforehand. As a recursive operation, this
|
2017-11-05 11:22:18 +00:00
|
|
|
|
;; achieves the desired effect.
|
2023-05-18 11:35:35 +00:00
|
|
|
|
(let ((parent (org-element-lineage datum 'headline)))
|
2017-11-05 11:22:18 +00:00
|
|
|
|
(when (and parent (not (assq parent cache)))
|
|
|
|
|
(org-texinfo--get-node parent info)
|
|
|
|
|
(setq cache (plist-get info :texinfo-node-cache))))
|
2021-04-19 12:32:53 +00:00
|
|
|
|
;; Ensure NAME is unique and not reserved node name "Top",
|
|
|
|
|
;; no matter what case is used.
|
|
|
|
|
(while (or (string-equal "Top" (capitalize name))
|
|
|
|
|
(rassoc name cache))
|
2017-11-03 10:35:53 +00:00
|
|
|
|
(setq name (concat basename (format " (%d)" (cl-incf salt)))))
|
2017-06-06 00:05:09 +00:00
|
|
|
|
(plist-put info :texinfo-node-cache (cons (cons datum name) cache))
|
2014-08-10 21:10:57 +00:00
|
|
|
|
name))))
|
2012-08-23 13:20:02 +00:00
|
|
|
|
|
2014-08-10 21:10:57 +00:00
|
|
|
|
(defun org-texinfo--sanitize-node (title)
|
|
|
|
|
"Bend string TITLE to node line requirements.
|
|
|
|
|
Trim string and collapse multiple whitespace characters as they
|
2017-06-06 21:48:33 +00:00
|
|
|
|
are not significant. Replace leading left parenthesis, when
|
|
|
|
|
followed by a right parenthesis, with a square bracket. Remove
|
|
|
|
|
periods, commas and colons."
|
|
|
|
|
(org-trim
|
2014-08-10 21:10:57 +00:00
|
|
|
|
(replace-regexp-in-string
|
2017-06-06 21:48:33 +00:00
|
|
|
|
"[ \t]+" " "
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"[:,.]" ""
|
|
|
|
|
(replace-regexp-in-string "\\`(\\(.*?)\\)" "[\\1" title)))))
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo--sanitize-title (title info)
|
|
|
|
|
"Make TITLE suitable as a section name.
|
|
|
|
|
TITLE is a string or a secondary string. INFO is the current
|
|
|
|
|
export state, as a plist."
|
|
|
|
|
(org-export-data-with-backend
|
2017-10-24 08:07:50 +00:00
|
|
|
|
title (org-export-toc-entry-backend 'texinfo) info))
|
2012-08-23 14:50:24 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo--sanitize-content (text)
|
2014-08-10 20:55:20 +00:00
|
|
|
|
"Escape special characters in string TEXT.
|
|
|
|
|
Special characters are: @ { }"
|
2014-08-27 22:55:32 +00:00
|
|
|
|
(replace-regexp-in-string "[@{}]" "@\\&" text))
|
2012-08-23 14:50:24 +00:00
|
|
|
|
|
2015-05-26 07:37:43 +00:00
|
|
|
|
(defun org-texinfo--wrap-float (value info &optional type label caption short)
|
|
|
|
|
"Wrap string VALUE within a @float command.
|
|
|
|
|
INFO is the current export state, as a plist. TYPE is float
|
|
|
|
|
type, as a string. LABEL is the cross reference label for the
|
|
|
|
|
float, as a string. CAPTION and SHORT are, respectively, the
|
|
|
|
|
caption and shortcaption used for the float, as secondary
|
|
|
|
|
strings (e.g., returned by `org-export-get-caption')."
|
|
|
|
|
(let* ((backend
|
2017-10-24 08:07:50 +00:00
|
|
|
|
(org-export-toc-entry-backend 'texinfo
|
|
|
|
|
(cons 'footnote-reference
|
|
|
|
|
(lambda (f c i) (org-export-with-backend 'texinfo f c i)))))
|
2015-05-26 07:37:43 +00:00
|
|
|
|
(short-backend
|
2017-10-24 08:07:50 +00:00
|
|
|
|
(org-export-toc-entry-backend 'texinfo
|
|
|
|
|
'(inline-src-block . ignore)
|
|
|
|
|
'(verbatim . ignore)))
|
2015-05-26 07:37:43 +00:00
|
|
|
|
(short-str
|
|
|
|
|
(if (and short caption)
|
|
|
|
|
(format "@shortcaption{%s}\n"
|
|
|
|
|
(org-export-data-with-backend short short-backend info))
|
|
|
|
|
""))
|
|
|
|
|
(caption-str
|
|
|
|
|
(if (or short caption)
|
|
|
|
|
(format "@caption{%s}\n"
|
|
|
|
|
(org-export-data-with-backend
|
|
|
|
|
(or caption short)
|
|
|
|
|
(if (equal short-str "") short-backend backend)
|
|
|
|
|
info))
|
|
|
|
|
"")))
|
|
|
|
|
(format "@float %s%s\n%s\n%s%s@end float"
|
|
|
|
|
type (if label (concat "," label) "") value caption-str short-str)))
|
|
|
|
|
|
2021-04-09 20:29:50 +00:00
|
|
|
|
(defun org-texinfo--sectioning-structure (info)
|
|
|
|
|
"Return sectioning structure used in the document.
|
|
|
|
|
INFO is a plist holding export options."
|
|
|
|
|
(let ((class (plist-get info :texinfo-class)))
|
|
|
|
|
(pcase (assoc class (plist-get info :texinfo-classes))
|
|
|
|
|
(`(,_ ,_ . ,sections) sections)
|
|
|
|
|
(_ (user-error "Unknown Texinfo class: %S" class)))))
|
|
|
|
|
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(defun org-texinfo--separate-definitions (tree _backend info)
|
|
|
|
|
"Split up descriptive lists in TREE that contain Texinfo definition commands.
|
|
|
|
|
INFO is a plist used as a communication channel.
|
|
|
|
|
Return new tree."
|
|
|
|
|
(org-element-map tree 'plain-list
|
|
|
|
|
(lambda (plain-list)
|
|
|
|
|
(when (eq (org-element-property :type plain-list) 'descriptive)
|
|
|
|
|
(let ((contents (org-element-contents plain-list))
|
|
|
|
|
(items nil))
|
|
|
|
|
(dolist (item contents)
|
|
|
|
|
(pcase-let ((`(,cmd . ,args) (org-texinfo--match-definition item)))
|
|
|
|
|
(cond
|
|
|
|
|
(cmd
|
|
|
|
|
(when items
|
|
|
|
|
(org-texinfo--split-plain-list plain-list (nreverse items))
|
|
|
|
|
(setq items nil))
|
|
|
|
|
(org-texinfo--split-definition plain-list item cmd args))
|
|
|
|
|
(t
|
|
|
|
|
(when args
|
2022-01-31 23:45:40 +00:00
|
|
|
|
(org-texinfo--massage-key-item plain-list item args info))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(push item items)))))
|
|
|
|
|
(unless (org-element-contents plain-list)
|
2023-05-14 18:39:05 +00:00
|
|
|
|
(org-element-extract plain-list)))))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
info)
|
|
|
|
|
tree)
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo--match-definition (item)
|
|
|
|
|
"Return a cons-cell if ITEM specifies a Texinfo definition command.
|
|
|
|
|
The car is the command and the cdr is its arguments."
|
|
|
|
|
(let ((tag (car-safe (org-element-property :tag item))))
|
|
|
|
|
(and tag
|
|
|
|
|
(stringp tag)
|
|
|
|
|
(string-match org-texinfo--definition-command-regexp tag)
|
|
|
|
|
(pcase-let*
|
|
|
|
|
((cmd (car (rassoc (match-string-no-properties 1 tag)
|
2023-09-02 17:07:07 +00:00
|
|
|
|
org-texinfo--definition-command-alist)))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(`(,cmd ,category)
|
2023-09-02 17:07:07 +00:00
|
|
|
|
(and cmd (save-match-data (split-string cmd " "))))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(args (match-string-no-properties 2 tag)))
|
|
|
|
|
(cons cmd (if category (concat category " " args) args))))))
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo--split-definition (plain-list item cmd args)
|
|
|
|
|
"Insert a definition command before list PLAIN-LIST.
|
|
|
|
|
Replace list item ITEM with a special-block that inherits the
|
|
|
|
|
contents of ITEM and whose type and Texinfo attributes are
|
|
|
|
|
specified by CMD and ARGS."
|
|
|
|
|
(let ((contents (org-element-contents item)))
|
|
|
|
|
(org-element-insert-before
|
|
|
|
|
(apply #'org-element-create 'special-block
|
|
|
|
|
(list :type cmd
|
|
|
|
|
:attr_texinfo (list (format ":options %s" args))
|
|
|
|
|
:post-blank (if contents 1 0))
|
2023-05-14 18:39:05 +00:00
|
|
|
|
(mapc #'org-element-extract contents))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
plain-list))
|
2023-05-14 18:39:05 +00:00
|
|
|
|
(org-element-extract item))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
|
|
|
|
|
(defun org-texinfo--split-plain-list (plain-list items)
|
|
|
|
|
"Insert a new plain list before the plain list PLAIN-LIST.
|
|
|
|
|
Remove ITEMS from PLAIN-LIST and use them as the contents of the
|
|
|
|
|
new plain list."
|
|
|
|
|
(org-element-insert-before
|
|
|
|
|
(apply #'org-element-create 'plain-list
|
|
|
|
|
(list :type 'descriptive
|
|
|
|
|
:attr_texinfo (org-element-property :attr_texinfo plain-list)
|
|
|
|
|
:post-blank 1)
|
2023-05-14 18:39:05 +00:00
|
|
|
|
(mapc #'org-element-extract items))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
plain-list))
|
|
|
|
|
|
2022-01-31 23:45:40 +00:00
|
|
|
|
(defun org-texinfo--massage-key-item (plain-list item args info)
|
2022-01-31 23:45:39 +00:00
|
|
|
|
"In PLAIN-LIST modify ITEM based on ARGS.
|
|
|
|
|
|
|
|
|
|
Reformat ITEM's tag property and determine the arguments for the
|
|
|
|
|
`@findex' and `@kindex' commands for ITEM and store them in ITEM
|
|
|
|
|
using the `:findex' and `:kindex' properties.
|
|
|
|
|
|
|
|
|
|
If PLAIN-LIST is a description list whose `:compact' attribute is
|
|
|
|
|
non-nil and ITEM has no content but is followed by another item,
|
|
|
|
|
then store the `@findex' and `@kindex' values in the next item.
|
2022-06-30 15:33:03 +00:00
|
|
|
|
If the previous item stored its respective values in this item,
|
2022-01-31 23:45:40 +00:00
|
|
|
|
then move them to the next item.
|
|
|
|
|
|
|
|
|
|
INFO is a plist used as a communication channel."
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(let ((key nil)
|
|
|
|
|
(cmd nil))
|
|
|
|
|
(if (string-match (rx (+ " ")
|
|
|
|
|
"(" (group (+ (not (any "()")))) ")"
|
|
|
|
|
(* " ")
|
|
|
|
|
eos)
|
|
|
|
|
args)
|
|
|
|
|
(setq key (substring args 0 (match-beginning 0))
|
|
|
|
|
cmd (match-string 1 args))
|
|
|
|
|
(setq key args))
|
|
|
|
|
(org-element-put-property
|
|
|
|
|
item :tag
|
|
|
|
|
(cons (org-export-raw-string (org-texinfo-kbd-macro key t))
|
|
|
|
|
(and cmd `(" (" (code (:value ,cmd :post-blank 0)) ")"))))
|
|
|
|
|
(let ((findex (org-element-property :findex item))
|
|
|
|
|
(kindex (org-element-property :kindex item))
|
|
|
|
|
(next-item (org-export-get-next-element item nil))
|
|
|
|
|
(mx (string-prefix-p "M-x " key)))
|
|
|
|
|
(when (and (not cmd) mx)
|
|
|
|
|
(setq cmd (substring key 4)))
|
|
|
|
|
(when (and cmd (not (member cmd findex)))
|
|
|
|
|
(setq findex (nconc findex (list cmd))))
|
|
|
|
|
(unless mx
|
|
|
|
|
(setq kindex (nconc kindex (list key))))
|
|
|
|
|
(cond
|
|
|
|
|
((and next-item
|
2022-01-31 23:45:40 +00:00
|
|
|
|
(or (plist-get info :texinfo-compact-itemx)
|
|
|
|
|
(org-not-nil
|
|
|
|
|
(org-export-read-attribute :attr_texinfo plain-list :compact)))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(not (org-element-contents item))
|
2023-05-03 14:26:41 +00:00
|
|
|
|
(eq 1 (org-element-post-blank item)))
|
2022-01-31 23:45:39 +00:00
|
|
|
|
(org-element-put-property next-item :findex findex)
|
|
|
|
|
(org-element-put-property next-item :kindex kindex)
|
|
|
|
|
(org-element-put-property item :findex nil)
|
|
|
|
|
(org-element-put-property item :kindex nil))
|
|
|
|
|
(t
|
|
|
|
|
(org-element-set-contents
|
|
|
|
|
item
|
|
|
|
|
(nconc (mapcar (lambda (key) `(keyword (:key "KINDEX" :value ,key))) kindex)
|
|
|
|
|
(mapcar (lambda (cmd) `(keyword (:key "FINDEX" :value ,cmd))) findex)
|
|
|
|
|
(org-element-contents item))))))))
|
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;;; Template
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-template (contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Return complete document string after Texinfo conversion.
|
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
2014-08-05 08:52:14 +00:00
|
|
|
|
(let ((title (org-export-data (plist-get info :title) info))
|
|
|
|
|
;; Copying data is the contents of the first headline in
|
|
|
|
|
;; parse tree with a non-nil copying property.
|
|
|
|
|
(copying (org-element-map (plist-get info :parse-tree) 'headline
|
|
|
|
|
(lambda (hl)
|
|
|
|
|
(and (org-not-nil (org-element-property :COPYING hl))
|
|
|
|
|
(org-element-contents hl)))
|
|
|
|
|
info t)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(concat
|
2014-08-04 09:47:40 +00:00
|
|
|
|
"\\input texinfo @c -*- texinfo -*-\n"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"@c %**start of header\n"
|
2018-11-10 08:00:45 +00:00
|
|
|
|
(let ((file (or (org-strip-quotes (plist-get info :texinfo-filename))
|
2014-08-04 09:48:09 +00:00
|
|
|
|
(let ((f (plist-get info :output-file)))
|
|
|
|
|
(and f (concat (file-name-sans-extension f) ".info"))))))
|
|
|
|
|
(and file (format "@setfilename %s\n" file)))
|
2014-08-03 23:17:47 +00:00
|
|
|
|
(format "@settitle %s\n" title)
|
2014-08-04 09:47:40 +00:00
|
|
|
|
;; Insert class-defined header.
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(let ((header (nth 1 (assoc (plist-get info :texinfo-class)
|
|
|
|
|
org-texinfo-classes)))
|
|
|
|
|
(coding
|
|
|
|
|
(catch 'coding-system
|
|
|
|
|
(let ((case-fold-search t)
|
|
|
|
|
(name (symbol-name (or org-texinfo-coding-system
|
|
|
|
|
buffer-file-coding-system))))
|
|
|
|
|
(dolist (system org-texinfo-supported-coding-systems "UTF-8")
|
2016-07-25 13:21:12 +00:00
|
|
|
|
(when (string-match-p (regexp-quote system) name)
|
2014-08-04 09:47:40 +00:00
|
|
|
|
(throw 'coding-system system))))))
|
|
|
|
|
(language (plist-get info :language))
|
|
|
|
|
(case-fold-search nil))
|
|
|
|
|
;; Auto coding system.
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"^@documentencoding \\(AUTO\\)$"
|
|
|
|
|
coding
|
|
|
|
|
(replace-regexp-in-string
|
2020-02-18 21:57:37 +00:00
|
|
|
|
"^@documentlanguage \\(AUTO\\)$" language header t nil 1)
|
|
|
|
|
t nil 1)))
|
2014-08-05 08:52:14 +00:00
|
|
|
|
;; Additional header options set by #+TEXINFO_HEADER.
|
|
|
|
|
(let ((texinfo-header (plist-get info :texinfo-header)))
|
|
|
|
|
(and texinfo-header (org-element-normalize-string texinfo-header)))
|
|
|
|
|
"@c %**end of header\n\n"
|
|
|
|
|
;; Additional options set by #+TEXINFO_POST_HEADER.
|
|
|
|
|
(let ((texinfo-post-header (plist-get info :texinfo-post-header)))
|
|
|
|
|
(and texinfo-post-header
|
|
|
|
|
(org-element-normalize-string texinfo-post-header)))
|
2014-08-03 23:10:10 +00:00
|
|
|
|
;; Copying.
|
|
|
|
|
(and copying
|
|
|
|
|
(format "@copying\n%s@end copying\n\n"
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(org-export-data copying info))))
|
2024-03-05 19:15:55 +00:00
|
|
|
|
(let* ((dircat (or (plist-get info :texinfo-dircat) "Misc"))
|
|
|
|
|
(file (or (org-strip-quotes (plist-get info :texinfo-filename))
|
|
|
|
|
(plist-get info :output-file)))
|
|
|
|
|
(file (if file (file-name-sans-extension file)))
|
|
|
|
|
(dn (or (plist-get info :texinfo-dirname)
|
|
|
|
|
(plist-get info :texinfo-dirtitle))) ;Obsolete name.
|
|
|
|
|
;; Strip any terminating `.' from `dn'.
|
|
|
|
|
(dn (if (and dn (string-match "\\.\\'" dn)) (substring dn 0 -1) dn))
|
|
|
|
|
;; The direntry we need to produce has the shape:
|
|
|
|
|
;; * DIRNAME: NODE. DESCRIPTION.
|
|
|
|
|
;; where NODE is usually just `(FILENAME)', and where
|
|
|
|
|
;; `* FILENAME.' is a shorthand for `* FILENAME: (FILENAME).'
|
|
|
|
|
(dirname
|
|
|
|
|
(cond
|
|
|
|
|
((and dn (string-match
|
|
|
|
|
(eval-when-compile
|
|
|
|
|
(concat "\\`\\(?:"
|
|
|
|
|
"\\* \\(?1:.*\\)" ;Starts with `* ' or
|
|
|
|
|
"\\|\\(?1:.*(.*).*\\)" ;contains parens.
|
|
|
|
|
"\\)\\'"))
|
|
|
|
|
dn))
|
|
|
|
|
;; When users provide a `dn' that looks like a complete
|
|
|
|
|
;; `* DIRNAME: (FILENAME).' thingy, we just trust them to
|
|
|
|
|
;; provide something valid (just making sure it starts
|
|
|
|
|
;; with `* ' and ends with `.').
|
|
|
|
|
(format "* %s." (match-string 1 dn)))
|
|
|
|
|
;; `dn' is presumed to be just the DIRNAME part, so generate
|
|
|
|
|
;; either `* DIRNAME: (FILENAME).' or `* FILENAME.', whichever
|
|
|
|
|
;; is shortest.
|
|
|
|
|
((and dn (not (equal dn file)))
|
|
|
|
|
(format "* %s: (%s)." dn (or file dn)))
|
|
|
|
|
(t (format "* %s." file)))))
|
|
|
|
|
(concat "@dircategory " dircat "\n"
|
|
|
|
|
"@direntry\n"
|
|
|
|
|
(let ((dirdesc
|
|
|
|
|
(let ((desc (or (plist-get info :texinfo-dirdesc)
|
|
|
|
|
title)))
|
|
|
|
|
(cond ((not desc) nil)
|
|
|
|
|
((string-suffix-p "." desc) desc)
|
|
|
|
|
(t (concat desc "."))))))
|
|
|
|
|
(if dirdesc (format "%-23s %s" dirname dirdesc) dirname))
|
|
|
|
|
"\n"
|
|
|
|
|
"@end direntry\n\n"))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; Title
|
2014-08-05 08:52:14 +00:00
|
|
|
|
"@finalout\n"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"@titlepage\n"
|
ox: Optional export of title
* ox.el (org-export-with-title): New variable.
* ox (org-export-options-alist),
ox-ascii.el (org-ascii-template--document-title),
ox-beamer.el (org-beamer-template), ox-html.el (org-html-template),
ox-latex.el (org-latex-template), ox-man.el (org-man-template),
ox-odt.el (org-odt-template), ox-org.el (org-org-template),
ox-publish.el (org-publish-project-alist),
ox-texinfo.el (org-texinfo-template),
ox-groff.el (org-groff--mt-head): Use new variable.
* ox-koma-letter.el (org-koma-letter-use-title): Mark obsolete.
* test-ox.el (test-org-export/parse-option-keyword): Add :with-title.
* ORG-NEWS, org.texi: Mention org-export-with-title.
This is useful in e.g. ox-html where title can be set via
`org-html-preamble-template' or when using the {{{title}}}-macro.
2015-02-10 23:09:39 +00:00
|
|
|
|
(when (plist-get info :with-title)
|
2015-02-12 09:59:30 +00:00
|
|
|
|
(concat
|
2017-06-20 07:17:37 +00:00
|
|
|
|
(format "@title %s\n"
|
|
|
|
|
(or (plist-get info :texinfo-printed-title) title ""))
|
2015-02-12 09:59:30 +00:00
|
|
|
|
(let ((subtitle (plist-get info :subtitle)))
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 21:09:19 +00:00
|
|
|
|
(when subtitle
|
|
|
|
|
(format "@subtitle %s\n"
|
|
|
|
|
(org-export-data subtitle info))))))
|
2014-08-03 23:02:41 +00:00
|
|
|
|
(when (plist-get info :with-author)
|
|
|
|
|
(concat
|
|
|
|
|
;; Primary author.
|
|
|
|
|
(let ((author (org-string-nw-p
|
|
|
|
|
(org-export-data (plist-get info :author) info)))
|
|
|
|
|
(email (and (plist-get info :with-email)
|
|
|
|
|
(org-string-nw-p
|
|
|
|
|
(org-export-data (plist-get info :email) info)))))
|
|
|
|
|
(cond ((and author email)
|
|
|
|
|
(format "@author %s (@email{%s})\n" author email))
|
|
|
|
|
(author (format "@author %s\n" author))
|
|
|
|
|
(email (format "@author @email{%s}\n" email))))
|
|
|
|
|
;; Other authors.
|
|
|
|
|
(let ((subauthor (plist-get info :subauthor)))
|
|
|
|
|
(and subauthor
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(replace-regexp-in-string "^" "@author " subauthor))))))
|
2014-08-03 23:10:10 +00:00
|
|
|
|
(and copying "@page\n@vskip 0pt plus 1filll\n@insertcopying\n")
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"@end titlepage\n\n"
|
2014-08-03 23:12:45 +00:00
|
|
|
|
;; Table of contents.
|
|
|
|
|
(and (plist-get info :with-toc) "@contents\n\n")
|
2017-06-20 07:17:37 +00:00
|
|
|
|
;; Configure Top Node when not for TeX. Also include contents
|
|
|
|
|
;; from the first section of the document.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"@ifnottex\n"
|
|
|
|
|
"@node Top\n"
|
2014-08-04 00:31:36 +00:00
|
|
|
|
(format "@top %s\n" title)
|
2017-06-20 07:17:37 +00:00
|
|
|
|
(let* ((first-section
|
|
|
|
|
(org-element-map (plist-get info :parse-tree) 'section
|
|
|
|
|
#'identity info t '(headline)))
|
|
|
|
|
(top-contents
|
|
|
|
|
(org-export-data (org-element-contents first-section) info)))
|
|
|
|
|
(and (org-string-nw-p top-contents) (concat "\n" top-contents)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"@end ifnottex\n\n"
|
2014-08-05 08:52:14 +00:00
|
|
|
|
;; Menu.
|
2014-08-08 23:54:51 +00:00
|
|
|
|
(org-texinfo-make-menu (plist-get info :parse-tree) info 'master)
|
|
|
|
|
"\n"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; Document's body.
|
2014-08-05 08:52:14 +00:00
|
|
|
|
contents "\n"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; Creator.
|
2015-03-17 14:40:52 +00:00
|
|
|
|
(and (plist-get info :with-creator)
|
|
|
|
|
(concat (plist-get info :creator) "\n"))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; Document end.
|
2014-08-05 08:52:14 +00:00
|
|
|
|
"@bye")))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Transcode Functions
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Bold
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-bold (_bold contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode BOLD from Org to Texinfo.
|
|
|
|
|
CONTENTS is the text with bold markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(org-texinfo--text-markup contents 'bold info))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Center Block
|
2012-10-26 22:36:00 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-center-block (_center-block contents _info)
|
2012-10-26 22:36:00 +00:00
|
|
|
|
"Transcode a CENTER-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist used
|
|
|
|
|
as a communication channel."
|
2019-03-13 13:11:11 +00:00
|
|
|
|
(replace-regexp-in-string "\\(^\\).*?\\S-" "@center " contents nil nil 1))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Clock
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-clock (clock _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a CLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
(concat
|
|
|
|
|
"@noindent"
|
|
|
|
|
(format "@strong{%s} " org-clock-string)
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(format (plist-get info :texinfo-inactive-timestamp-format)
|
2014-12-03 16:09:43 +00:00
|
|
|
|
(concat (org-timestamp-translate (org-element-property :value clock))
|
2012-10-30 20:59:50 +00:00
|
|
|
|
(let ((time (org-element-property :duration clock)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(and time (format " (%s)" time)))))
|
|
|
|
|
"@*"))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Code
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-code (code _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a CODE object from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(org-texinfo--text-markup (org-element-property :value code) 'code info))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Drawer
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-drawer (drawer contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a DRAWER element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(let* ((name (org-element-property :drawer-name drawer))
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(output (funcall (plist-get info :texinfo-format-drawer-function)
|
2013-11-14 13:05:18 +00:00
|
|
|
|
name contents)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
output))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Dynamic Block
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-dynamic-block (_dynamic-block contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a DYNAMIC-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
2014-08-06 21:53:42 +00:00
|
|
|
|
holding contextual information."
|
2012-08-15 20:00:20 +00:00
|
|
|
|
contents)
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Entity
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-entity (entity _contents _info)
|
2017-06-08 19:16:43 +00:00
|
|
|
|
"Transcode an ENTITY object from Org to Texinfo."
|
2017-06-08 21:26:26 +00:00
|
|
|
|
;; Since there is not specific Texinfo entry in entities, use
|
|
|
|
|
;; Texinfo-specific commands whenever possible, and fallback to
|
|
|
|
|
;; UTF-8 otherwise.
|
|
|
|
|
(pcase (org-element-property :name entity)
|
|
|
|
|
("AElig" "@AE{}")
|
|
|
|
|
("aelig" "@ae{}")
|
|
|
|
|
((or "bull" "bullet") "@bullet{}")
|
|
|
|
|
("copy" "@copyright{}")
|
2017-06-17 10:04:36 +00:00
|
|
|
|
("deg" "@textdegree{}")
|
2017-06-08 21:26:26 +00:00
|
|
|
|
((or "dots" "hellip") "@dots{}")
|
|
|
|
|
("equiv" "@equiv{}")
|
|
|
|
|
((or "euro" "EUR") "@euro{}")
|
|
|
|
|
((or "ge" "geq") "@geq{}")
|
|
|
|
|
("laquo" "@guillemetleft{}")
|
|
|
|
|
("iexcl" "@exclamdown{}")
|
|
|
|
|
("imath" "@dotless{i}")
|
|
|
|
|
("iquest" "@questiondown{}")
|
|
|
|
|
("jmath" "@dotless{j}")
|
|
|
|
|
((or "le" "leq") "@leq{}")
|
|
|
|
|
("lsaquo" "@guilsinglleft{}")
|
|
|
|
|
("mdash" "---")
|
|
|
|
|
("minus" "@minus{}")
|
|
|
|
|
("nbsp" "@tie{}")
|
|
|
|
|
("ndash" "--")
|
|
|
|
|
("OElig" "@OE{}")
|
|
|
|
|
("oelig" "@oe{}")
|
|
|
|
|
("ordf" "@ordf{}")
|
|
|
|
|
("ordm" "@ordm{}")
|
|
|
|
|
("pound" "@pound{}")
|
|
|
|
|
("raquo" "@guillemetright{}")
|
|
|
|
|
((or "rArr" "Rightarrow") "@result{}")
|
2017-06-17 10:04:36 +00:00
|
|
|
|
("reg" "@registeredsymbol{}")
|
2017-06-08 21:26:26 +00:00
|
|
|
|
((or "rightarrow" "to" "rarr") "@arrow{}")
|
|
|
|
|
("rsaquo" "@guilsinglright{}")
|
|
|
|
|
("thorn" "@th{}")
|
|
|
|
|
("THORN" "@TH{}")
|
2017-06-17 10:04:36 +00:00
|
|
|
|
((and (pred (string-prefix-p "_")) name) ;spacing entities
|
2017-06-08 21:26:26 +00:00
|
|
|
|
(format "@w{%s}" (substring name 1)))
|
|
|
|
|
(_ (org-element-property :utf-8 entity))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Example Block
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-example-block (example-block _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode an EXAMPLE-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2017-06-09 20:03:08 +00:00
|
|
|
|
(format "@example\n%s@end example"
|
|
|
|
|
(org-texinfo--sanitize-content
|
|
|
|
|
(org-export-format-code-default example-block info))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-09-08 09:57:27 +00:00
|
|
|
|
;;; Export Block
|
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-export-block (export-block _contents _info)
|
2014-09-08 09:57:27 +00:00
|
|
|
|
"Transcode a EXPORT-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(when (string= (org-element-property :type export-block) "TEXINFO")
|
|
|
|
|
(org-remove-indentation (org-element-property :value export-block))))
|
|
|
|
|
|
|
|
|
|
;;; Export Snippet
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-export-snippet (export-snippet _contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a EXPORT-SNIPPET object from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(when (eq (org-export-snippet-backend export-snippet) 'texinfo)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(org-element-property :value export-snippet)))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Fixed Width
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-fixed-width (fixed-width _contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a FIXED-WIDTH element from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2018-07-01 22:24:38 +00:00
|
|
|
|
(format "@example\n%s\n@end example"
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(org-remove-indentation
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-texinfo--sanitize-content
|
2012-08-23 14:50:24 +00:00
|
|
|
|
(org-element-property :value fixed-width)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Footnote Reference
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-footnote-reference (footnote _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Create a footnote reference for FOOTNOTE.
|
|
|
|
|
|
|
|
|
|
FOOTNOTE is the footnote to define. CONTENTS is nil. INFO is a
|
|
|
|
|
plist holding contextual information."
|
2021-04-12 22:27:45 +00:00
|
|
|
|
(let* ((contents (org-export-get-footnote-definition footnote info))
|
|
|
|
|
(data (org-export-data contents info)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(format "@footnote{%s}"
|
2021-04-12 22:27:45 +00:00
|
|
|
|
;; It is invalid to close a footnote on a line starting
|
|
|
|
|
;; with "@end". As a safety net, we leave a newline
|
|
|
|
|
;; character before the closing brace. However, when the
|
|
|
|
|
;; footnote ends with a paragraph, it is visually pleasing
|
|
|
|
|
;; to move the brace right after its end.
|
2023-05-16 10:41:53 +00:00
|
|
|
|
(if (org-element-type-p (org-last contents) 'paragraph)
|
2021-04-12 22:27:45 +00:00
|
|
|
|
(org-trim data)
|
|
|
|
|
data))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Headline
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-headline (headline contents info)
|
2013-02-23 12:47:44 +00:00
|
|
|
|
"Transcode a HEADLINE element from Org to Texinfo.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2017-10-08 07:55:06 +00:00
|
|
|
|
(cond
|
|
|
|
|
((org-element-property :footnote-section-p headline) nil)
|
|
|
|
|
((org-not-nil (org-export-get-node-property :COPYING headline t)) nil)
|
|
|
|
|
(t
|
|
|
|
|
(let* ((index (let ((i (org-export-get-node-property :INDEX headline t)))
|
|
|
|
|
(and (member i '("cp" "fn" "ky" "pg" "tp" "vr")) i)))
|
|
|
|
|
(numbered? (org-export-numbered-headline-p headline info))
|
|
|
|
|
(notoc? (org-export-excluded-from-toc-p headline info))
|
|
|
|
|
(command
|
|
|
|
|
(and
|
2021-04-09 20:29:50 +00:00
|
|
|
|
(not (org-export-low-level-p headline info))
|
|
|
|
|
(let ((sections (org-texinfo--sectioning-structure info)))
|
|
|
|
|
(pcase (nth (1- (org-export-get-relative-level headline info))
|
|
|
|
|
sections)
|
|
|
|
|
(`(,numbered ,unnumbered ,unnumbered-no-toc ,appendix)
|
|
|
|
|
(cond
|
|
|
|
|
((org-not-nil
|
|
|
|
|
(org-export-get-node-property :APPENDIX headline t))
|
|
|
|
|
appendix)
|
|
|
|
|
(numbered? numbered)
|
|
|
|
|
(index unnumbered)
|
|
|
|
|
(notoc? unnumbered-no-toc)
|
|
|
|
|
(t unnumbered)))
|
|
|
|
|
(`nil nil)
|
|
|
|
|
(_ (user-error "Invalid Texinfo class specification: %S"
|
|
|
|
|
(plist-get info :texinfo-class)))))))
|
2017-10-08 07:55:06 +00:00
|
|
|
|
(todo
|
|
|
|
|
(and (plist-get info :with-todo-keywords)
|
|
|
|
|
(let ((todo (org-element-property :todo-keyword headline)))
|
|
|
|
|
(and todo (org-export-data todo info)))))
|
|
|
|
|
(todo-type (and todo (org-element-property :todo-type headline)))
|
|
|
|
|
(tags (and (plist-get info :with-tags)
|
|
|
|
|
(org-export-get-tags headline info)))
|
|
|
|
|
(priority (and (plist-get info :with-priority)
|
|
|
|
|
(org-element-property :priority headline)))
|
|
|
|
|
(text (org-texinfo--sanitize-title
|
|
|
|
|
(org-element-property :title headline) info))
|
|
|
|
|
(full-text
|
|
|
|
|
(funcall (plist-get info :texinfo-format-headline-function)
|
|
|
|
|
todo todo-type priority text tags))
|
|
|
|
|
(contents
|
|
|
|
|
(concat "\n"
|
|
|
|
|
(if (org-string-nw-p contents) (concat "\n" contents) "")
|
2021-04-10 10:28:08 +00:00
|
|
|
|
(and index (format "\n@printindex %s\n" index))))
|
|
|
|
|
(node (org-texinfo--get-node headline info)))
|
2017-10-08 07:55:06 +00:00
|
|
|
|
(if (not command)
|
2017-09-10 17:17:44 +00:00
|
|
|
|
(concat (and (org-export-first-sibling-p headline info)
|
|
|
|
|
(format "@%s\n" (if numbered? 'enumerate 'itemize)))
|
2021-04-10 10:28:08 +00:00
|
|
|
|
(format "@item\n@anchor{%s}%s\n" node full-text)
|
2017-09-10 17:17:44 +00:00
|
|
|
|
contents
|
|
|
|
|
(if (org-export-last-sibling-p headline info)
|
|
|
|
|
(format "@end %s" (if numbered? 'enumerate 'itemize))
|
2017-10-08 07:55:06 +00:00
|
|
|
|
"\n"))
|
|
|
|
|
(concat
|
2017-11-03 10:34:21 +00:00
|
|
|
|
;; Even if HEADLINE is using @subheading and al., leave an
|
|
|
|
|
;; anchor so cross-references in the Org document still work.
|
2021-04-10 10:28:08 +00:00
|
|
|
|
(format (if notoc? "@anchor{%s}\n" "@node %s\n") node)
|
2017-10-08 07:55:06 +00:00
|
|
|
|
(format command full-text)
|
|
|
|
|
contents))))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(defun org-texinfo-format-headline-default-function
|
2021-09-29 07:22:47 +00:00
|
|
|
|
(todo _todo-type priority text tags)
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
"Default format function for a headline.
|
|
|
|
|
See `org-texinfo-format-headline-function' for details."
|
2018-04-18 21:57:51 +00:00
|
|
|
|
(concat (and todo (format "@strong{%s} " todo))
|
|
|
|
|
(and priority (format "@emph{#%s} " priority))
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
text
|
2018-04-18 21:57:51 +00:00
|
|
|
|
(and tags (concat " " (org-make-tag-string tags)))))
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Inline Src Block
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-inline-src-block (inline-src-block _contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode an INLINE-SRC-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2017-06-06 22:14:35 +00:00
|
|
|
|
(format "@code{%s}"
|
|
|
|
|
(org-texinfo--sanitize-content
|
|
|
|
|
(org-element-property :value inline-src-block))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Inlinetask
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-inlinetask (inlinetask contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode an INLINETASK element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(let ((title (org-export-data (org-element-property :title inlinetask) info))
|
|
|
|
|
(todo (and (plist-get info :with-todo-keywords)
|
|
|
|
|
(let ((todo (org-element-property :todo-keyword inlinetask)))
|
|
|
|
|
(and todo (org-export-data todo info)))))
|
|
|
|
|
(todo-type (org-element-property :todo-type inlinetask))
|
|
|
|
|
(tags (and (plist-get info :with-tags)
|
|
|
|
|
(org-export-get-tags inlinetask info)))
|
|
|
|
|
(priority (and (plist-get info :with-priority)
|
|
|
|
|
(org-element-property :priority inlinetask))))
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(funcall (plist-get info :texinfo-format-inlinetask-function)
|
|
|
|
|
todo todo-type priority title tags contents)))
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo-format-inlinetask-default-function
|
2021-09-29 07:22:47 +00:00
|
|
|
|
(todo _todo-type priority title tags contents)
|
2018-02-16 20:16:15 +00:00
|
|
|
|
"Default format function for inlinetasks.
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
See `org-texinfo-format-inlinetask-function' for details."
|
|
|
|
|
(let ((full-title
|
|
|
|
|
(concat (when todo (format "@strong{%s} " todo))
|
|
|
|
|
(when priority (format "#%c " priority))
|
|
|
|
|
title
|
2018-04-18 21:57:51 +00:00
|
|
|
|
(when tags (org-make-tag-string tags)))))
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(format "@center %s\n\n%s\n" full-title contents)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Italic
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-italic (_italic contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode ITALIC from Org to Texinfo.
|
|
|
|
|
CONTENTS is the text with italic markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(org-texinfo--text-markup contents 'italic info))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Item
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-item (item contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode an ITEM element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2017-06-07 20:17:08 +00:00
|
|
|
|
(let* ((tag (org-element-property :tag item))
|
2023-05-03 12:56:35 +00:00
|
|
|
|
(plain-list (org-element-parent item))
|
2022-01-31 23:45:38 +00:00
|
|
|
|
(compact (and (eq (org-element-property :type plain-list) 'descriptive)
|
2022-01-31 23:45:40 +00:00
|
|
|
|
(or (plist-get info :texinfo-compact-itemx)
|
|
|
|
|
(org-not-nil (org-export-read-attribute
|
2023-05-03 12:56:35 +00:00
|
|
|
|
:attr_texinfo plain-list :compact)))))
|
2022-01-31 23:45:38 +00:00
|
|
|
|
(previous-item nil))
|
|
|
|
|
(when (and compact
|
|
|
|
|
(org-export-get-next-element item info)
|
|
|
|
|
(not (org-element-contents item))
|
2023-05-03 14:26:41 +00:00
|
|
|
|
(eq 1 (org-element-post-blank item)))
|
2022-01-31 23:45:38 +00:00
|
|
|
|
(org-element-put-property item :post-blank 0))
|
|
|
|
|
(if (and compact
|
|
|
|
|
(setq previous-item (org-export-get-previous-element item info))
|
|
|
|
|
(not (org-element-contents previous-item))
|
2023-05-03 14:26:41 +00:00
|
|
|
|
(eq 0 (org-element-post-blank previous-item)))
|
2022-01-31 23:45:38 +00:00
|
|
|
|
(format "@itemx%s\n%s"
|
|
|
|
|
(if tag (concat " " (org-export-data tag info)) "")
|
|
|
|
|
(or contents ""))
|
|
|
|
|
(let* ((split (org-string-nw-p (org-export-read-attribute
|
|
|
|
|
:attr_texinfo plain-list :sep)))
|
|
|
|
|
(items (and tag
|
|
|
|
|
(let ((tag (org-export-data tag info)))
|
|
|
|
|
(if split
|
|
|
|
|
(split-string tag (regexp-quote split)
|
|
|
|
|
t "[ \t\n]+")
|
|
|
|
|
(list tag))))))
|
|
|
|
|
(format "%s\n%s"
|
|
|
|
|
(pcase items
|
|
|
|
|
(`nil "@item")
|
|
|
|
|
(`(,item) (concat "@item " item))
|
|
|
|
|
(`(,item . ,items)
|
|
|
|
|
(concat "@item " item "\n"
|
|
|
|
|
(mapconcat (lambda (i) (concat "@itemx " i))
|
|
|
|
|
items
|
|
|
|
|
"\n"))))
|
|
|
|
|
(or contents ""))))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Keyword
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-keyword (keyword _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a KEYWORD element from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2017-06-18 09:00:56 +00:00
|
|
|
|
(let ((value (org-element-property :value keyword)))
|
2017-06-14 21:07:04 +00:00
|
|
|
|
(pcase (org-element-property :key keyword)
|
2017-06-18 09:00:56 +00:00
|
|
|
|
("TEXINFO" value)
|
2017-06-14 21:07:04 +00:00
|
|
|
|
("CINDEX" (format "@cindex %s" value))
|
|
|
|
|
("FINDEX" (format "@findex %s" value))
|
|
|
|
|
("KINDEX" (format "@kindex %s" value))
|
|
|
|
|
("PINDEX" (format "@pindex %s" value))
|
|
|
|
|
("TINDEX" (format "@tindex %s" value))
|
|
|
|
|
("VINDEX" (format "@vindex %s" value))
|
|
|
|
|
("TOC"
|
|
|
|
|
(cond ((string-match-p "\\<tables\\>" value)
|
|
|
|
|
(concat "@listoffloats "
|
|
|
|
|
(org-export-translate "Table" :utf-8 info)))
|
|
|
|
|
((string-match-p "\\<listings\\>" value)
|
|
|
|
|
(concat "@listoffloats "
|
|
|
|
|
(org-export-translate "Listing" :utf-8 info))))))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2022-03-26 15:46:47 +00:00
|
|
|
|
;;;; LaTeX Environment
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo-latex-environment (environment _contents info)
|
|
|
|
|
"Transcode a LaTeX ENVIRONMENT from Org to Texinfo.
|
|
|
|
|
CONTENTS is ignored. INFO is a plist holding contextual information."
|
|
|
|
|
(let ((with-latex (plist-get info :with-latex)))
|
|
|
|
|
(when (or (eq with-latex t)
|
|
|
|
|
(and (eq with-latex 'detect)
|
|
|
|
|
(org-texinfo-supports-math-p)))
|
|
|
|
|
(let ((value (org-element-property :value environment)))
|
|
|
|
|
(string-join (list "@displaymath"
|
|
|
|
|
(string-trim (org-remove-indentation value))
|
|
|
|
|
"@end displaymath")
|
|
|
|
|
"\n")))))
|
|
|
|
|
|
|
|
|
|
;;;; LaTeX Fragment
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo-latex-fragment (fragment _contents info)
|
|
|
|
|
"Transcode a LaTeX FRAGMENT from Org to Texinfo.
|
|
|
|
|
INFO is a plist holding contextual information."
|
|
|
|
|
(let ((with-latex (plist-get info :with-latex)))
|
|
|
|
|
(when (or (eq with-latex t)
|
|
|
|
|
(and (eq with-latex 'detect)
|
|
|
|
|
(org-texinfo-supports-math-p)))
|
|
|
|
|
(let ((value (org-remove-indentation
|
|
|
|
|
(org-element-property :value fragment))))
|
|
|
|
|
(cond
|
|
|
|
|
((or (string-match-p "^\\\\\\[" value)
|
|
|
|
|
(string-match-p "^\\$\\$" value))
|
|
|
|
|
(concat "\n"
|
|
|
|
|
"@displaymath"
|
|
|
|
|
"\n"
|
|
|
|
|
(string-trim (substring value 2 -2))
|
|
|
|
|
"\n"
|
|
|
|
|
"@end displaymath"
|
|
|
|
|
"\n"))
|
|
|
|
|
((string-match-p "^\\$" value)
|
|
|
|
|
(concat "@math{"
|
|
|
|
|
(string-trim (substring value 1 -1))
|
|
|
|
|
"}"))
|
|
|
|
|
((string-match-p "^\\\\(" value)
|
|
|
|
|
(concat "@math{"
|
|
|
|
|
(string-trim (substring value 2 -2))
|
|
|
|
|
"}"))
|
|
|
|
|
(t value))))))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Line Break
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-line-break (_line-break _contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a LINE-BREAK object from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-12-12 21:48:06 +00:00
|
|
|
|
"@*\n")
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Link
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-06-05 23:25:14 +00:00
|
|
|
|
(defun org-texinfo--@ref (datum description info)
|
|
|
|
|
"Return @ref command for element or object DATUM.
|
2017-11-04 20:48:09 +00:00
|
|
|
|
DESCRIPTION is the printed name of the section, as a string, or
|
|
|
|
|
nil."
|
2017-06-05 23:25:14 +00:00
|
|
|
|
(let ((node-name (org-texinfo--get-node datum info))
|
2017-06-06 21:48:33 +00:00
|
|
|
|
;; Sanitize DESCRIPTION for cross-reference use. In
|
2017-11-04 20:48:09 +00:00
|
|
|
|
;; particular, remove colons as they seem to cause pain (even
|
|
|
|
|
;; within @asis{...}) to the Texinfo reader.
|
|
|
|
|
(title (and description
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"[ \t]*:+" ""
|
|
|
|
|
(replace-regexp-in-string "," "@comma{}" description)))))
|
|
|
|
|
(if (or (not title) (equal title node-name))
|
2017-06-05 23:25:14 +00:00
|
|
|
|
(format "@ref{%s}" node-name)
|
|
|
|
|
(format "@ref{%s, , %s}" node-name title))))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-link (link desc info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a LINK object from Org to Texinfo.
|
|
|
|
|
DESC is the description part of the link, or the empty string.
|
|
|
|
|
INFO is a plist holding contextual information. See
|
|
|
|
|
`org-export-data'."
|
2020-01-17 23:44:41 +00:00
|
|
|
|
(let* ((type (org-element-property :type link))
|
2020-06-05 13:57:15 +00:00
|
|
|
|
(raw-path (org-element-property :path link))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; Ensure DESC really exists, or set it to nil.
|
|
|
|
|
(desc (and (not (string= desc "")) desc))
|
2020-06-05 13:57:15 +00:00
|
|
|
|
(path (org-texinfo--sanitize-content
|
|
|
|
|
(cond
|
|
|
|
|
((string-equal type "file")
|
|
|
|
|
(org-export-file-uri raw-path))
|
2024-02-05 15:39:05 +00:00
|
|
|
|
(t (concat type ":" raw-path))))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(cond
|
2020-02-14 09:00:15 +00:00
|
|
|
|
((org-export-custom-protocol-maybe link desc 'texinfo info))
|
2015-05-25 22:55:13 +00:00
|
|
|
|
((org-export-inline-image-p link org-texinfo-inline-image-rules)
|
|
|
|
|
(org-texinfo--inline-image link info))
|
2014-08-27 22:55:32 +00:00
|
|
|
|
((equal type "radio")
|
|
|
|
|
(let ((destination (org-export-resolve-radio-link link info)))
|
|
|
|
|
(if (not destination) desc
|
2017-06-05 23:25:14 +00:00
|
|
|
|
(org-texinfo--@ref destination desc info))))
|
2014-08-27 22:55:32 +00:00
|
|
|
|
((member type '("custom-id" "id" "fuzzy"))
|
|
|
|
|
(let ((destination
|
|
|
|
|
(if (equal type "fuzzy")
|
|
|
|
|
(org-export-resolve-fuzzy-link link info)
|
|
|
|
|
(org-export-resolve-id-link link info))))
|
2016-07-25 13:59:28 +00:00
|
|
|
|
(pcase (org-element-type destination)
|
|
|
|
|
(`nil
|
2020-06-05 13:57:15 +00:00
|
|
|
|
(format org-texinfo-link-with-unknown-path-format path))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; Id link points to an external file.
|
2016-07-25 13:59:28 +00:00
|
|
|
|
(`plain-text
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(if desc (format "@uref{file://%s,%s}" destination desc)
|
|
|
|
|
(format "@uref{file://%s}" destination)))
|
2017-06-06 21:48:33 +00:00
|
|
|
|
((or `headline
|
|
|
|
|
;; Targets within headlines cannot be turned into
|
|
|
|
|
;; @anchor{}, so we refer to the headline parent
|
|
|
|
|
;; directly.
|
|
|
|
|
(and `target
|
2023-05-16 10:41:53 +00:00
|
|
|
|
(guard
|
|
|
|
|
(org-element-type-p
|
2023-05-03 12:56:35 +00:00
|
|
|
|
(org-element-parent destination)
|
2023-05-16 10:41:53 +00:00
|
|
|
|
'headline))))
|
2023-05-18 11:35:35 +00:00
|
|
|
|
(let ((headline (org-element-lineage destination 'headline t)))
|
2017-11-04 20:48:09 +00:00
|
|
|
|
(org-texinfo--@ref headline desc info)))
|
|
|
|
|
(_ (org-texinfo--@ref destination desc info)))))
|
2014-08-27 22:55:32 +00:00
|
|
|
|
((string= type "mailto")
|
|
|
|
|
(format "@email{%s}"
|
2020-06-05 13:57:15 +00:00
|
|
|
|
(concat path (and desc (concat ", " desc)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; External link with a description part.
|
2017-06-05 23:25:14 +00:00
|
|
|
|
((and path desc) (format "@uref{%s, %s}" path desc))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
;; External link without a description part.
|
|
|
|
|
(path (format "@uref{%s}" path))
|
|
|
|
|
;; No path, only description. Try to do something useful.
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(t
|
|
|
|
|
(format (plist-get info :texinfo-link-with-unknown-path-format) desc)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-05-25 22:55:13 +00:00
|
|
|
|
(defun org-texinfo--inline-image (link info)
|
|
|
|
|
"Return Texinfo code for an inline image.
|
|
|
|
|
LINK is the link pointing to the inline image. INFO is the
|
|
|
|
|
current state of the export, as a plist."
|
2023-05-18 11:33:15 +00:00
|
|
|
|
(let* ((parent (org-element-parent-element link))
|
2015-05-29 09:27:10 +00:00
|
|
|
|
(label (and (org-element-property :name parent)
|
|
|
|
|
(org-texinfo--get-node parent info)))
|
2015-05-25 22:55:13 +00:00
|
|
|
|
(caption (org-export-get-caption parent))
|
|
|
|
|
(shortcaption (org-export-get-caption parent t))
|
2015-05-26 07:18:00 +00:00
|
|
|
|
(path (org-element-property :path link))
|
2015-05-25 22:55:13 +00:00
|
|
|
|
(filename
|
|
|
|
|
(file-name-sans-extension
|
2021-04-30 13:50:25 +00:00
|
|
|
|
(if (file-name-absolute-p path)
|
|
|
|
|
(expand-file-name path)
|
|
|
|
|
(file-relative-name path))))
|
2015-05-26 07:18:00 +00:00
|
|
|
|
(extension (file-name-extension path))
|
2015-05-25 22:55:13 +00:00
|
|
|
|
(attributes (org-export-read-attribute :attr_texinfo parent))
|
|
|
|
|
(height (or (plist-get attributes :height) ""))
|
|
|
|
|
(width (or (plist-get attributes :width) ""))
|
|
|
|
|
(alt (or (plist-get attributes :alt) ""))
|
2015-05-26 07:18:00 +00:00
|
|
|
|
(image (format "@image{%s,%s,%s,%s,%s}"
|
|
|
|
|
filename width height alt extension)))
|
2015-05-29 09:27:10 +00:00
|
|
|
|
(cond ((or caption shortcaption)
|
|
|
|
|
(org-texinfo--wrap-float image
|
|
|
|
|
info
|
|
|
|
|
(org-export-translate "Figure" :utf-8 info)
|
|
|
|
|
label
|
|
|
|
|
caption
|
|
|
|
|
shortcaption))
|
|
|
|
|
(label (concat "@anchor{" label "}\n" image))
|
|
|
|
|
(t image))))
|
2015-05-25 22:55:13 +00:00
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Menu
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-08 23:54:51 +00:00
|
|
|
|
(defun org-texinfo-make-menu (scope info &optional master)
|
|
|
|
|
"Create the menu for inclusion in the Texinfo document.
|
|
|
|
|
|
|
|
|
|
SCOPE is a headline or a full parse tree. INFO is the
|
|
|
|
|
communication channel, as a plist.
|
|
|
|
|
|
|
|
|
|
When optional argument MASTER is non-nil, generate a master menu,
|
|
|
|
|
including detailed node listing."
|
|
|
|
|
(let ((menu (org-texinfo--build-menu scope info)))
|
|
|
|
|
(when (org-string-nw-p menu)
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(format
|
|
|
|
|
"@menu\n%s@end menu"
|
|
|
|
|
(concat menu
|
|
|
|
|
(when master
|
|
|
|
|
(let ((detailmenu
|
|
|
|
|
(org-texinfo--build-menu
|
|
|
|
|
scope info
|
|
|
|
|
(let ((toc-depth (plist-get info :with-toc)))
|
|
|
|
|
(if (wholenump toc-depth) toc-depth
|
|
|
|
|
org-texinfo-max-toc-depth)))))
|
|
|
|
|
(when (org-string-nw-p detailmenu)
|
|
|
|
|
(concat "\n@detailmenu\n"
|
|
|
|
|
"--- The Detailed Node Listing ---\n\n"
|
|
|
|
|
detailmenu
|
|
|
|
|
"@end detailmenu\n"))))))))))
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo--build-menu (scope info &optional level)
|
|
|
|
|
"Build menu for entries within SCOPE.
|
|
|
|
|
SCOPE is a headline or a full parse tree. INFO is a plist
|
|
|
|
|
containing contextual information. When optional argument LEVEL
|
|
|
|
|
is an integer, build the menu recursively, down to this depth."
|
|
|
|
|
(cond
|
|
|
|
|
((not level)
|
|
|
|
|
(org-texinfo--format-entries (org-texinfo--menu-entries scope info) info))
|
2017-11-03 11:21:56 +00:00
|
|
|
|
((zerop level) "\n")
|
2014-08-08 23:54:51 +00:00
|
|
|
|
(t
|
2017-11-03 11:21:56 +00:00
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (h)
|
|
|
|
|
(let ((entries (org-texinfo--menu-entries h info)))
|
|
|
|
|
(when entries
|
|
|
|
|
(concat
|
|
|
|
|
(format "%s\n\n%s\n"
|
|
|
|
|
(org-export-data (org-export-get-alt-title h info) info)
|
|
|
|
|
(org-texinfo--format-entries entries info))
|
|
|
|
|
(org-texinfo--build-menu h info (1- level))))))
|
|
|
|
|
(org-texinfo--menu-entries scope info)
|
|
|
|
|
""))))
|
2014-08-08 23:54:51 +00:00
|
|
|
|
|
|
|
|
|
(defun org-texinfo--format-entries (entries info)
|
|
|
|
|
"Format all direct menu entries in SCOPE, as a string.
|
|
|
|
|
SCOPE is either a headline or a full Org document. INFO is
|
|
|
|
|
a plist containing contextual information."
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (h)
|
2017-06-06 21:48:33 +00:00
|
|
|
|
(let* ((title
|
|
|
|
|
;; Colons are used as a separator between title and node
|
|
|
|
|
;; name. Remove them.
|
|
|
|
|
(replace-regexp-in-string
|
2021-04-01 15:10:52 +00:00
|
|
|
|
"[ \t]*:+" ""
|
2017-06-06 21:48:33 +00:00
|
|
|
|
(org-texinfo--sanitize-title
|
|
|
|
|
(org-export-get-alt-title h info) info)))
|
2014-08-08 23:54:51 +00:00
|
|
|
|
(node (org-texinfo--get-node h info))
|
|
|
|
|
(entry (concat "* " title ":"
|
|
|
|
|
(if (string= title node) ":"
|
|
|
|
|
(concat " " node ". "))))
|
|
|
|
|
(desc (org-element-property :DESCRIPTION h)))
|
|
|
|
|
(if (not desc) entry
|
|
|
|
|
(format (format "%%-%ds %%s" org-texinfo-node-description-column)
|
|
|
|
|
entry desc))))
|
|
|
|
|
entries "\n")))
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo--menu-entries (scope info)
|
|
|
|
|
"List direct children in SCOPE needing a menu entry.
|
|
|
|
|
SCOPE is a headline or a full parse tree. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(let* ((cache (or (plist-get info :texinfo-entries-cache)
|
|
|
|
|
(plist-get (plist-put info :texinfo-entries-cache
|
|
|
|
|
(make-hash-table :test #'eq))
|
|
|
|
|
:texinfo-entries-cache)))
|
|
|
|
|
(cached-entries (gethash scope cache 'no-cache)))
|
|
|
|
|
(if (not (eq cached-entries 'no-cache)) cached-entries
|
2021-06-02 15:21:15 +00:00
|
|
|
|
(let* ((sections (org-texinfo--sectioning-structure info))
|
|
|
|
|
(max-depth (length sections)))
|
2021-04-09 20:29:50 +00:00
|
|
|
|
(puthash scope
|
|
|
|
|
(cl-remove-if
|
|
|
|
|
(lambda (h)
|
|
|
|
|
(or (org-not-nil (org-export-get-node-property :COPYING h t))
|
2021-06-02 15:21:15 +00:00
|
|
|
|
(< max-depth (org-export-get-relative-level h info))))
|
2021-04-09 20:29:50 +00:00
|
|
|
|
(org-export-collect-headlines info 1 scope))
|
|
|
|
|
cache)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-09-25 19:27:29 +00:00
|
|
|
|
;;;; Node Property
|
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-node-property (node-property _contents _info)
|
2013-09-25 19:27:29 +00:00
|
|
|
|
"Transcode a NODE-PROPERTY element from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
(format "%s:%s"
|
|
|
|
|
(org-element-property :key node-property)
|
|
|
|
|
(let ((value (org-element-property :value node-property)))
|
|
|
|
|
(if value (concat " " value) ""))))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Paragraph
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-paragraph (_paragraph contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a PARAGRAPH element from Org to Texinfo.
|
|
|
|
|
CONTENTS is the contents of the paragraph, as a string. INFO is
|
|
|
|
|
the plist used as a communication channel."
|
2024-04-21 12:54:48 +00:00
|
|
|
|
;; Ensure that we do not create multiple paragraphs, when a single
|
|
|
|
|
;; paragraph is expected.
|
|
|
|
|
;; Multiple newlines may appear in CONTENTS, for example, when
|
|
|
|
|
;; certain objects are stripped from export, leaving single newlines
|
|
|
|
|
;; before and after.
|
|
|
|
|
(org-remove-blank-lines contents))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Plain List
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-plain-list (plain-list contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a PLAIN-LIST element from Org to Texinfo.
|
|
|
|
|
CONTENTS is the contents of the list. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(let* ((attr (org-export-read-attribute :attr_texinfo plain-list))
|
2017-06-07 20:38:02 +00:00
|
|
|
|
(indic (let ((i (or (plist-get attr :indic)
|
2017-06-14 17:11:33 +00:00
|
|
|
|
(plist-get info :texinfo-table-default-markup))))
|
2017-06-07 20:38:02 +00:00
|
|
|
|
;; Allow indicating commands with missing @ sign.
|
|
|
|
|
(if (string-prefix-p "@" i) i (concat "@" i))))
|
2013-03-09 00:02:02 +00:00
|
|
|
|
(table-type (plist-get attr :table-type))
|
2014-08-06 21:46:04 +00:00
|
|
|
|
(type (org-element-property :type plain-list))
|
2019-03-13 14:33:21 +00:00
|
|
|
|
(enum
|
|
|
|
|
(cond ((not (eq type 'ordered)) nil)
|
|
|
|
|
((plist-member attr :enum) (plist-get attr :enum))
|
|
|
|
|
(t
|
|
|
|
|
;; Texinfo only supports initial counters, i.e., it
|
|
|
|
|
;; cannot change the numbering mid-list.
|
|
|
|
|
(let ((first-item (car (org-element-contents plain-list))))
|
|
|
|
|
(org-element-property :counter first-item)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(list-type (cond
|
|
|
|
|
((eq type 'ordered) "enumerate")
|
|
|
|
|
((eq type 'unordered) "itemize")
|
2014-08-06 21:46:04 +00:00
|
|
|
|
((member table-type '("ftable" "vtable")) table-type)
|
|
|
|
|
(t "table"))))
|
|
|
|
|
(format "@%s\n%s@end %s"
|
2019-03-13 11:15:33 +00:00
|
|
|
|
(cond ((eq type 'descriptive) (concat list-type " " indic))
|
2019-03-13 14:33:21 +00:00
|
|
|
|
(enum (format "%s %s" list-type enum))
|
2019-03-13 11:15:33 +00:00
|
|
|
|
(t list-type))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
contents
|
|
|
|
|
list-type)))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Plain Text
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-plain-text (text info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a TEXT string from Org to Texinfo.
|
|
|
|
|
TEXT is the string to transcode. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-10-26 22:36:00 +00:00
|
|
|
|
;; First protect @, { and }.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(let ((output (org-texinfo--sanitize-content text)))
|
2012-10-26 22:36:00 +00:00
|
|
|
|
;; Activate smart quotes. Be sure to provide original TEXT string
|
|
|
|
|
;; since OUTPUT may have been modified.
|
|
|
|
|
(when (plist-get info :with-smart-quotes)
|
|
|
|
|
(setq output
|
|
|
|
|
(org-export-activate-smart-quotes output :texinfo info text)))
|
|
|
|
|
;; LaTeX into @LaTeX{} and TeX into @TeX{}
|
2017-06-08 13:14:48 +00:00
|
|
|
|
(let ((case-fold-search nil))
|
|
|
|
|
(setq output (replace-regexp-in-string "\\(?:La\\)?TeX" "@\\&{}" output)))
|
2012-10-26 22:36:00 +00:00
|
|
|
|
;; Convert special strings.
|
|
|
|
|
(when (plist-get info :with-special-strings)
|
2017-06-08 13:14:48 +00:00
|
|
|
|
(setq output
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"\\.\\.\\." "@dots{}"
|
|
|
|
|
(replace-regexp-in-string "\\\\-" "@-" output))))
|
2012-10-26 22:36:00 +00:00
|
|
|
|
;; Handle break preservation if required.
|
|
|
|
|
(when (plist-get info :preserve-breaks)
|
|
|
|
|
(setq output (replace-regexp-in-string
|
|
|
|
|
"\\(\\\\\\\\\\)?[ \t]*\n" " @*\n" output)))
|
2018-05-11 17:40:10 +00:00
|
|
|
|
;; Reverse sentence ending. A sentence can end with a capital
|
|
|
|
|
;; letter. Use non-breaking space if it shouldn't.
|
|
|
|
|
(let ((case-fold-search nil))
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"[A-Z]\\([.?!]\\)\\(?:[])]\\|'\\{1,2\\}\\)?\\(?: \\|$\\)"
|
|
|
|
|
"@\\1"
|
|
|
|
|
output nil nil 1))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Planning
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-planning (planning _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a PLANNING element from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
(concat
|
|
|
|
|
"@noindent"
|
|
|
|
|
(mapconcat
|
2024-03-05 19:11:19 +00:00
|
|
|
|
#'identity
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(delq nil
|
|
|
|
|
(list
|
|
|
|
|
(let ((closed (org-element-property :closed planning)))
|
|
|
|
|
(when closed
|
|
|
|
|
(concat
|
2012-10-30 20:59:50 +00:00
|
|
|
|
(format "@strong{%s} " org-closed-string)
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(format (plist-get info :texinfo-inactive-timestamp-format)
|
2014-12-03 16:09:43 +00:00
|
|
|
|
(org-timestamp-translate closed)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(let ((deadline (org-element-property :deadline planning)))
|
|
|
|
|
(when deadline
|
|
|
|
|
(concat
|
|
|
|
|
(format "@strong{%s} " org-deadline-string)
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(format (plist-get info :texinfo-active-timestamp-format)
|
2014-12-03 16:09:43 +00:00
|
|
|
|
(org-timestamp-translate deadline)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
(let ((scheduled (org-element-property :scheduled planning)))
|
|
|
|
|
(when scheduled
|
|
|
|
|
(concat
|
|
|
|
|
(format "@strong{%s} " org-scheduled-string)
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(format (plist-get info :texinfo-active-timestamp-format)
|
2014-12-03 16:09:43 +00:00
|
|
|
|
(org-timestamp-translate scheduled)))))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
" ")
|
|
|
|
|
"@*"))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Property Drawer
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-property-drawer (_property-drawer contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a PROPERTY-DRAWER element from Org to Texinfo.
|
2013-09-25 19:27:29 +00:00
|
|
|
|
CONTENTS holds the contents of the drawer. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(and (org-string-nw-p contents)
|
|
|
|
|
(format "@verbatim\n%s@end verbatim" contents)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Quote Block
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-quote-block (quote-block contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a QUOTE-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2018-10-07 20:32:03 +00:00
|
|
|
|
(let ((tag (org-export-read-attribute :attr_texinfo quote-block :tag))
|
|
|
|
|
(author (org-export-read-attribute :attr_texinfo quote-block :author)))
|
|
|
|
|
(format "@quotation%s\n%s%s\n@end quotation"
|
|
|
|
|
(if tag (concat " " tag) "")
|
|
|
|
|
contents
|
|
|
|
|
(if author (concat "\n@author " author) ""))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Radio Target
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-radio-target (radio-target text info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a RADIO-TARGET object from Org to Texinfo.
|
|
|
|
|
TEXT is the text of the target. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(format "@anchor{%s}%s"
|
2017-06-06 00:05:09 +00:00
|
|
|
|
(org-texinfo--get-node radio-target info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
text))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Section
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-06-28 20:51:26 +00:00
|
|
|
|
(defun org-texinfo-section (section contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a SECTION element from Org to Texinfo.
|
2017-06-28 20:51:26 +00:00
|
|
|
|
CONTENTS holds the contents of the section. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2023-05-18 11:35:35 +00:00
|
|
|
|
(let ((parent (org-element-lineage section 'headline)))
|
2017-10-23 12:55:05 +00:00
|
|
|
|
(when parent ;first section is handled in `org-texinfo-template'
|
|
|
|
|
(org-trim
|
|
|
|
|
(concat contents
|
|
|
|
|
"\n"
|
|
|
|
|
(and (not (org-export-excluded-from-toc-p parent info))
|
|
|
|
|
(org-texinfo-make-menu parent info)))))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Special Block
|
2012-10-26 22:36:00 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-special-block (special-block contents _info)
|
2012-10-26 22:36:00 +00:00
|
|
|
|
"Transcode a SPECIAL-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist used
|
|
|
|
|
as a communication channel."
|
2016-05-19 17:15:55 +00:00
|
|
|
|
(let ((opt (org-export-read-attribute :attr_texinfo special-block :options))
|
|
|
|
|
(type (org-element-property :type special-block)))
|
|
|
|
|
(format "@%s%s\n%s@end %s"
|
|
|
|
|
type
|
2017-06-11 09:38:45 +00:00
|
|
|
|
(if opt (concat " " opt) "")
|
2016-05-19 17:15:55 +00:00
|
|
|
|
(or contents "")
|
|
|
|
|
type)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Src Block
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-src-block (src-block _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a SRC-BLOCK element from Org to Texinfo.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2024-02-24 09:48:35 +00:00
|
|
|
|
(let* ((lisp (string-match-p
|
|
|
|
|
"lisp"
|
|
|
|
|
(or (org-element-property :language src-block) "")))
|
2015-05-26 08:02:36 +00:00
|
|
|
|
(code (org-texinfo--sanitize-content
|
|
|
|
|
(org-export-format-code-default src-block info)))
|
|
|
|
|
(value (format
|
|
|
|
|
(if lisp "@lisp\n%s@end lisp" "@example\n%s@end example")
|
|
|
|
|
code))
|
|
|
|
|
(caption (org-export-get-caption src-block))
|
|
|
|
|
(shortcaption (org-export-get-caption src-block t)))
|
|
|
|
|
(if (not (or caption shortcaption)) value
|
|
|
|
|
(org-texinfo--wrap-float value
|
|
|
|
|
info
|
|
|
|
|
(org-export-translate "Listing" :utf-8 info)
|
2017-06-06 00:05:09 +00:00
|
|
|
|
(org-texinfo--get-node src-block info)
|
2015-05-26 08:02:36 +00:00
|
|
|
|
caption
|
|
|
|
|
shortcaption))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Statistics Cookie
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-statistics-cookie (statistics-cookie _contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a STATISTICS-COOKIE object from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(org-element-property :value statistics-cookie))
|
|
|
|
|
|
2016-06-04 20:37:13 +00:00
|
|
|
|
|
|
|
|
|
;;;; Strike-through
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo-strike-through (_strike-through contents info)
|
|
|
|
|
"Transcode STRIKE-THROUGH from Org to Texinfo.
|
|
|
|
|
CONTENTS is the text with strike-through markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(org-texinfo--text-markup contents 'strike-through info))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Subscript
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-subscript (_subscript contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a SUBSCRIPT object from Org to Texinfo.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(format "@math{_%s}" contents))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Superscript
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-superscript (_superscript contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a SUPERSCRIPT object from Org to Texinfo.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(format "@math{^%s}" contents))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Table
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-table (table contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a TABLE element from Org to Texinfo.
|
|
|
|
|
CONTENTS is the contents of the table. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2014-08-04 13:03:29 +00:00
|
|
|
|
(if (eq (org-element-property :type table) 'table.el)
|
|
|
|
|
(format "@verbatim\n%s@end verbatim"
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(org-element-property :value table)))
|
|
|
|
|
(let* ((col-width (org-export-read-attribute :attr_texinfo table :columns))
|
|
|
|
|
(columns
|
|
|
|
|
(if col-width (format "@columnfractions %s" col-width)
|
2015-05-26 07:52:02 +00:00
|
|
|
|
(org-texinfo-table-column-widths table info)))
|
|
|
|
|
(caption (org-export-get-caption table))
|
|
|
|
|
(shortcaption (org-export-get-caption table t))
|
|
|
|
|
(table-str (format "@multitable %s\n%s@end multitable"
|
|
|
|
|
columns
|
|
|
|
|
contents)))
|
|
|
|
|
(if (not (or caption shortcaption)) table-str
|
|
|
|
|
(org-texinfo--wrap-float table-str
|
|
|
|
|
info
|
|
|
|
|
(org-export-translate "Table" :utf-8 info)
|
2017-06-06 00:05:09 +00:00
|
|
|
|
(org-texinfo--get-node table info)
|
2015-05-26 07:52:02 +00:00
|
|
|
|
caption
|
|
|
|
|
shortcaption)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-table-column-widths (table info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Determine the largest table cell in each column to process alignment.
|
|
|
|
|
TABLE is the table element to transcode. INFO is a plist used as
|
|
|
|
|
a communication channel."
|
2014-08-04 13:03:29 +00:00
|
|
|
|
(let ((widths (make-vector (cdr (org-export-table-dimensions table info)) 0)))
|
|
|
|
|
(org-element-map table 'table-row
|
|
|
|
|
(lambda (row)
|
|
|
|
|
(let ((idx 0))
|
|
|
|
|
(org-element-map row 'table-cell
|
|
|
|
|
(lambda (cell)
|
|
|
|
|
;; Length of the cell in the original buffer is only an
|
|
|
|
|
;; approximation of the length of the cell in the
|
|
|
|
|
;; output. It can sometimes fail (e.g. it considers
|
|
|
|
|
;; "/a/" being larger than "ab").
|
2023-05-03 14:26:41 +00:00
|
|
|
|
(let ((w (- (org-element-contents-end cell)
|
|
|
|
|
(org-element-contents-begin cell))))
|
2014-08-04 13:03:29 +00:00
|
|
|
|
(aset widths idx (max w (aref widths idx))))
|
2016-07-25 13:59:28 +00:00
|
|
|
|
(cl-incf idx))
|
2014-08-04 13:03:29 +00:00
|
|
|
|
info)))
|
|
|
|
|
info)
|
|
|
|
|
(format "{%s}" (mapconcat (lambda (w) (make-string w ?a)) widths "} {"))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Table Cell
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-table-cell (table-cell contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a TABLE-CELL element from Org to Texinfo.
|
|
|
|
|
CONTENTS is the cell contents. INFO is a plist used as
|
|
|
|
|
a communication channel."
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(concat
|
|
|
|
|
(let ((scientific-notation
|
|
|
|
|
(plist-get info :texinfo-table-scientific-notation)))
|
|
|
|
|
(if (and contents
|
|
|
|
|
scientific-notation
|
|
|
|
|
(string-match orgtbl-exp-regexp contents))
|
|
|
|
|
;; Use appropriate format string for scientific notation.
|
|
|
|
|
(format scientific-notation
|
|
|
|
|
(match-string 1 contents)
|
|
|
|
|
(match-string 2 contents))
|
|
|
|
|
contents))
|
|
|
|
|
(when (org-export-get-next-element table-cell info) "\n@tab ")))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Table Row
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-table-row (table-row contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a TABLE-ROW element from Org to Texinfo.
|
|
|
|
|
CONTENTS is the contents of the row. INFO is a plist used as
|
|
|
|
|
a communication channel."
|
|
|
|
|
;; Rules are ignored since table separators are deduced from
|
|
|
|
|
;; borders of the current row.
|
2012-08-15 22:00:51 +00:00
|
|
|
|
(when (eq (org-element-property :type table-row) 'standard)
|
2014-08-04 13:03:29 +00:00
|
|
|
|
(let ((rowgroup-tag
|
|
|
|
|
(if (and (= 1 (org-export-table-row-group table-row info))
|
|
|
|
|
(org-export-table-has-header-p
|
2023-05-18 11:35:35 +00:00
|
|
|
|
(org-element-lineage table-row 'table) info))
|
2014-08-04 13:03:29 +00:00
|
|
|
|
"@headitem "
|
|
|
|
|
"@item ")))
|
|
|
|
|
(concat rowgroup-tag contents "\n"))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Target
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-target (target _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a TARGET object from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2017-06-06 00:05:09 +00:00
|
|
|
|
(format "@anchor{%s}" (org-texinfo--get-node target info)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Timestamp
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-timestamp (timestamp _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a TIMESTAMP object from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(let ((value (org-texinfo-plain-text
|
2013-01-10 20:42:21 +00:00
|
|
|
|
(org-timestamp-translate timestamp) info)))
|
2016-07-25 13:59:28 +00:00
|
|
|
|
(pcase (org-element-property :type timestamp)
|
|
|
|
|
((or `active `active-range)
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(format (plist-get info :texinfo-active-timestamp-format) value))
|
2016-07-25 13:59:28 +00:00
|
|
|
|
((or `inactive `inactive-range)
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(format (plist-get info :texinfo-inactive-timestamp-format) value))
|
2016-07-25 13:59:28 +00:00
|
|
|
|
(_ (format (plist-get info :texinfo-diary-timestamp-format) value)))))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2016-06-04 20:37:13 +00:00
|
|
|
|
;;;; Underline
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo-underline (_underline contents info)
|
|
|
|
|
"Transcode UNDERLINE from Org to Texinfo.
|
|
|
|
|
CONTENTS is the text with underline markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(org-texinfo--text-markup contents 'underline info))
|
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Verbatim
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-verbatim (verbatim _contents info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a VERBATIM object from Org to Texinfo.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(org-texinfo--text-markup
|
|
|
|
|
(org-element-property :value verbatim) 'verbatim info))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2014-08-06 21:53:42 +00:00
|
|
|
|
;;;; Verse Block
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2015-11-05 23:11:00 +00:00
|
|
|
|
(defun org-texinfo-verse-block (_verse-block contents _info)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Transcode a VERSE-BLOCK element from Org to Texinfo.
|
2021-09-16 10:32:43 +00:00
|
|
|
|
CONTENTS is verse block contents. INFO is a plist holding
|
2012-08-15 20:00:20 +00:00
|
|
|
|
contextual information."
|
2014-08-04 13:21:51 +00:00
|
|
|
|
(format "@display\n%s@end display" contents))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
|
2022-01-31 23:45:37 +00:00
|
|
|
|
;;; Public Functions
|
|
|
|
|
|
|
|
|
|
(defun org-texinfo-kbd-macro (key &optional noquote)
|
|
|
|
|
"Quote KEY using @kbd{...} and if necessary @key{...}.
|
|
|
|
|
|
|
|
|
|
This is intended to be used as an Org macro like so:
|
|
|
|
|
|
|
|
|
|
#+macro: kbd (eval (org-texinfo-kbd-macro $1))
|
|
|
|
|
Type {{{kbd(C-c SPC)}}}.
|
|
|
|
|
|
|
|
|
|
Also see info node `(org)Key bindings in Texinfo export'.
|
|
|
|
|
|
|
|
|
|
If optional NOQOUTE is non-nil, then do not add the quoting
|
|
|
|
|
that is necessary when using this in an Org macro."
|
|
|
|
|
(format (if noquote "@kbd{%s}" "@@texinfo:@kbd{@@%s@@texinfo:}@@")
|
|
|
|
|
(let ((case-fold-search nil))
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
org-texinfo--quoted-keys-regexp
|
|
|
|
|
(if noquote "@key{\\&}" "@@texinfo:@key{@@\\&@@texinfo:}@@")
|
|
|
|
|
key t))))
|
|
|
|
|
|
|
|
|
|
;;; Interactive Functions
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2017-09-15 19:10:29 +00:00
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-export-to-texinfo
|
2021-09-29 07:22:47 +00:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Export current buffer to a Texinfo file.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 16:24:19 +00:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
|
between \"\\begin{document}\" and \"\\end{document}\".
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return output file's name."
|
|
|
|
|
(interactive)
|
2013-03-19 09:24:30 +00:00
|
|
|
|
(let ((outfile (org-export-output-file-name ".texi" subtreep))
|
2013-09-20 08:41:21 +00:00
|
|
|
|
(org-export-coding-system org-texinfo-coding-system))
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 08:35:42 +00:00
|
|
|
|
(org-export-to-file 'texinfo outfile
|
|
|
|
|
async subtreep visible-only body-only ext-plist)))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2021-02-27 03:28:43 +00:00
|
|
|
|
(defun org-texinfo-export-to-texinfo-batch ()
|
|
|
|
|
"Export Org file INFILE to Texinfo file OUTFILE, in batch mode.
|
2021-02-28 23:13:07 +00:00
|
|
|
|
Overwrites existing output file.
|
2021-02-27 03:28:43 +00:00
|
|
|
|
Usage: emacs -batch -f org-texinfo-export-to-texinfo-batch INFILE OUTFILE"
|
|
|
|
|
(or noninteractive (user-error "Batch mode use only"))
|
|
|
|
|
(let ((infile (pop command-line-args-left))
|
|
|
|
|
(outfile (pop command-line-args-left))
|
2021-02-28 23:13:07 +00:00
|
|
|
|
(org-export-coding-system org-texinfo-coding-system)
|
|
|
|
|
(make-backup-files nil))
|
2021-02-27 03:28:43 +00:00
|
|
|
|
(unless (file-readable-p infile)
|
|
|
|
|
(message "File `%s' not readable" infile)
|
|
|
|
|
(kill-emacs 1))
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(insert-file-contents infile)
|
|
|
|
|
(org-export-to-file 'texinfo outfile))))
|
|
|
|
|
|
2017-09-15 19:10:29 +00:00
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-export-to-info
|
2021-09-29 07:22:47 +00:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Export current buffer to Texinfo then process through to INFO.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 16:24:19 +00:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
2012-08-15 20:00:20 +00:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
|
between \"\\begin{document}\" and \"\\end{document}\".
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return INFO file's name."
|
|
|
|
|
(interactive)
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 08:35:42 +00:00
|
|
|
|
(let ((outfile (org-export-output-file-name ".texi" subtreep))
|
2013-09-20 08:37:32 +00:00
|
|
|
|
(org-export-coding-system org-texinfo-coding-system))
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 08:35:42 +00:00
|
|
|
|
(org-export-to-file 'texinfo outfile
|
|
|
|
|
async subtreep visible-only body-only ext-plist
|
2021-11-29 08:54:33 +00:00
|
|
|
|
#'org-texinfo-compile)))
|
2013-03-19 09:24:30 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun org-texinfo-publish-to-texinfo (plist filename pub-dir)
|
|
|
|
|
"Publish an org file to Texinfo.
|
|
|
|
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
|
|
|
is the property list for the given project. PUB-DIR is the
|
|
|
|
|
publishing directory.
|
|
|
|
|
|
|
|
|
|
Return output file name."
|
|
|
|
|
(org-publish-org-to 'texinfo filename ".texi" plist pub-dir))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2013-04-06 17:09:38 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun org-texinfo-convert-region-to-texinfo ()
|
2016-08-23 20:13:56 +00:00
|
|
|
|
"Assume the current region has Org syntax, and convert it to Texinfo.
|
2013-04-06 17:09:38 +00:00
|
|
|
|
This can be used in any buffer. For example, you can write an
|
2016-08-23 20:13:56 +00:00
|
|
|
|
itemized list in Org syntax in an Texinfo buffer and use this
|
|
|
|
|
command to convert it."
|
2013-04-06 17:09:38 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(org-export-replace-region-by 'texinfo))
|
|
|
|
|
|
2023-06-29 19:18:01 +00:00
|
|
|
|
(defalias 'org-export-region-to-texinfo #'org-texinfo-convert-region-to-texinfo)
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-texinfo-compile (file)
|
2012-08-15 20:00:20 +00:00
|
|
|
|
"Compile a texinfo file.
|
|
|
|
|
|
2016-05-17 21:37:18 +00:00
|
|
|
|
FILE is the name of the file being compiled. Processing is done
|
|
|
|
|
through the command specified in `org-texinfo-info-process',
|
|
|
|
|
which see. Output is redirected to \"*Org INFO Texinfo Output*\"
|
|
|
|
|
buffer.
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
|
|
|
|
Return INFO file name or an error if it couldn't be produced."
|
2016-05-17 21:37:18 +00:00
|
|
|
|
(message "Processing Texinfo file %s..." file)
|
|
|
|
|
(let* ((log-name "*Org INFO Texinfo Output*")
|
|
|
|
|
(log (get-buffer-create log-name))
|
|
|
|
|
(output
|
|
|
|
|
(org-compile-file file org-texinfo-info-process "info"
|
|
|
|
|
(format "See %S for details" log-name)
|
|
|
|
|
log)))
|
|
|
|
|
(when org-texinfo-remove-logfiles
|
|
|
|
|
(let ((base (file-name-sans-extension output)))
|
|
|
|
|
(dolist (ext org-texinfo-logfiles-extensions)
|
|
|
|
|
(let ((file (concat base "." ext)))
|
|
|
|
|
(when (file-exists-p file) (delete-file file))))))
|
|
|
|
|
(message "Process completed.")
|
|
|
|
|
output))
|
2012-08-15 20:00:20 +00:00
|
|
|
|
|
2022-03-26 15:46:47 +00:00
|
|
|
|
(defun org-texinfo-supports-math-p ()
|
|
|
|
|
"Return t if the installed version of Texinfo supports \"@math\".
|
|
|
|
|
|
|
|
|
|
Once computed, the results remain cached."
|
|
|
|
|
(unless (boundp 'org-texinfo-supports-math--cache)
|
|
|
|
|
(setq org-texinfo-supports-math--cache
|
|
|
|
|
(let ((math-example "1 + 1 = 2"))
|
2023-02-06 21:33:40 +00:00
|
|
|
|
(let* ((input-file (make-temp-file "test" nil ".info"))
|
|
|
|
|
(input-content (string-join
|
|
|
|
|
(list (format "@setfilename %s" input-file)
|
|
|
|
|
"@node Top"
|
|
|
|
|
"@displaymath"
|
|
|
|
|
math-example
|
|
|
|
|
"@end displaymath")
|
|
|
|
|
"\n")))
|
2022-03-26 15:46:47 +00:00
|
|
|
|
(with-temp-file input-file
|
|
|
|
|
(insert input-content))
|
2023-03-19 12:58:07 +00:00
|
|
|
|
(when-let* ((output-file
|
|
|
|
|
;; If compilation fails, consider math to
|
|
|
|
|
;; be not supported.
|
|
|
|
|
(ignore-errors (org-texinfo-compile input-file)))
|
|
|
|
|
(output-content (with-temp-buffer
|
|
|
|
|
(insert-file-contents output-file)
|
|
|
|
|
(buffer-string))))
|
2022-03-26 15:46:47 +00:00
|
|
|
|
(let ((result (string-match-p (regexp-quote math-example)
|
|
|
|
|
output-content)))
|
|
|
|
|
(delete-file input-file)
|
|
|
|
|
(delete-file output-file)
|
|
|
|
|
(if result t nil)))))))
|
|
|
|
|
org-texinfo-supports-math--cache)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
|
|
|
|
|
(provide 'ox-texinfo)
|
|
|
|
|
|
|
|
|
|
;; Local variables:
|
|
|
|
|
;; generated-autoload-file: "org-loaddefs.el"
|
|
|
|
|
;; End:
|
|
|
|
|
|
|
|
|
|
;;; ox-texinfo.el ends here
|