Merge branch 'master' of orgmode.org:org-mode
This commit is contained in:
commit
2558de0ab3
|
@ -201,7 +201,7 @@ INFO is a plist used as a communication channel."
|
|||
(concat section-number
|
||||
(org-export-data
|
||||
(org-export-get-alt-title headline info) info)
|
||||
(and tags " ") (org-html--tags tags))))
|
||||
(and tags " ") (org-html--tags tags info))))
|
||||
|
||||
(defun org-s5-toc (depth info)
|
||||
(let* ((headlines (org-export-collect-headlines info depth))
|
||||
|
|
30
doc/org.texi
30
doc/org.texi
|
@ -13506,7 +13506,6 @@ however, override everything.
|
|||
|
||||
@multitable {@code{:html-table-use-header-tags-for-first-column}} {@code{org-html-table-use-header-tags-for-first-column}}
|
||||
@item @code{:html-allow-name-attribute-in-anchors} @tab @code{org-html-allow-name-attribute-in-anchors}
|
||||
@item @code{:html-coding-system} @tab @code{org-html-coding-system}
|
||||
@item @code{:html-container} @tab @code{org-html-container-element}
|
||||
@item @code{:html-divs} @tab @code{org-html-divs}
|
||||
@item @code{:html-doctype} @tab @code{org-html-doctype}
|
||||
|
@ -13523,8 +13522,6 @@ however, override everything.
|
|||
@item @code{:html-head} @tab @code{org-html-head}
|
||||
@item @code{:html-home/up-format} @tab @code{org-html-home/up-format}
|
||||
@item @code{:html-html5-fancy} @tab @code{org-html-html5-fancy}
|
||||
@item @code{:html-htmlize-font-prefix} @tab @code{org-html-htmlize-font-prefix}
|
||||
@item @code{:html-htmlize-output-type} @tab @code{org-html-htmlize-output-type}
|
||||
@item @code{:html-indent} @tab @code{org-html-indent}
|
||||
@item @code{:html-infojs-options} @tab @code{org-html-infojs-options}
|
||||
@item @code{:html-infojs-template} @tab @code{org-html-infojs-template}
|
||||
|
@ -13541,7 +13538,6 @@ however, override everything.
|
|||
@item @code{:html-postamble} @tab @code{org-html-postamble}
|
||||
@item @code{:html-preamble-format} @tab @code{org-html-preamble-format}
|
||||
@item @code{:html-preamble} @tab @code{org-html-preamble}
|
||||
@item @code{:html-protect-char-alist} @tab @code{org-html-protect-char-alist}
|
||||
@item @code{:html-table-align-individual-fields} @tab @code{org-html-table-align-individual-fields}
|
||||
@item @code{:html-table-attributes} @tab @code{org-html-table-default-attributes}
|
||||
@item @code{:html-table-caption-above} @tab @code{org-html-table-caption-above}
|
||||
|
@ -13579,17 +13575,12 @@ however, override everything.
|
|||
@item @code{:latex-image-default-width} @tab @code{org-latex-image-default-width}
|
||||
@item @code{:latex-inactive-timestamp-format} @tab @code{org-latex-inactive-timestamp-format}
|
||||
@item @code{:latex-inline-image-rules} @tab @code{org-latex-inline-image-rules}
|
||||
@item @code{:latex-inputenc-alist} @tab @code{org-latex-inputenc-alist}
|
||||
@item @code{:latex-known-warnings} @tab @code{org-latex-known-warnings}
|
||||
@item @code{:latex-link-with-unknown-path-format} @tab @code{org-latex-link-with-unknown-path-format}
|
||||
@item @code{:latex-listings-langs} @tab @code{org-latex-listings-langs}
|
||||
@item @code{:latex-listings-options} @tab @code{org-latex-listings-options}
|
||||
@item @code{:latex-listings} @tab @code{org-latex-listings}
|
||||
@item @code{:latex-logfiles-extensions} @tab @code{org-latex-logfiles-extensions}
|
||||
@item @code{:latex-minted-langs} @tab @code{org-latex-minted-langs}
|
||||
@item @code{:latex-minted-options} @tab @code{org-latex-minted-options}
|
||||
@item @code{:latex-pdf-process} @tab @code{org-latex-pdf-process}
|
||||
@item @code{:latex-remove-logfiles} @tab @code{org-latex-remove-logfiles}
|
||||
@item @code{:latex-table-caption-above} @tab @code{org-latex-table-caption-above}
|
||||
@item @code{:latex-table-scientific-notation} @tab @code{org-latex-table-scientific-notation}
|
||||
@item @code{:latex-tables-booktabs} @tab @code{org-latex-tables-booktabs}
|
||||
|
@ -13607,11 +13598,8 @@ however, override everything.
|
|||
|
||||
@subsubheading ODT specific properties
|
||||
|
||||
@multitable {@code{:odt-create-custom-styles-for-srcblocks}} {@code{org-odt-create-custom-styles-for-srcblocks}}
|
||||
@item @code{:odt-convert-capabilities} @tab @code{org-odt-convert-capabilities}
|
||||
@item @code{:odt-convert-processes} @tab @code{org-odt-convert-processes}
|
||||
@item @code{:odt-convert-process} @tab @code{org-odt-convert-process}
|
||||
@item @code{:odt-create-custom-styles-for-srcblocks} @tab @code{org-odt-create-custom-styles-for-srcblocks}
|
||||
@multitable {@code{:odt-format-inlinetask-function}} {@code{org-odt-format-inlinetask-function}}
|
||||
@item @code{:odt-content-template-file} @tab @code{org-odt-content-template-file}
|
||||
@item @code{:odt-display-outline-level} @tab @code{org-odt-display-outline-level}
|
||||
@item @code{:odt-fontify-srcblocks} @tab @code{org-odt-fontify-srcblocks}
|
||||
@item @code{:odt-format-drawer-function} @tab @code{org-odt-format-drawer-function}
|
||||
|
@ -13620,28 +13608,17 @@ however, override everything.
|
|||
@item @code{:odt-inline-formula-rules} @tab @code{org-odt-inline-formula-rules}
|
||||
@item @code{:odt-inline-image-rules} @tab @code{org-odt-inline-image-rules}
|
||||
@item @code{:odt-pixels-per-inch} @tab @code{org-odt-pixels-per-inch}
|
||||
@item @code{:odt-preferred-output-format} @tab @code{org-odt-preferred-output-format}
|
||||
@item @code{:odt-prettify-xml} @tab @code{org-odt-prettify-xml}
|
||||
@item @code{:odt-schema-dir} @tab @code{org-odt-schema-dir}
|
||||
@item @code{:odt-styles-file} @tab @code{org-odt-content-template-file}
|
||||
@item @code{:odt-styles-file} @tab @code{org-odt-styles-file}
|
||||
@item @code{:odt-table-styles} @tab @code{org-odt-table-styles}
|
||||
@item @code{:odt-use-date-fields} @tab @code{org-odt-use-date-fields}
|
||||
@end multitable
|
||||
|
||||
@subsubheading Org specific properties
|
||||
|
||||
@multitable {@code{:org-htmlized-css-url}} {@code{org-org-htmlized-css-url}}
|
||||
@item @code{:org-htmlized-css-url} @tab @code{org-org-htmlized-css-url}
|
||||
@end multitable
|
||||
|
||||
@subsubheading Texinfo specific properties
|
||||
|
||||
@multitable {@code{:texinfo-link-with-unknown-path-format}} {@code{org-texinfo-link-with-unknown-path-format}}
|
||||
@item @code{:texinfo-active-timestamp-format} @tab @code{org-texinfo-active-timestamp-format}
|
||||
@item @code{:texinfo-classes} @tab @code{org-texinfo-classes}
|
||||
@item @code{:texinfo-class} @tab @code{org-texinfo-default-class}
|
||||
@item @code{:texinfo-coding-system} @tab @code{org-texinfo-coding-system}
|
||||
@item @code{:texinfo-def-table-markup} @tab @code{org-texinfo-def-table-markup}
|
||||
@item @code{:texinfo-diary-timestamp-format} @tab @code{org-texinfo-diary-timestamp-format}
|
||||
@item @code{:texinfo-filename} @tab @code{org-texinfo-filename}
|
||||
|
@ -13649,11 +13626,8 @@ however, override everything.
|
|||
@item @code{:texinfo-format-headline-function} @tab @code{org-texinfo-format-headline-function}
|
||||
@item @code{:texinfo-format-inlinetask-function} @tab @code{org-texinfo-format-inlinetask-function}
|
||||
@item @code{:texinfo-inactive-timestamp-format} @tab @code{org-texinfo-inactive-timestamp-format}
|
||||
@item @code{:texinfo-info-process} @tab @code{org-texinfo-info-process}
|
||||
@item @code{:texinfo-link-with-unknown-path-format} @tab @code{org-texinfo-link-with-unknown-path-format}
|
||||
@item @code{:texinfo-logfiles-extensions} @tab @code{org-texinfo-logfiles-extensions}
|
||||
@item @code{:texinfo-node-description-column} @tab @code{org-texinfo-node-description-column}
|
||||
@item @code{:texinfo-remove-logfiles} @tab @code{org-texinfo-remove-logfiles}
|
||||
@item @code{:texinfo-table-scientific-notation} @tab @code{org-texinfo-table-scientific-notation}
|
||||
@item @code{:texinfo-tables-verbatim} @tab @code{org-texinfo-tables-verbatim}
|
||||
@item @code{:texinfo-text-markup-alist} @tab @code{org-texinfo-text-markup-alist}
|
||||
|
|
17
etc/ORG-NEWS
17
etc/ORG-NEWS
|
@ -47,6 +47,12 @@ defining export blocks.
|
|||
Note that If BACKEND is a derived back-end and doesn't implement
|
||||
its own special block translator already, there is nothing to
|
||||
change. The parent back-end will take care of such blocks.
|
||||
*** ~org-html-format-headline-function~ requires an additional argument
|
||||
The function provided is required to accept export options, as
|
||||
a plist, as its final (sixth) argument.
|
||||
*** ~org-html-format-inlinetask-function~ requires an additional argument
|
||||
The function provided is required to accept export options, as
|
||||
a plist, as its final (seventh) argument.
|
||||
** Removed functions
|
||||
*** Removed function ~org-beamer-insert-options-template~
|
||||
This function inserted a Beamer specific template at point or in
|
||||
|
@ -54,6 +60,12 @@ current subtree. Use ~org-export-insert-default-template~ instead, as
|
|||
it provides more features and covers all export back-ends. It is also
|
||||
accessible from the export dispatcher.
|
||||
** Removed options
|
||||
*** ~org-list-empty-line-terminates-plain-lists~ is deprecated
|
||||
It will be kept in code base until next release, for backward
|
||||
compatibility.
|
||||
|
||||
If you need to separate consecutive lists with blank lines, always use
|
||||
two of them, as if this option was nil (default value).
|
||||
*** Removed option =org-babel-sh-command=
|
||||
This undocumented option defaulted to the value of =shell-file-name=
|
||||
at the time of loading =ob-shell=. The new behaviour is to use the
|
||||
|
@ -85,6 +97,9 @@ in a source block.
|
|||
*** New blocks in ASCII export
|
||||
ASCII export now supports =#+BEGIN_JUSTIFYRIGHT= and
|
||||
=#+BEGIN_JUSTIFYLEFT= blocks. See documentation for details.
|
||||
*** More back-end specific publishing options
|
||||
The number of publishing options specific to each back-end has been
|
||||
increased. See manual for details.
|
||||
** Miscellaneous
|
||||
*** File names in links accept are now compatible with URI syntax
|
||||
Absolute file names can now start with =///= in addition to =/=. E.g.,
|
||||
|
@ -97,7 +112,7 @@ labels colliding.
|
|||
This change deprecates old Org syntax for mailto links:
|
||||
=mailto:user@domain::Subject=.
|
||||
*** =QUOTE= keywords do not exist anymore
|
||||
=QUOTES= keywords have been deprecated since Org 8.2.
|
||||
=QUOTE= keywords have been deprecated since Org 8.2.
|
||||
*** Select tests to perform with the build system
|
||||
The build system has been enhanced to allow test selection with a
|
||||
regular expression by defining =BTEST_RE= during the test invocation.
|
||||
|
|
|
@ -406,7 +406,8 @@ used as a communication channel."
|
|||
;; Collect options from default value and headline's
|
||||
;; properties. Also add a label for links.
|
||||
(append
|
||||
(org-split-string org-beamer-frame-default-options ",")
|
||||
(org-split-string
|
||||
(plist-get info :beamer-frame-default-options) ",")
|
||||
(and beamer-opt
|
||||
(org-split-string
|
||||
;; Remove square brackets if user provided
|
||||
|
@ -468,7 +469,7 @@ used as a communication channel."
|
|||
(env-format
|
||||
(cond ((member environment '("column" "columns")) nil)
|
||||
((assoc environment
|
||||
(append org-beamer-environments-extra
|
||||
(append (plist-get info :beamer-environments-extra)
|
||||
org-beamer-environments-default)))
|
||||
(t (user-error "Wrong block type at a headline named \"%s\""
|
||||
raw-title))))
|
||||
|
@ -875,8 +876,8 @@ holding export options."
|
|||
(concat
|
||||
(format "\\begin{frame}%s{%s}\n"
|
||||
(org-beamer--normalize-argument
|
||||
org-beamer-outline-frame-options 'option)
|
||||
org-beamer-outline-frame-title)
|
||||
(plist-get info :beamer-outline-frame-options) 'option)
|
||||
(plist-get info :beamer-outline-frame-title))
|
||||
(when (wholenump depth)
|
||||
(format "\\setcounter{tocdepth}{%d}\n" depth))
|
||||
"\\tableofcontents\n"
|
||||
|
|
509
lisp/ox-html.el
509
lisp/ox-html.el
|
@ -117,8 +117,6 @@
|
|||
(:html-head-extra "HTML_HEAD_EXTRA" nil org-html-head-extra newline)
|
||||
(:html-container "HTML_CONTAINER" nil org-html-container-element)
|
||||
(:html-mathjax "HTML_MATHJAX" nil "" space)
|
||||
(:html-extension nil nil org-html-extension)
|
||||
(:html-link-org-as-html nil nil org-html-link-org-files-as-html)
|
||||
(:html-html5-fancy nil "html5-fancy" org-html-html5-fancy)
|
||||
(:html-link-use-abs-url nil "html-link-use-abs-url" org-html-link-use-abs-url)
|
||||
(:html-postamble nil "html-postamble" org-html-postamble)
|
||||
|
@ -130,7 +128,6 @@
|
|||
(:html-head-include-scripts nil "html-scripts" org-html-head-include-scripts)
|
||||
(:html-allow-name-attribute-in-anchors
|
||||
nil nil org-html-allow-name-attribute-in-anchors)
|
||||
(:html-coding-system nil nil org-html-coding-system)
|
||||
(:html-divs nil nil org-html-divs)
|
||||
(:html-extension nil nil org-html-extension)
|
||||
(:html-footnote-format nil nil org-html-footnote-format)
|
||||
|
@ -141,8 +138,6 @@
|
|||
(:html-format-inlinetask-function
|
||||
nil nil org-html-format-inlinetask-function)
|
||||
(:html-home/up-format nil nil org-html-home/up-format)
|
||||
(:html-htmlize-font-prefix nil nil org-html-htmlize-font-prefix)
|
||||
(:html-htmlize-output-type nil nil org-html-htmlize-output-type)
|
||||
(:html-indent nil nil org-html-indent)
|
||||
(:html-infojs-options nil nil org-html-infojs-options)
|
||||
(:html-infojs-template nil nil org-html-infojs-template)
|
||||
|
@ -153,7 +148,6 @@
|
|||
(:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format)
|
||||
(:html-postamble-format nil nil org-html-postamble-format)
|
||||
(:html-preamble-format nil nil org-html-preamble-format)
|
||||
(:html-protect-char-alist nil nil org-html-protect-char-alist)
|
||||
(:html-table-align-individual-fields
|
||||
nil nil org-html-table-align-individual-fields)
|
||||
(:html-table-caption-above nil nil org-html-table-caption-above)
|
||||
|
@ -497,18 +491,19 @@ Option settings will replace the %MANAGER-OPTIONS cookie."
|
|||
EXP-PLIST is a plist containing export options. BACKEND is the
|
||||
export back-end currently used."
|
||||
(unless (or (memq 'body-only (plist-get exp-plist :export-options))
|
||||
(not org-html-use-infojs)
|
||||
(and (eq org-html-use-infojs 'when-configured)
|
||||
(or (not (plist-get exp-plist :infojs-opt))
|
||||
(string= "" (plist-get exp-plist :infojs-opt))
|
||||
(string-match "\\<view:nil\\>"
|
||||
(plist-get exp-plist :infojs-opt)))))
|
||||
(let* ((template org-html-infojs-template)
|
||||
(not (plist-get exp-plist :html-use-infojs))
|
||||
(and (eq (plist-get exp-plist :html-use-infojs) 'when-configured)
|
||||
(let ((opt (plist-get exp-plist :infojs-opt)))
|
||||
(or (not opt)
|
||||
(string= "" opt)
|
||||
(string-match "\\<view:nil\\>" opt)))))
|
||||
(let* ((template (plist-get exp-plist :html-infojs-template))
|
||||
(ptoc (plist-get exp-plist :with-toc))
|
||||
(hlevels (plist-get exp-plist :headline-levels))
|
||||
(sdepth hlevels)
|
||||
(tdepth (if (integerp ptoc) (min ptoc hlevels) hlevels))
|
||||
(options (plist-get exp-plist :infojs-opt))
|
||||
(infojs-opt (plist-get exp-plist :html-infojs-options))
|
||||
(table org-html-infojs-opts-table)
|
||||
style)
|
||||
(dolist (entry table)
|
||||
|
@ -517,7 +512,7 @@ export back-end currently used."
|
|||
;; Compute default values for script option OPT from
|
||||
;; `org-html-infojs-options' variable.
|
||||
(default
|
||||
(let ((default (cdr (assq opt org-html-infojs-options))))
|
||||
(let ((default (cdr (assq opt infojs-opt))))
|
||||
(if (and (symbolp default) (not (memq default '(t nil))))
|
||||
(plist-get exp-plist default)
|
||||
default)))
|
||||
|
@ -554,9 +549,9 @@ export back-end currently used."
|
|||
(push (cons "TOC_DEPTH" tdepth) style)
|
||||
;; Build style string.
|
||||
(setq style (mapconcat
|
||||
(lambda (x) (format "org_html_manager.set(\"%s\", \"%s\");"
|
||||
(car x)
|
||||
(cdr x)))
|
||||
(lambda (x)
|
||||
(format "org_html_manager.set(\"%s\", \"%s\");"
|
||||
(car x) (cdr x)))
|
||||
style "\n"))
|
||||
(when (and style (> (length style) 0))
|
||||
(and (string-match "%MANAGER_OPTIONS" template)
|
||||
|
@ -615,8 +610,7 @@ Warning: non-nil may break indentation of source code blocks."
|
|||
|
||||
;;;; Drawers
|
||||
|
||||
(defcustom org-html-format-drawer-function
|
||||
(lambda (name contents) contents)
|
||||
(defcustom org-html-format-drawer-function (lambda (name contents) contents)
|
||||
"Function called to format a drawer in HTML code.
|
||||
|
||||
The function must accept two parameters:
|
||||
|
@ -673,20 +667,22 @@ document title."
|
|||
:group 'org-export-html
|
||||
:type 'integer)
|
||||
|
||||
(defcustom org-html-format-headline-function 'ignore
|
||||
(defcustom org-html-format-headline-function
|
||||
'org-html-format-headline-default-function
|
||||
"Function to format headline text.
|
||||
|
||||
This function will be called with 5 arguments:
|
||||
This function will be called with six 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 (string or nil).
|
||||
INFO the export options (plist).
|
||||
|
||||
The function result will be used in the section format string."
|
||||
:group 'org-export-html
|
||||
:version "24.4"
|
||||
:package-version '(Org . "8.0")
|
||||
:version "24.5"
|
||||
:package-version '(Org . "8.3")
|
||||
:type 'function)
|
||||
|
||||
;;;; HTML-specific
|
||||
|
@ -702,21 +698,23 @@ but without \"name\" attribute."
|
|||
|
||||
;;;; Inlinetasks
|
||||
|
||||
(defcustom org-html-format-inlinetask-function 'ignore
|
||||
(defcustom org-html-format-inlinetask-function
|
||||
'org-html-format-inlinetask-default-function
|
||||
"Function called to format an inlinetask in HTML code.
|
||||
|
||||
The function must accept six parameters:
|
||||
The function must accept seven 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.
|
||||
INFO the export options, as a plist
|
||||
|
||||
The function should return the string to be exported."
|
||||
:group 'org-export-html
|
||||
:version "24.4"
|
||||
:package-version '(Org . "8.0")
|
||||
:version "24.5"
|
||||
:package-version '(Org . "8.3")
|
||||
:type 'function)
|
||||
|
||||
;;;; LaTeX
|
||||
|
@ -1557,32 +1555,6 @@ Replaces invalid characters with \"_\"."
|
|||
(setq kwd (replace-match "_" t t kwd))))
|
||||
kwd)
|
||||
|
||||
(defun org-html-format-footnote-reference (n def refcnt)
|
||||
"Format footnote reference N with definition DEF into HTML."
|
||||
(let ((extra (if (= refcnt 1) "" (format ".%d" refcnt))))
|
||||
(format org-html-footnote-format
|
||||
(let* ((id (format "fnr.%s%s" n extra))
|
||||
(href (format " href=\"#fn.%s\"" n))
|
||||
(attributes (concat " class=\"footref\"" href)))
|
||||
(org-html--anchor id n attributes)))))
|
||||
|
||||
(defun org-html-format-footnotes-section (section-name definitions)
|
||||
"Format footnotes section SECTION-NAME."
|
||||
(if (not definitions) ""
|
||||
(format org-html-footnotes-section section-name definitions)))
|
||||
|
||||
(defun org-html-format-footnote-definition (fn)
|
||||
"Format the footnote definition FN."
|
||||
(let ((n (car fn)) (def (cdr fn)))
|
||||
(format
|
||||
"<div class=\"footdef\">%s %s</div>\n"
|
||||
(format org-html-footnote-format
|
||||
(let* ((id (format "fn.%s" n))
|
||||
(href (format " href=\"#fnr.%s\"" n))
|
||||
(attributes (concat " class=\"footnum\"" href)))
|
||||
(org-html--anchor id n attributes)))
|
||||
def)))
|
||||
|
||||
(defun org-html-footnote-section (info)
|
||||
"Format the footnote section.
|
||||
INFO is a plist used as a communication channel."
|
||||
|
@ -1595,11 +1567,26 @@ INFO is a plist used as a communication channel."
|
|||
(format "<p>%s</p>"
|
||||
(org-trim (org-export-data raw info))))))))
|
||||
(when fn-alist
|
||||
(org-html-format-footnotes-section
|
||||
(format
|
||||
(plist-get info :html-footnotes-section)
|
||||
(org-html--translate "Footnotes" info)
|
||||
(format
|
||||
"\n%s\n"
|
||||
(mapconcat 'org-html-format-footnote-definition fn-alist "\n"))))))
|
||||
(mapconcat
|
||||
(lambda (fn)
|
||||
(let ((n (car fn)) (def (cdr fn)))
|
||||
(format
|
||||
"<div class=\"footdef\">%s %s</div>\n"
|
||||
(format
|
||||
(plist-get info :html-footnote-format)
|
||||
(org-html--anchor
|
||||
(format "fn.%d" n)
|
||||
n
|
||||
(format " class=\"footnum\" href=\"#fnr.%d\"" n)
|
||||
info))
|
||||
def)))
|
||||
fn-alist
|
||||
"\n"))))))
|
||||
|
||||
|
||||
;;; Template
|
||||
|
@ -1632,7 +1619,9 @@ INFO is a plist used as a communication channel."
|
|||
(format "<title>%s</title>\n" title)
|
||||
(when (plist-get info :time-stamp-file)
|
||||
(format-time-string
|
||||
(concat "<!-- " org-html-metadata-timestamp-format " -->\n")))
|
||||
(concat "<!-- "
|
||||
(plist-get info :html-metadata-timestamp-format)
|
||||
" -->\n")))
|
||||
(format
|
||||
(if (org-html-html5-p info)
|
||||
(org-html-close-tag "meta" " charset=\"%s\"" info)
|
||||
|
@ -1687,8 +1676,8 @@ INFO is a plist used as a communication channel."
|
|||
(when (and (memq (plist-get info :with-latex) '(mathjax t))
|
||||
(org-element-map (plist-get info :parse-tree)
|
||||
'(latex-fragment latex-environment) 'identity info t))
|
||||
(let ((template org-html-mathjax-template)
|
||||
(options org-html-mathjax-options)
|
||||
(let ((template (plist-get info :html-mathjax-template))
|
||||
(options (plist-get info :html-mathjax-options))
|
||||
(in-buffer (or (plist-get info :html-mathjax) ""))
|
||||
name val (yes " ") (no "// ") x)
|
||||
(mapc
|
||||
|
@ -1720,7 +1709,8 @@ INFO is a plist used as a communication channel."
|
|||
used in the preamble or postamble."
|
||||
`((?t . ,(org-export-data (plist-get info :title) info))
|
||||
(?d . ,(org-export-data (org-export-get-date info) info))
|
||||
(?T . ,(format-time-string org-html-metadata-timestamp-format))
|
||||
(?T . ,(format-time-string
|
||||
(plist-get info :html-metadata-timestamp-format)))
|
||||
(?a . ,(org-export-data (plist-get info :author) info))
|
||||
(?e . ,(mapconcat
|
||||
(lambda (e)
|
||||
|
@ -1729,10 +1719,10 @@ used in the preamble or postamble."
|
|||
", "))
|
||||
(?c . ,(plist-get info :creator))
|
||||
(?C . ,(let ((file (plist-get info :input-file)))
|
||||
(format-time-string org-html-metadata-timestamp-format
|
||||
(if file (nth 5 (file-attributes file))
|
||||
(current-time)))))
|
||||
(?v . ,(or org-html-validation-link ""))))
|
||||
(format-time-string
|
||||
(plist-get info :html-metadata-timestamp-format)
|
||||
(if file (nth 5 (file-attributes file)) (current-time)))))
|
||||
(?v . ,(or (plist-get info :html-validation-link) ""))))
|
||||
|
||||
(defun org-html--build-pre/postamble (type info)
|
||||
"Return document preamble or postamble as a string, or nil.
|
||||
|
@ -1772,7 +1762,8 @@ communication channel."
|
|||
(format
|
||||
"<p class=\"date\">%s: %s</p>\n"
|
||||
(org-html--translate "Created" info)
|
||||
(format-time-string org-html-metadata-timestamp-format)))
|
||||
(format-time-string
|
||||
(plist-get info :html-metadata-timestamp-format))))
|
||||
(when (plist-get info :with-creator)
|
||||
(format "<p class=\"creator\">%s</p>\n" creator))
|
||||
(format "<p class=\"validation\">%s</p>\n"
|
||||
|
@ -1788,14 +1779,15 @@ communication channel."
|
|||
(eval
|
||||
(intern (format "org-html-%s-format" type))))))
|
||||
spec))))))
|
||||
(when (org-string-nw-p section-contents)
|
||||
(concat
|
||||
(format "<%s id=\"%s\" class=\"%s\">\n"
|
||||
(nth 1 (assq type org-html-divs))
|
||||
(nth 2 (assq type org-html-divs))
|
||||
org-html--pre/postamble-class)
|
||||
(org-element-normalize-string section-contents)
|
||||
(format "</%s>\n" (nth 1 (assq type org-html-divs)))))))))
|
||||
(let ((div (assq type (plist-get info :html-divs))))
|
||||
(when (org-string-nw-p section-contents)
|
||||
(concat
|
||||
(format "<%s id=\"%s\" class=\"%s\">\n"
|
||||
(nth 1 div)
|
||||
(nth 2 div)
|
||||
org-html--pre/postamble-class)
|
||||
(org-element-normalize-string section-contents)
|
||||
(format "</%s>\n" (nth 1 div)))))))))
|
||||
|
||||
(defun org-html-inner-template (contents info)
|
||||
"Return body of document string after HTML conversion.
|
||||
|
@ -1816,20 +1808,19 @@ CONTENTS is the transcoded contents string. INFO is a plist
|
|||
holding export options."
|
||||
(concat
|
||||
(when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))
|
||||
(let ((decl (or (and (stringp org-html-xml-declaration)
|
||||
org-html-xml-declaration)
|
||||
(cdr (assoc (plist-get info :html-extension)
|
||||
org-html-xml-declaration))
|
||||
(cdr (assoc "html" org-html-xml-declaration))
|
||||
|
||||
"")))
|
||||
(when (not (or (eq nil decl) (string= "" decl)))
|
||||
(let* ((xml-declaration (plist-get info :html-xml-declaration))
|
||||
(decl (or (and (stringp xml-declaration) xml-declaration)
|
||||
(cdr (assoc (plist-get info :html-extension)
|
||||
xml-declaration))
|
||||
(cdr (assoc "html" xml-declaration))
|
||||
"")))
|
||||
(when (not (or (not decl) (string= "" decl)))
|
||||
(format "%s\n"
|
||||
(format decl
|
||||
(or (and org-html-coding-system
|
||||
(fboundp 'coding-system-get)
|
||||
(coding-system-get org-html-coding-system 'mime-charset))
|
||||
"iso-8859-1"))))))
|
||||
(or (and org-html-coding-system
|
||||
(fboundp 'coding-system-get)
|
||||
(coding-system-get org-html-coding-system 'mime-charset))
|
||||
"iso-8859-1"))))))
|
||||
(org-html-doctype info)
|
||||
"\n"
|
||||
(concat "<html"
|
||||
|
@ -1847,21 +1838,20 @@ holding export options."
|
|||
(let ((link-up (org-trim (plist-get info :html-link-up)))
|
||||
(link-home (org-trim (plist-get info :html-link-home))))
|
||||
(unless (and (string= link-up "") (string= link-home ""))
|
||||
(format org-html-home/up-format
|
||||
(format (plist-get info :html-home/up-format)
|
||||
(or link-up link-home)
|
||||
(or link-home link-up))))
|
||||
;; Preamble.
|
||||
(org-html--build-pre/postamble 'preamble info)
|
||||
;; Document contents.
|
||||
(format "<%s id=\"%s\">\n"
|
||||
(nth 1 (assq 'content org-html-divs))
|
||||
(nth 2 (assq 'content org-html-divs)))
|
||||
(let ((div (assq 'content (plist-get info :html-divs))))
|
||||
(format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div)))
|
||||
;; Document title.
|
||||
(let ((title (plist-get info :title)))
|
||||
(format "<h1 class=\"title\">%s</h1>\n" (org-export-data (or title "") info)))
|
||||
(format "<h1 class=\"title\">%s</h1>\n"
|
||||
(org-export-data (or title "") info)))
|
||||
contents
|
||||
(format "</%s>\n"
|
||||
(nth 1 (assq 'content org-html-divs)))
|
||||
(format "</%s>\n" (nth 1 (assq 'content (plist-get info :html-divs))))
|
||||
;; Postamble.
|
||||
(org-html--build-pre/postamble 'postamble info)
|
||||
;; Closing document.
|
||||
|
@ -1874,9 +1864,9 @@ INFO is a plist used as a communication channel."
|
|||
|
||||
;;;; Anchor
|
||||
|
||||
(defun org-html--anchor (&optional id desc attributes)
|
||||
(defun org-html--anchor (id desc attributes info)
|
||||
"Format a HTML anchor."
|
||||
(let* ((name (and org-html-allow-name-attribute-in-anchors id))
|
||||
(let* ((name (and (plist-get info :html-allow-name-attribute-in-anchors) id))
|
||||
(attributes (concat (and id (format " id=\"%s\"" id))
|
||||
(and name (format " name=\"%s\"" name))
|
||||
attributes)))
|
||||
|
@ -1884,43 +1874,30 @@ INFO is a plist used as a communication channel."
|
|||
|
||||
;;;; Todo
|
||||
|
||||
(defun org-html--todo (todo)
|
||||
(defun org-html--todo (todo info)
|
||||
"Format TODO keywords into HTML."
|
||||
(when todo
|
||||
(format "<span class=\"%s %s%s\">%s</span>"
|
||||
(if (member todo org-done-keywords) "done" "todo")
|
||||
org-html-todo-kwd-class-prefix (org-html-fix-class-name todo)
|
||||
(plist-get info :html-todo-kwd-class-prefix)
|
||||
(org-html-fix-class-name todo)
|
||||
todo)))
|
||||
|
||||
;;;; Tags
|
||||
|
||||
(defun org-html--tags (tags)
|
||||
"Format TAGS into HTML."
|
||||
(defun org-html--tags (tags info)
|
||||
"Format TAGS into HTML.
|
||||
INFO is a plist containing export options."
|
||||
(when tags
|
||||
(format "<span class=\"tag\">%s</span>"
|
||||
(mapconcat
|
||||
(lambda (tag)
|
||||
(format "<span class=\"%s\">%s</span>"
|
||||
(concat org-html-tag-class-prefix
|
||||
(concat (plist-get info :html-tag-class-prefix)
|
||||
(org-html-fix-class-name tag))
|
||||
tag))
|
||||
tags " "))))
|
||||
|
||||
;;;; Headline
|
||||
|
||||
(defun* org-html-format-headline
|
||||
(todo todo-type priority text tags
|
||||
&key level section-number headline-label &allow-other-keys)
|
||||
"Format a headline in HTML."
|
||||
(let ((section-number
|
||||
(when section-number
|
||||
(format "<span class=\"section-number-%d\">%s</span> "
|
||||
level section-number)))
|
||||
(todo (org-html--todo todo))
|
||||
(tags (org-html--tags tags)))
|
||||
(concat section-number todo (and todo " ") text
|
||||
(and tags "   ") tags)))
|
||||
|
||||
;;;; Src Code
|
||||
|
||||
(defun org-html-fontify-code (code lang)
|
||||
|
@ -2054,10 +2031,11 @@ contents as a string, or nil if it is empty."
|
|||
"div")))
|
||||
(when toc-entries
|
||||
(concat (format "<%s id=\"table-of-contents\">\n" outer-tag)
|
||||
(format "<h%d>%s</h%d>\n"
|
||||
org-html-toplevel-hlevel
|
||||
(org-html--translate "Table of Contents" info)
|
||||
org-html-toplevel-hlevel)
|
||||
(let ((top-level (plist-get info :html-toplevel-hlevel)))
|
||||
(format "<h%d>%s</h%d>\n"
|
||||
top-level
|
||||
(org-html--translate "Table of Contents" info)
|
||||
top-level))
|
||||
"<div id=\"text-table-of-contents\">"
|
||||
(org-html--toc-text toc-entries)
|
||||
"</div>\n"
|
||||
|
@ -2124,11 +2102,7 @@ INFO is a plist used as a communication channel."
|
|||
(org-export-numbered-headline-p headline info)
|
||||
(concat (mapconcat #'number-to-string headline-number ".")
|
||||
". "))
|
||||
(apply (if (not (eq org-html-format-headline-function 'ignore))
|
||||
(lambda (todo todo-type priority text tags &rest ignore)
|
||||
(funcall org-html-format-headline-function
|
||||
todo todo-type priority text tags))
|
||||
#'org-html-format-headline)
|
||||
(apply (plist-get info :html-format-headline-function)
|
||||
todo todo-type priority text tags :section-number nil)))))
|
||||
|
||||
(defun org-html-list-of-listings (info)
|
||||
|
@ -2138,10 +2112,11 @@ of listings as a string, or nil if it is empty."
|
|||
(let ((lol-entries (org-export-collect-listings info)))
|
||||
(when lol-entries
|
||||
(concat "<div id=\"list-of-listings\">\n"
|
||||
(format "<h%d>%s</h%d>\n"
|
||||
org-html-toplevel-hlevel
|
||||
(org-html--translate "List of Listings" info)
|
||||
org-html-toplevel-hlevel)
|
||||
(let ((top-level (plist-get info :html-toplevel-hlevel)))
|
||||
(format "<h%d>%s</h%d>\n"
|
||||
top-level
|
||||
(org-html--translate "List of Listings" info)
|
||||
top-level))
|
||||
"<div id=\"text-list-of-listings\">\n<ul>\n"
|
||||
(let ((count 0)
|
||||
(initial-fmt (format "<span class=\"listing-number\">%s</span>"
|
||||
|
@ -2173,10 +2148,11 @@ of tables as a string, or nil if it is empty."
|
|||
(let ((lol-entries (org-export-collect-tables info)))
|
||||
(when lol-entries
|
||||
(concat "<div id=\"list-of-tables\">\n"
|
||||
(format "<h%d>%s</h%d>\n"
|
||||
org-html-toplevel-hlevel
|
||||
(org-html--translate "List of Tables" info)
|
||||
org-html-toplevel-hlevel)
|
||||
(let ((top-level (plist-get info :html-toplevel-hlevel)))
|
||||
(format "<h%d>%s</h%d>\n"
|
||||
top-level
|
||||
(org-html--translate "List of Tables" info)
|
||||
top-level))
|
||||
"<div id=\"text-list-of-tables\">\n<ul>\n"
|
||||
(let ((count 0)
|
||||
(initial-fmt (format "<span class=\"table-number\">%s</span>"
|
||||
|
@ -2210,7 +2186,7 @@ of tables as a string, or nil if it is empty."
|
|||
"Transcode BOLD from Org to HTML.
|
||||
CONTENTS is the text with bold markup. INFO is a plist holding
|
||||
contextual information."
|
||||
(format (or (cdr (assq 'bold org-html-text-markup-alist)) "%s")
|
||||
(format (or (cdr (assq 'bold (plist-get info :html-text-markup-alist))) "%s")
|
||||
contents))
|
||||
|
||||
;;;; Center Block
|
||||
|
@ -2245,7 +2221,7 @@ channel."
|
|||
"Transcode CODE from Org to HTML.
|
||||
CONTENTS is nil. INFO is a plist holding contextual
|
||||
information."
|
||||
(format (or (cdr (assq 'code org-html-text-markup-alist)) "%s")
|
||||
(format (or (cdr (assq 'code (plist-get info :html-text-markup-alist))) "%s")
|
||||
(org-html-encode-plain-text (org-element-property :value code))))
|
||||
|
||||
;;;; Drawer
|
||||
|
@ -2254,13 +2230,9 @@ information."
|
|||
"Transcode a DRAWER element from Org to HTML.
|
||||
CONTENTS holds the contents of the block. INFO is a plist
|
||||
holding contextual information."
|
||||
(if (functionp org-html-format-drawer-function)
|
||||
(funcall org-html-format-drawer-function
|
||||
(org-element-property :drawer-name drawer)
|
||||
contents)
|
||||
;; If there's no user defined function: simply
|
||||
;; display contents of the drawer.
|
||||
contents))
|
||||
(funcall (plist-get info :html-format-drawer-function)
|
||||
(org-element-property :drawer-name drawer)
|
||||
contents))
|
||||
|
||||
;;;; Dynamic Block
|
||||
|
||||
|
@ -2317,87 +2289,44 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
;; Insert separator between two footnotes in a row.
|
||||
(let ((prev (org-export-get-previous-element footnote-reference info)))
|
||||
(when (eq (org-element-type prev) 'footnote-reference)
|
||||
org-html-footnote-separator))
|
||||
(cond
|
||||
((not (org-export-footnote-first-reference-p footnote-reference info))
|
||||
(org-html-format-footnote-reference
|
||||
(org-export-get-footnote-number footnote-reference info)
|
||||
"IGNORED" 100))
|
||||
;; Inline definitions are secondary strings.
|
||||
((eq (org-element-property :type footnote-reference) 'inline)
|
||||
(org-html-format-footnote-reference
|
||||
(org-export-get-footnote-number footnote-reference info)
|
||||
"IGNORED" 1))
|
||||
;; Non-inline footnotes definitions are full Org data.
|
||||
(t (org-html-format-footnote-reference
|
||||
(org-export-get-footnote-number footnote-reference info)
|
||||
"IGNORED" 1)))))
|
||||
(plist-get info :html-footnote-separator)))
|
||||
(let* ((n (org-export-get-footnote-number footnote-reference info))
|
||||
(id (format "fnr.%d%s"
|
||||
n
|
||||
(if (org-export-footnote-first-reference-p
|
||||
footnote-reference info)
|
||||
""
|
||||
".100"))))
|
||||
(format
|
||||
(plist-get info :html-footnote-format)
|
||||
(org-html--anchor
|
||||
id n (format " class=\"footref\" href=\"#fn.%d\"" n) info)))))
|
||||
|
||||
;;;; Headline
|
||||
|
||||
(defun org-html-format-headline--wrap
|
||||
(headline info &optional format-function &rest extra-keys)
|
||||
"Transcode a HEADLINE element from Org to HTML.
|
||||
CONTENTS holds the contents of the headline. INFO is a plist
|
||||
holding contextual information."
|
||||
(let* ((level (+ (org-export-get-relative-level headline info)
|
||||
(1- org-html-toplevel-hlevel)))
|
||||
(headline-number (org-export-get-headline-number headline info))
|
||||
(section-number (and (not (org-export-low-level-p headline info))
|
||||
(org-export-numbered-headline-p headline info)
|
||||
(mapconcat 'number-to-string
|
||||
headline-number ".")))
|
||||
(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)))
|
||||
(priority (and (plist-get info :with-priority)
|
||||
(org-element-property :priority headline)))
|
||||
(text (org-export-data (org-element-property :title headline) info))
|
||||
(tags (and (plist-get info :with-tags)
|
||||
(org-export-get-tags headline info)))
|
||||
(headline-label (or (org-element-property :CUSTOM_ID headline)
|
||||
(concat "sec-" (mapconcat 'number-to-string
|
||||
headline-number "-"))))
|
||||
(format-function
|
||||
(cond ((functionp format-function) format-function)
|
||||
((not (eq org-html-format-headline-function 'ignore))
|
||||
(lambda (todo todo-type priority text tags &rest ignore)
|
||||
(funcall org-html-format-headline-function
|
||||
todo todo-type priority text tags)))
|
||||
(t 'org-html-format-headline))))
|
||||
(apply format-function
|
||||
todo todo-type priority text tags
|
||||
:headline-label headline-label :level level
|
||||
:section-number section-number extra-keys)))
|
||||
|
||||
(defun org-html-headline (headline contents info)
|
||||
"Transcode a HEADLINE element from Org to HTML.
|
||||
CONTENTS holds the contents of the headline. INFO is a plist
|
||||
holding contextual information."
|
||||
;; Empty contents?
|
||||
(setq contents (or contents ""))
|
||||
(let* ((numberedp (org-export-numbered-headline-p headline info))
|
||||
(level (org-export-get-relative-level headline info))
|
||||
(text (org-export-data (org-element-property :title headline) info))
|
||||
(level (+ (org-export-get-relative-level headline info)
|
||||
(1- (plist-get info :html-toplevel-hlevel))))
|
||||
(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)))
|
||||
(section-number (and (org-export-numbered-headline-p headline info)
|
||||
(mapconcat 'number-to-string
|
||||
(org-export-get-headline-number
|
||||
headline info) ".")))
|
||||
;; Create the headline text.
|
||||
(full-text (org-html-format-headline--wrap headline info)))
|
||||
(text (org-export-data (org-element-property :title headline) info))
|
||||
(tags (and (plist-get info :with-tags)
|
||||
(org-export-get-tags headline info)))
|
||||
(full-text (funcall (plist-get info :html-format-headline-function)
|
||||
todo todo-type priority text tags info))
|
||||
(contents (or contents "")))
|
||||
(cond
|
||||
;; Case 1: This is a footnote section: ignore it.
|
||||
((org-element-property :footnote-section-p headline) nil)
|
||||
;; Case 2. This is a deep sub-tree: export it as a list item.
|
||||
;; Case 2: This is a deep sub-tree: export it as a list item.
|
||||
;; Also export as items headlines for which no section
|
||||
;; format has been found.
|
||||
((org-export-low-level-p headline info)
|
||||
|
@ -2405,54 +2334,62 @@ holding contextual information."
|
|||
(let* ((type (if numberedp 'ordered 'unordered))
|
||||
(itemized-body (org-html-format-list-item
|
||||
contents type nil info nil full-text)))
|
||||
(concat
|
||||
(and (org-export-first-sibling-p headline info)
|
||||
(org-html-begin-plain-list type))
|
||||
itemized-body
|
||||
(and (org-export-last-sibling-p headline info)
|
||||
(org-html-end-plain-list type)))))
|
||||
;; Case 3. Standard headline. Export it as a section.
|
||||
(concat (and (org-export-first-sibling-p headline info)
|
||||
(org-html-begin-plain-list type))
|
||||
itemized-body
|
||||
(and (org-export-last-sibling-p headline info)
|
||||
(org-html-end-plain-list type)))))
|
||||
;; Case 3: Standard headline. Export it as a section.
|
||||
(t
|
||||
(let* ((section-number (mapconcat 'number-to-string
|
||||
(org-export-get-headline-number
|
||||
headline info) "-"))
|
||||
(ids (remove 'nil
|
||||
(list (org-element-property :CUSTOM_ID headline)
|
||||
(concat "sec-" section-number)
|
||||
(org-element-property :ID headline))))
|
||||
(let* ((headline-number
|
||||
(and numberedp (org-export-get-headline-number headline info)))
|
||||
(section-number (mapconcat #'number-to-string headline-number "-"))
|
||||
(ids (remq nil
|
||||
(list (org-element-property :CUSTOM_ID headline)
|
||||
(concat "sec-" section-number)
|
||||
(org-element-property :ID headline))))
|
||||
(preferred-id (car ids))
|
||||
(extra-ids (cdr ids))
|
||||
(extra-class (org-element-property :HTML_CONTAINER_CLASS headline))
|
||||
(level1 (+ level (1- org-html-toplevel-hlevel)))
|
||||
(first-content (car (org-element-contents headline))))
|
||||
(format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n"
|
||||
(org-html--container headline info)
|
||||
(format "outline-container-%s"
|
||||
(or (org-element-property :CUSTOM_ID headline)
|
||||
(concat "sec-" section-number)))
|
||||
(concat (format "outline-%d" level1) (and extra-class " ")
|
||||
(concat (format "outline-%d" level)
|
||||
(and extra-class " ")
|
||||
extra-class)
|
||||
(format "\n<h%d id=\"%s\">%s%s</h%d>\n"
|
||||
level1
|
||||
level
|
||||
preferred-id
|
||||
(mapconcat
|
||||
(lambda (x)
|
||||
(let ((id (org-export-solidify-link-text
|
||||
(if (org-uuidgen-p x) (concat "ID-" x)
|
||||
x))))
|
||||
(org-html--anchor id)))
|
||||
(org-html--anchor id nil nil info)))
|
||||
extra-ids "")
|
||||
full-text
|
||||
level1)
|
||||
(concat
|
||||
(mapconcat #'number-to-string headline-number ".")
|
||||
(and headline-number " ")
|
||||
full-text)
|
||||
level)
|
||||
;; When there is no section, pretend there is an empty
|
||||
;; one to get the correct <div class="outline- ...>
|
||||
;; which is needed by `org-info.js'.
|
||||
(if (not (eq (org-element-type first-content) 'section))
|
||||
(concat (org-html-section first-content "" info)
|
||||
contents)
|
||||
contents)
|
||||
(if (eq (org-element-type first-content) 'section) contents
|
||||
(concat (org-html-section first-content "" info) contents))
|
||||
(org-html--container headline info)))))))
|
||||
|
||||
(defun org-html-format-headline-default-function
|
||||
(todo todo-type priority text tags info)
|
||||
"Default format function for a headline.
|
||||
See `org-html-format-headline-function' for details."
|
||||
(let ((todo (org-html--todo todo info))
|
||||
(tags (org-html--tags tags info)))
|
||||
(concat todo (and todo " ") text (and tags "   ") tags)))
|
||||
|
||||
(defun org-html--container (headline info)
|
||||
(or (org-element-property :HTML_CONTAINER headline)
|
||||
(if (= 1 (org-export-get-relative-level headline info))
|
||||
|
@ -2478,32 +2415,31 @@ contextual information."
|
|||
|
||||
;;;; Inlinetask
|
||||
|
||||
(defun org-html-format-section (text class &optional id)
|
||||
"Format a section with TEXT into a HTML div with CLASS and ID."
|
||||
(let ((extra (concat (when id (format " id=\"%s\"" id)))))
|
||||
(concat (format "<div class=\"%s\"%s>\n" class extra) text "</div>\n")))
|
||||
|
||||
(defun org-html-inlinetask (inlinetask contents info)
|
||||
"Transcode an INLINETASK element from Org to HTML.
|
||||
CONTENTS holds the contents of the block. INFO is a plist
|
||||
holding contextual information."
|
||||
(cond
|
||||
;; If `org-html-format-inlinetask-function' is not 'ignore, call it
|
||||
;; with appropriate arguments.
|
||||
((not (eq org-html-format-inlinetask-function 'ignore))
|
||||
(let ((format-function
|
||||
(function*
|
||||
(lambda (todo todo-type priority text tags
|
||||
&key contents &allow-other-keys)
|
||||
(funcall org-html-format-inlinetask-function
|
||||
todo todo-type priority text tags contents)))))
|
||||
(org-html-format-headline--wrap
|
||||
inlinetask info format-function :contents contents)))
|
||||
;; Otherwise, use a default template.
|
||||
(t (format "<div class=\"inlinetask\">\n<b>%s</b>%s\n%s</div>"
|
||||
(org-html-format-headline--wrap inlinetask info)
|
||||
(org-html-close-tag "br" nil info)
|
||||
contents))))
|
||||
(let* ((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 (and todo (org-element-property :todo-type inlinetask)))
|
||||
(priority (and (plist-get info :with-priority)
|
||||
(org-element-property :priority inlinetask)))
|
||||
(text (org-export-data (org-element-property :title inlinetask) info))
|
||||
(tags (and (plist-get info :with-tags)
|
||||
(org-export-get-tags inlinetask info))))
|
||||
(funcall (plist-get info :html-format-inlinetask-function)
|
||||
todo todo-type priority text tags contents)))
|
||||
|
||||
(defun org-html-format-inlinetask-default-function
|
||||
(todo todo-type priority text tags contents info)
|
||||
"Default format function for a inlinetasks.
|
||||
See `org-html-format-inlinetask-function' for details."
|
||||
(format "<div class=\"inlinetask\">\n<b>%s</b>%s\n%s</div>"
|
||||
(org-html-format-headline-default-function
|
||||
todo todo-type priority text tags info)
|
||||
(org-html-close-tag "br" nil info)
|
||||
contents))
|
||||
|
||||
;;;; Italic
|
||||
|
||||
|
@ -2511,7 +2447,9 @@ holding contextual information."
|
|||
"Transcode ITALIC from Org to HTML.
|
||||
CONTENTS is the text with italic markup. INFO is a plist holding
|
||||
contextual information."
|
||||
(format (or (cdr (assq 'italic org-html-text-markup-alist)) "%s") contents))
|
||||
(format
|
||||
(or (cdr (assq 'italic (plist-get info :html-text-markup-alist))) "%s")
|
||||
contents))
|
||||
|
||||
;;;; Item
|
||||
|
||||
|
@ -2520,7 +2458,8 @@ contextual information."
|
|||
INFO is a plist holding contextual information. See
|
||||
`org-html-checkbox-type' for customization options."
|
||||
(cdr (assq checkbox
|
||||
(cdr (assq org-html-checkbox-type org-html-checkbox-types)))))
|
||||
(cdr (assq (plist-get info :html-checkbox-type)
|
||||
org-html-checkbox-types)))))
|
||||
|
||||
(defun org-html-format-list-item (contents type checkbox info
|
||||
&optional term-counter-id
|
||||
|
@ -2683,7 +2622,8 @@ inline image when it has no description and targets an image
|
|||
file (see `org-html-inline-image-rules' for more information), or
|
||||
if its description is a single link targeting an image file."
|
||||
(if (not (org-element-contents link))
|
||||
(org-export-inline-image-p link org-html-inline-image-rules)
|
||||
(org-export-inline-image-p
|
||||
link (plist-get info :html-inline-image-rules))
|
||||
(not
|
||||
(let ((link-count 0))
|
||||
(org-element-map (org-element-contents link)
|
||||
|
@ -2694,7 +2634,7 @@ if its description is a single link targeting an image file."
|
|||
(link (if (= link-count 1) t
|
||||
(incf link-count)
|
||||
(not (org-export-inline-image-p
|
||||
obj org-html-inline-image-rules))))
|
||||
obj (plist-get info :html-inline-image-rules)))))
|
||||
(otherwise t)))
|
||||
info t)))))
|
||||
|
||||
|
@ -2752,7 +2692,7 @@ INFO is a plist holding contextual information. See
|
|||
"Treat links to `file.org' as links to `file.html', if needed.
|
||||
See `org-html-link-org-files-as-html'."
|
||||
(cond
|
||||
((and org-html-link-org-files-as-html
|
||||
((and (plist-get info :html-link-org-files-as-html)
|
||||
(string= ".org"
|
||||
(downcase (file-name-extension raw-path "."))))
|
||||
(concat (file-name-sans-extension raw-path) "."
|
||||
|
@ -2814,8 +2754,9 @@ INFO is a plist holding contextual information. See
|
|||
protocol)
|
||||
(cond
|
||||
;; Image file.
|
||||
((and org-html-inline-images
|
||||
(org-export-inline-image-p link org-html-inline-image-rules))
|
||||
((and (plist-get info :html-inline-images)
|
||||
(org-export-inline-image-p
|
||||
link (plist-get info :html-inline-image-rules)))
|
||||
(org-html--format-image path attributes-plist info))
|
||||
;; Radio target: Transcode target's contents and use them as
|
||||
;; link's description.
|
||||
|
@ -3119,7 +3060,7 @@ holding contextual information."
|
|||
(if (not parent) contents
|
||||
;; Get div's class and id references.
|
||||
(let* ((class-num (+ (org-export-get-relative-level parent info)
|
||||
(1- org-html-toplevel-hlevel)))
|
||||
(1- (plist-get info :html-toplevel-hlevel))))
|
||||
(section-number
|
||||
(mapconcat
|
||||
'number-to-string
|
||||
|
@ -3138,7 +3079,7 @@ TEXT is the text of the target. INFO is a plist holding
|
|||
contextual information."
|
||||
(let ((id (org-export-solidify-link-text
|
||||
(org-element-property :value radio-target))))
|
||||
(org-html--anchor id text)))
|
||||
(org-html--anchor id text nil info)))
|
||||
|
||||
;;;; Special Block
|
||||
|
||||
|
@ -3203,8 +3144,10 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
"Transcode STRIKE-THROUGH from Org to HTML.
|
||||
CONTENTS is the text with strike-through markup. INFO is a plist
|
||||
holding contextual information."
|
||||
(format (or (cdr (assq 'strike-through org-html-text-markup-alist)) "%s")
|
||||
contents))
|
||||
(format
|
||||
(or (cdr (assq 'strike-through (plist-get info :html-text-markup-alist)))
|
||||
"%s")
|
||||
contents))
|
||||
|
||||
;;;; Subscript
|
||||
|
||||
|
@ -3231,7 +3174,7 @@ channel."
|
|||
(let* ((table-row (org-export-get-parent table-cell))
|
||||
(table (org-export-get-parent-table table-cell))
|
||||
(cell-attrs
|
||||
(if (not org-html-table-align-individual-fields) ""
|
||||
(if (not (plist-get info :html-table-align-individual-fields)) ""
|
||||
(format (if (and (boundp 'org-html-format-table-no-css)
|
||||
org-html-format-table-no-css)
|
||||
" align=\"%s\"" " class=\"%s\"")
|
||||
|
@ -3241,14 +3184,20 @@ channel."
|
|||
(cond
|
||||
((and (org-export-table-has-header-p table info)
|
||||
(= 1 (org-export-table-row-group table-row info)))
|
||||
(concat "\n" (format (car org-html-table-header-tags) "col" cell-attrs)
|
||||
contents (cdr org-html-table-header-tags)))
|
||||
((and org-html-table-use-header-tags-for-first-column
|
||||
(let ((header-tags (plist-get info :html-table-header-tags)))
|
||||
(concat "\n" (format (car header-tags) "col" cell-attrs)
|
||||
contents
|
||||
(cdr header-tags))))
|
||||
((and (plist-get info :html-table-use-header-tags-for-first-column)
|
||||
(zerop (cdr (org-export-table-cell-address table-cell info))))
|
||||
(concat "\n" (format (car org-html-table-header-tags) "row" cell-attrs)
|
||||
contents (cdr org-html-table-header-tags)))
|
||||
(t (concat "\n" (format (car org-html-table-data-tags) cell-attrs)
|
||||
contents (cdr org-html-table-data-tags))))))
|
||||
(let ((header-tags (plist-get info :html-table-header-tags)))
|
||||
(concat "\n" (format (car header-tags) "row" cell-attrs)
|
||||
contents
|
||||
(cdr header-tags))))
|
||||
(t (let ((data-tags (plist-get info :html-table-data-tags)))
|
||||
(concat "\n" (format (car data-tags) cell-attrs)
|
||||
contents
|
||||
(cdr data-tags)))))))
|
||||
|
||||
;;;; Table Row
|
||||
|
||||
|
@ -3287,10 +3236,10 @@ communication channel."
|
|||
;; Begin a rowgroup?
|
||||
(when start-rowgroup-p (car rowgroup-tags))
|
||||
;; Actual table row
|
||||
(concat "\n" (eval (car org-html-table-row-tags))
|
||||
(concat "\n" (eval (car (plist-get info :html-table-row-tags)))
|
||||
contents
|
||||
"\n"
|
||||
(eval (cdr org-html-table-row-tags)))
|
||||
(eval (cdr (plist-get info :html-table-row-tags))))
|
||||
;; End a rowgroup?
|
||||
(when end-rowgroup-p (cdr rowgroup-tags))))))
|
||||
|
||||
|
@ -3373,7 +3322,7 @@ contextual information."
|
|||
(format "<table%s>\n%s\n%s\n%s</table>"
|
||||
(if (equal attributes "") "" (concat " " attributes))
|
||||
(if (not caption) ""
|
||||
(format (if org-html-table-caption-above
|
||||
(format (if (plist-get info :html-table-caption-above)
|
||||
"<caption class=\"t-above\">%s</caption>"
|
||||
"<caption class=\"t-bottom\">%s</caption>")
|
||||
(concat
|
||||
|
@ -3391,7 +3340,7 @@ CONTENTS is nil. INFO is a plist holding contextual
|
|||
information."
|
||||
(let ((id (org-export-solidify-link-text
|
||||
(org-element-property :value target))))
|
||||
(org-html--anchor id)))
|
||||
(org-html--anchor id nil nil info)))
|
||||
|
||||
;;;; Timestamp
|
||||
|
||||
|
@ -3410,7 +3359,8 @@ information."
|
|||
"Transcode UNDERLINE from Org to HTML.
|
||||
CONTENTS is the text with underline markup. INFO is a plist
|
||||
holding contextual information."
|
||||
(format (or (cdr (assq 'underline org-html-text-markup-alist)) "%s")
|
||||
(format (or (cdr (assq 'underline (plist-get info :html-text-markup-alist)))
|
||||
"%s")
|
||||
contents))
|
||||
|
||||
;;;; Verbatim
|
||||
|
@ -3419,7 +3369,7 @@ holding contextual information."
|
|||
"Transcode VERBATIM from Org to HTML.
|
||||
CONTENTS is nil. INFO is a plist holding contextual
|
||||
information."
|
||||
(format (or (cdr (assq 'verbatim org-html-text-markup-alist)) "%s")
|
||||
(format (or (cdr (assq 'verbatim (plist-get info :html-text-markup-alist))) "%s")
|
||||
(org-html-encode-plain-text (org-element-property :value verbatim))))
|
||||
|
||||
;;;; Verse Block
|
||||
|
@ -3452,9 +3402,9 @@ contextual information."
|
|||
(with-temp-buffer
|
||||
(insert contents)
|
||||
(set-auto-mode t)
|
||||
(if org-html-indent
|
||||
(if (plist-get info :html-indent)
|
||||
(indent-region (point-min) (point-max)))
|
||||
(when org-html-use-unicode-chars
|
||||
(when (plist-get info :html-use-unicode-chars)
|
||||
(require 'mm-url)
|
||||
(mm-url-decode-entities))
|
||||
(buffer-substring-no-properties (point-min) (point-max))))
|
||||
|
@ -3537,7 +3487,9 @@ file-local settings.
|
|||
|
||||
Return output file's name."
|
||||
(interactive)
|
||||
(let* ((extension (concat "." org-html-extension))
|
||||
(let* ((extension (concat "." (or (plist-get ext-plist :html-extension)
|
||||
org-html-extension
|
||||
"html")))
|
||||
(file (org-export-output-file-name extension subtreep))
|
||||
(org-export-coding-system org-html-coding-system))
|
||||
(org-export-to-file 'html file
|
||||
|
@ -3554,7 +3506,8 @@ publishing directory.
|
|||
Return output file name."
|
||||
(org-publish-org-to 'html filename
|
||||
(concat "." (or (plist-get plist :html-extension)
|
||||
org-html-extension "html"))
|
||||
org-html-extension
|
||||
"html"))
|
||||
plist pub-dir))
|
||||
|
||||
|
||||
|
|
|
@ -261,9 +261,6 @@ re-read the iCalendar file.")
|
|||
;; Other variables.
|
||||
(:icalendar-alarm-time nil nil org-icalendar-alarm-time)
|
||||
(:icalendar-categories nil nil org-icalendar-categories)
|
||||
(:icalendar-combined-agenda-file nil nil org-icalendar-combined-agenda-file)
|
||||
(:icalendar-combined-description nil nil org-icalendar-combined-description)
|
||||
(:icalendar-combined-name nil nil org-icalendar-combined-name)
|
||||
(:icalendar-date-time-format nil nil org-icalendar-date-time-format)
|
||||
(:icalendar-include-bbdb-anniversaries nil nil org-icalendar-include-bbdb-anniversaries)
|
||||
(:icalendar-include-body nil nil org-icalendar-include-body)
|
||||
|
|
336
lisp/ox-latex.el
336
lisp/ox-latex.el
|
@ -124,17 +124,12 @@
|
|||
(:latex-image-default-width nil nil org-latex-image-default-width)
|
||||
(:latex-inactive-timestamp-format nil nil org-latex-inactive-timestamp-format)
|
||||
(:latex-inline-image-rules nil nil org-latex-inline-image-rules)
|
||||
(:latex-inputenc-alist nil nil org-latex-inputenc-alist)
|
||||
(:latex-known-warnings nil nil org-latex-known-warnings)
|
||||
(:latex-link-with-unknown-path-format nil nil org-latex-link-with-unknown-path-format)
|
||||
(:latex-listings nil nil org-latex-listings)
|
||||
(:latex-listings-langs nil nil org-latex-listings-langs)
|
||||
(:latex-listings-options nil nil org-latex-listings-options)
|
||||
(:latex-logfiles-extensions nil nil org-latex-logfiles-extensions)
|
||||
(:latex-minted-langs nil nil org-latex-minted-langs)
|
||||
(:latex-minted-options nil nil org-latex-minted-options)
|
||||
(:latex-pdf-process nil nil org-latex-pdf-process)
|
||||
(:latex-remove-logfiles nil nil org-latex-remove-logfiles)
|
||||
(:latex-table-caption-above nil nil org-latex-table-caption-above)
|
||||
(:latex-table-scientific-notation nil nil org-latex-table-scientific-notation)
|
||||
(:latex-tables-booktabs nil nil org-latex-tables-booktabs)
|
||||
|
@ -683,7 +678,8 @@ The default function simply returns the value of CONTENTS."
|
|||
|
||||
;;;; Inlinetasks
|
||||
|
||||
(defcustom org-latex-format-inlinetask-function 'ignore
|
||||
(defcustom org-latex-format-inlinetask-function
|
||||
'org-latex-format-inlinetask-default-function
|
||||
"Function called to format an inlinetask in LaTeX code.
|
||||
|
||||
The function must accept six parameters:
|
||||
|
@ -696,31 +692,11 @@ The function must accept six parameters:
|
|||
|
||||
The function should return the string to be exported.
|
||||
|
||||
For example, the variable could be set to the following function
|
||||
in order to mimic default behaviour:
|
||||
|
||||
\(defun org-latex-format-inlinetask \(todo type priority name tags contents\)
|
||||
\"Format an inline task element for LaTeX export.\"
|
||||
\(let ((full-title
|
||||
\(concat
|
||||
\(when todo
|
||||
\(format \"\\\\textbf{\\\\textsf{\\\\textsc{%s}}} \" todo))
|
||||
\(when priority (format \"\\\\framebox{\\\\#%c} \" priority))
|
||||
title
|
||||
\(when tags
|
||||
\(format \"\\\\hfill{}\\\\textsc{:%s:}\"
|
||||
\(mapconcat 'identity tags \":\")))))
|
||||
\(format (concat \"\\\\begin{center}\\n\"
|
||||
\"\\\\fbox{\\n\"
|
||||
\"\\\\begin{minipage}[c]{.6\\\\textwidth}\\n\"
|
||||
\"%s\\n\\n\"
|
||||
\"\\\\rule[.8em]{\\\\textwidth}{2pt}\\n\\n\"
|
||||
\"%s\"
|
||||
\"\\\\end{minipage}}\"
|
||||
\"\\\\end{center}\")
|
||||
full-title contents))"
|
||||
Use `org-latex-format-headline-default-function' by default."
|
||||
:group 'org-export-latex
|
||||
:type 'function)
|
||||
:type 'function
|
||||
:version "24.5"
|
||||
:package-version '(Org . "8.3"))
|
||||
|
||||
|
||||
;; Src blocks
|
||||
|
@ -1113,10 +1089,11 @@ This function shouldn't be used for floats. See
|
|||
(concat (format "\\label{%s}\n" (org-export-solidify-link-text label))
|
||||
output))))
|
||||
|
||||
(defun org-latex--text-markup (text markup)
|
||||
(defun org-latex--text-markup (text markup info)
|
||||
"Format TEXT depending on MARKUP text markup.
|
||||
See `org-latex-text-markup-alist' for details."
|
||||
(let ((fmt (cdr (assq markup org-latex-text-markup-alist))))
|
||||
INFO is a plist used as a communication channel. See
|
||||
`org-latex-text-markup-alist' for details."
|
||||
(let ((fmt (cdr (assq markup (plist-get info :latex-text-markup-alist)))))
|
||||
(cond
|
||||
;; No format string: Return raw text.
|
||||
((not fmt) text)
|
||||
|
@ -1212,7 +1189,7 @@ holding export options."
|
|||
;; Document class and packages.
|
||||
(let* ((class (plist-get info :latex-class))
|
||||
(class-options (plist-get info :latex-class-options))
|
||||
(header (nth 1 (assoc class org-latex-classes)))
|
||||
(header (nth 1 (assoc class (plist-get info :latex-classes))))
|
||||
(document-class-string
|
||||
(and (stringp header)
|
||||
(if (not class-options) header
|
||||
|
@ -1261,19 +1238,19 @@ holding export options."
|
|||
;; Document start.
|
||||
"\\begin{document}\n\n"
|
||||
;; Title command.
|
||||
(org-element-normalize-string
|
||||
(cond ((string= "" title) nil)
|
||||
((not (stringp org-latex-title-command)) nil)
|
||||
((string-match "\\(?:[^%]\\|^\\)%s"
|
||||
org-latex-title-command)
|
||||
(format org-latex-title-command title))
|
||||
(t org-latex-title-command)))
|
||||
(let ((command (plist-get info :latex-title-command)))
|
||||
(org-element-normalize-string
|
||||
(cond ((string= "" title) nil)
|
||||
((not (stringp command)) nil)
|
||||
((string-match "\\(?:[^%]\\|^\\)%s" command)
|
||||
(format command title))
|
||||
(t command))))
|
||||
;; Table of contents.
|
||||
(let ((depth (plist-get info :with-toc)))
|
||||
(when depth
|
||||
(concat (when (wholenump depth)
|
||||
(format "\\setcounter{tocdepth}{%d}\n" depth))
|
||||
org-latex-toc-command)))
|
||||
(plist-get info :latex-toc-command))))
|
||||
;; Document's body.
|
||||
contents
|
||||
;; Creator.
|
||||
|
@ -1296,7 +1273,7 @@ holding export options."
|
|||
"Transcode BOLD from Org to LaTeX.
|
||||
CONTENTS is the text with bold markup. INFO is a plist holding
|
||||
contextual information."
|
||||
(org-latex--text-markup contents 'bold))
|
||||
(org-latex--text-markup contents 'bold info))
|
||||
|
||||
|
||||
;;;; Center Block
|
||||
|
@ -1319,7 +1296,7 @@ information."
|
|||
(concat
|
||||
"\\noindent"
|
||||
(format "\\textbf{%s} " org-clock-string)
|
||||
(format org-latex-inactive-timestamp-format
|
||||
(format (plist-get info :latex-inactive-timestamp-format)
|
||||
(concat (org-translate-time
|
||||
(org-element-property :raw-value
|
||||
(org-element-property :value clock)))
|
||||
|
@ -1334,7 +1311,7 @@ information."
|
|||
"Transcode a CODE object from Org to LaTeX.
|
||||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
(org-latex--text-markup (org-element-property :value code) 'code))
|
||||
(org-latex--text-markup (org-element-property :value code) 'code info))
|
||||
|
||||
|
||||
;;;; Drawer
|
||||
|
@ -1344,7 +1321,7 @@ channel."
|
|||
CONTENTS holds the contents of the block. INFO is a plist
|
||||
holding contextual information."
|
||||
(let* ((name (org-element-property :drawer-name drawer))
|
||||
(output (funcall org-latex-format-drawer-function
|
||||
(output (funcall (plist-get info :latex-format-drawer-function)
|
||||
name contents)))
|
||||
(org-latex--wrap-label drawer output)))
|
||||
|
||||
|
@ -1410,7 +1387,7 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
;; Insert separator between two footnotes in a row.
|
||||
(let ((prev (org-export-get-previous-element footnote-reference info)))
|
||||
(when (eq (org-element-type prev) 'footnote-reference)
|
||||
org-latex-footnote-separator))
|
||||
(plist-get info :latex-footnote-separator)))
|
||||
(cond
|
||||
;; Use \footnotemark if the footnote has already been defined.
|
||||
((not (org-export-footnote-first-reference-p footnote-reference info))
|
||||
|
@ -1443,7 +1420,7 @@ holding contextual information."
|
|||
(let* ((class (plist-get info :latex-class))
|
||||
(level (org-export-get-relative-level headline info))
|
||||
(numberedp (org-export-numbered-headline-p headline info))
|
||||
(class-sectioning (assoc class org-latex-classes))
|
||||
(class-sectioning (assoc class (plist-get info :latex-classes)))
|
||||
;; Section formatting will set two placeholders: one for
|
||||
;; the title and the other for the contents.
|
||||
(section-fmt
|
||||
|
@ -1487,7 +1464,7 @@ holding contextual information."
|
|||
(org-element-property :priority headline)))
|
||||
;; Create the headline text along with a no-tag version.
|
||||
;; The latter is required to remove tags from toc.
|
||||
(full-text (funcall org-latex-format-headline-function
|
||||
(full-text (funcall (plist-get info :latex-format-headline-function)
|
||||
todo todo-type priority text tags))
|
||||
;; Associate \label to the headline for internal links.
|
||||
(headline-label
|
||||
|
@ -1531,7 +1508,7 @@ holding contextual information."
|
|||
;; an alternative heading when possible, and when this is not
|
||||
;; identical to the usual heading.
|
||||
(let ((opt-title
|
||||
(funcall org-latex-format-headline-function
|
||||
(funcall (plist-get info :latex-format-headline-function)
|
||||
todo todo-type priority
|
||||
(org-export-data-with-backend
|
||||
(org-export-get-alt-title headline info)
|
||||
|
@ -1594,34 +1571,33 @@ CONTENTS holds the contents of the item. INFO is a plist holding
|
|||
contextual information."
|
||||
(let* ((code (org-element-property :value inline-src-block))
|
||||
(separator (org-latex--find-verb-separator code)))
|
||||
(cond
|
||||
;; Do not use a special package: transcode it verbatim.
|
||||
((not org-latex-listings)
|
||||
(concat "\\verb" separator code separator))
|
||||
;; Use minted package.
|
||||
((eq org-latex-listings 'minted)
|
||||
(let* ((org-lang (org-element-property :language inline-src-block))
|
||||
(mint-lang (or (cadr (assq (intern org-lang)
|
||||
org-latex-minted-langs))
|
||||
(downcase org-lang)))
|
||||
(options (org-latex--make-option-string
|
||||
org-latex-minted-options)))
|
||||
(concat (format "\\mint%s{%s}"
|
||||
(if (string= options "") "" (format "[%s]" options))
|
||||
mint-lang)
|
||||
separator code separator)))
|
||||
;; Use listings package.
|
||||
(t
|
||||
;; Maybe translate language's name.
|
||||
(let* ((org-lang (org-element-property :language inline-src-block))
|
||||
(lst-lang (or (cadr (assq (intern org-lang)
|
||||
org-latex-listings-langs))
|
||||
org-lang))
|
||||
(options (org-latex--make-option-string
|
||||
(append org-latex-listings-options
|
||||
`(("language" ,lst-lang))))))
|
||||
(concat (format "\\lstinline[%s]" options)
|
||||
separator code separator))))))
|
||||
(case (plist-get info :latex-listings)
|
||||
;; Do not use a special package: transcode it verbatim.
|
||||
((nil) (concat "\\verb" separator code separator))
|
||||
;; Use minted package.
|
||||
(minted
|
||||
(let* ((org-lang (org-element-property :language inline-src-block))
|
||||
(mint-lang (or (cadr (assq (intern org-lang)
|
||||
(plist-get info :latex-minted-langs)))
|
||||
(downcase org-lang)))
|
||||
(options (org-latex--make-option-string
|
||||
(plist-get info :latex-minted-options))))
|
||||
(concat (format "\\mint%s{%s}"
|
||||
(if (string= options "") "" (format "[%s]" options))
|
||||
mint-lang)
|
||||
separator code separator)))
|
||||
;; Use listings package.
|
||||
(otherwise
|
||||
;; Maybe translate language's name.
|
||||
(let* ((org-lang (org-element-property :language inline-src-block))
|
||||
(lst-lang (or (cadr (assq (intern org-lang)
|
||||
(plist-get info :latex-listings-langs)))
|
||||
org-lang))
|
||||
(options (org-latex--make-option-string
|
||||
(append (plist-get info :latex-listings-options)
|
||||
`(("language" ,lst-lang))))))
|
||||
(concat (format "\\lstinline[%s]" options)
|
||||
separator code separator))))))
|
||||
|
||||
|
||||
;;;; Inlinetask
|
||||
|
@ -1638,31 +1614,33 @@ holding contextual information."
|
|||
(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))))
|
||||
;; If `org-latex-format-inlinetask-function' is provided, call it
|
||||
;; with appropriate arguments.
|
||||
(if (not (eq org-latex-format-inlinetask-function 'ignore))
|
||||
(funcall org-latex-format-inlinetask-function
|
||||
todo todo-type priority title tags contents)
|
||||
;; Otherwise, use a default template.
|
||||
(org-latex--wrap-label
|
||||
inlinetask
|
||||
(let ((full-title
|
||||
(concat
|
||||
(when todo (format "\\textbf{\\textsf{\\textsc{%s}}} " todo))
|
||||
(when priority (format "\\framebox{\\#%c} " priority))
|
||||
title
|
||||
(when tags (format "\\hfill{}\\textsc{:%s:}"
|
||||
(mapconcat #'identity tags ":"))))))
|
||||
(concat "\\begin{center}\n"
|
||||
"\\fbox{\n"
|
||||
"\\begin{minipage}[c]{.6\\textwidth}\n"
|
||||
full-title "\n\n"
|
||||
(and (org-string-nw-p contents)
|
||||
(concat "\\rule[.8em]{\\textwidth}{2pt}\n\n" contents))
|
||||
"\\end{minipage}\n"
|
||||
"}\n"
|
||||
"\\end{center}"))))))
|
||||
(org-element-property :priority inlinetask)))
|
||||
(contents (concat
|
||||
(let ((label (org-element-property :CUSTOM_ID inlinetask)))
|
||||
(and label (format "\\label{%s}\n" label)))
|
||||
contents)))
|
||||
(funcall (plist-get info :latex-format-inlinetask-function)
|
||||
todo todo-type priority title tags contents)))
|
||||
|
||||
(defun org-latex-format-inlinetask-default-function
|
||||
(todo todo-type priority title tags contents)
|
||||
"Default format function for a inlinetasks.
|
||||
See `org-latex-format-inlinetask-function' for details."
|
||||
(let ((full-title
|
||||
(concat (when todo (format "\\textbf{\\textsf{\\textsc{%s}}} " todo))
|
||||
(when priority (format "\\framebox{\\#%c} " priority))
|
||||
title
|
||||
(when tags (format "\\hfill{}\\textsc{:%s:}"
|
||||
(mapconcat #'identity tags ":"))))))
|
||||
(concat "\\begin{center}\n"
|
||||
"\\fbox{\n"
|
||||
"\\begin{minipage}[c]{.6\\textwidth}\n"
|
||||
full-title "\n\n"
|
||||
(and (org-string-nw-p contents)
|
||||
(concat "\\rule[.8em]{\\textwidth}{2pt}\n\n" contents))
|
||||
"\\end{minipage}\n"
|
||||
"}\n"
|
||||
"\\end{center}")))
|
||||
|
||||
|
||||
;;;; Italic
|
||||
|
@ -1671,7 +1649,7 @@ holding contextual information."
|
|||
"Transcode ITALIC from Org to LaTeX.
|
||||
CONTENTS is the text with italic markup. INFO is a plist holding
|
||||
contextual information."
|
||||
(org-latex--text-markup contents 'italic))
|
||||
(org-latex--text-markup contents 'italic info))
|
||||
|
||||
|
||||
;;;; Item
|
||||
|
@ -1760,12 +1738,10 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
"\\tableofcontents")))
|
||||
((string= "tables" value) "\\listoftables")
|
||||
((string= "listings" value)
|
||||
(cond
|
||||
((eq org-latex-listings 'minted) "\\listoflistings")
|
||||
(org-latex-listings "\\lstlistoflistings")
|
||||
;; At the moment, src blocks with a caption are wrapped
|
||||
;; into a figure environment.
|
||||
(t "\\listoffigures")))))))))
|
||||
(case (plist-get info :latex-listings)
|
||||
((nil) "\\listoffigures")
|
||||
(minted "\\listoflistings")
|
||||
(otherwise "\\lstlistoflistings")))))))))
|
||||
|
||||
|
||||
;;;; Latex Environment
|
||||
|
@ -1838,24 +1814,25 @@ used as a communication channel."
|
|||
'figure))))
|
||||
(placement
|
||||
(let ((place (plist-get attr :placement)))
|
||||
(cond (place (format "%s" place))
|
||||
((eq float 'wrap) "{l}{0.5\\textwidth}")
|
||||
((eq float 'figure)
|
||||
(format "[%s]" org-latex-default-figure-position))
|
||||
(t ""))))
|
||||
(cond
|
||||
(place (format "%s" place))
|
||||
((eq float 'wrap) "{l}{0.5\\textwidth}")
|
||||
((eq float 'figure)
|
||||
(format "[%s]" (plist-get info :latex-default-figure-position)))
|
||||
(t ""))))
|
||||
(comment-include (if (plist-get attr :comment-include) "%" ""))
|
||||
;; It is possible to specify width and height in the
|
||||
;; ATTR_LATEX line, and also via default variables.
|
||||
(width (cond ((plist-get attr :width))
|
||||
((plist-get attr :height) "")
|
||||
((eq float 'wrap) "0.48\\textwidth")
|
||||
(t org-latex-image-default-width)))
|
||||
(t (plist-get info :latex-image-default-width))))
|
||||
(height (cond ((plist-get attr :height))
|
||||
((or (plist-get attr :width)
|
||||
(memq float '(figure wrap))) "")
|
||||
(t org-latex-image-default-height)))
|
||||
(t (plist-get info :latex-image-default-height))))
|
||||
(options (let ((opt (or (plist-get attr :options)
|
||||
org-latex-image-default-option)))
|
||||
(plist-get info :latex-image-default-option))))
|
||||
(if (not (string-match "\\`\\[\\(.*\\)\\]\\'" opt)) opt
|
||||
(match-string 1 opt))))
|
||||
image-code)
|
||||
|
@ -1932,7 +1909,7 @@ INFO is a plist holding contextual information. See
|
|||
;; Ensure DESC really exists, or set it to nil.
|
||||
(desc (and (not (string= desc "")) desc))
|
||||
(imagep (org-export-inline-image-p
|
||||
link org-latex-inline-image-rules))
|
||||
link (plist-get info :latex-inline-image-rules)))
|
||||
(path (cond
|
||||
((member type '("http" "https" "ftp" "mailto"))
|
||||
(concat type ":" raw-path))
|
||||
|
@ -1965,7 +1942,7 @@ INFO is a plist holding contextual information. See
|
|||
(format "\\url{%s}" destination)))
|
||||
;; Fuzzy link points nowhere.
|
||||
('nil
|
||||
(format org-latex-link-with-unknown-path-format
|
||||
(format (plist-get info :latex-link-with-unknown-path-format)
|
||||
(or desc
|
||||
(org-export-data
|
||||
(org-element-property :raw-link link) info))))
|
||||
|
@ -2009,7 +1986,7 @@ INFO is a plist holding contextual information. See
|
|||
;; External link without a description part.
|
||||
(path (format "\\url{%s}" path))
|
||||
;; No path, only description. Try to do something useful.
|
||||
(t (format org-latex-link-with-unknown-path-format desc)))))
|
||||
(t (format (plist-get info :latex-link-with-unknown-path-format) desc)))))
|
||||
|
||||
|
||||
;;;; Node Property
|
||||
|
@ -2122,21 +2099,21 @@ information."
|
|||
(when closed
|
||||
(concat
|
||||
(format "\\textbf{%s} " org-closed-string)
|
||||
(format org-latex-inactive-timestamp-format
|
||||
(format (plist-get info :latex-inactive-timestamp-format)
|
||||
(org-translate-time
|
||||
(org-element-property :raw-value closed))))))
|
||||
(let ((deadline (org-element-property :deadline planning)))
|
||||
(when deadline
|
||||
(concat
|
||||
(format "\\textbf{%s} " org-deadline-string)
|
||||
(format org-latex-active-timestamp-format
|
||||
(format (plist-get info :latex-active-timestamp-format)
|
||||
(org-translate-time
|
||||
(org-element-property :raw-value deadline))))))
|
||||
(let ((scheduled (org-element-property :scheduled planning)))
|
||||
(when scheduled
|
||||
(concat
|
||||
(format "\\textbf{%s} " org-scheduled-string)
|
||||
(format org-latex-active-timestamp-format
|
||||
(format (plist-get info :latex-active-timestamp-format)
|
||||
(org-translate-time
|
||||
(org-element-property :raw-value scheduled))))))))
|
||||
" ")
|
||||
|
@ -2288,16 +2265,17 @@ contextual information."
|
|||
(new 0)))
|
||||
(retain-labels (org-element-property :retain-labels src-block))
|
||||
(attributes (org-export-read-attribute :attr_latex src-block))
|
||||
(float (plist-get attributes :float)))
|
||||
(float (plist-get attributes :float))
|
||||
(listings (plist-get info :latex-listings)))
|
||||
(cond
|
||||
;; Case 1. No source fontification.
|
||||
((not org-latex-listings)
|
||||
((not listings)
|
||||
(let* ((caption-str (org-latex--caption/label-string src-block info))
|
||||
(float-env
|
||||
(cond ((and (not float) (plist-member attributes :float)) "%s")
|
||||
((string= "multicolumn" float)
|
||||
(format "\\begin{figure*}[%s]\n%%s%s\n\\end{figure*}"
|
||||
org-latex-default-figure-position
|
||||
(plist-get info :latex-default-figure-position)
|
||||
caption-str))
|
||||
((or caption float)
|
||||
(format "\\begin{figure}[H]\n%%s%s\n\\end{figure}"
|
||||
|
@ -2313,7 +2291,7 @@ contextual information."
|
|||
(org-export-format-code-default src-block info)
|
||||
custom-env))
|
||||
;; Case 3. Use minted package.
|
||||
((eq org-latex-listings 'minted)
|
||||
((eq listings 'minted)
|
||||
(let* ((caption-str (org-latex--caption/label-string src-block info))
|
||||
(float-env
|
||||
(cond ((and (not float) (plist-member attributes :float)) "%s")
|
||||
|
@ -2324,23 +2302,24 @@ contextual information."
|
|||
(format "\\begin{listing}[H]\n%%s\n%s\\end{listing}"
|
||||
caption-str))
|
||||
(t "%s")))
|
||||
(options (plist-get info :latex-minted-options))
|
||||
(body
|
||||
(format
|
||||
"\\begin{minted}[%s]{%s}\n%s\\end{minted}"
|
||||
;; Options.
|
||||
(concat
|
||||
(org-latex--make-option-string
|
||||
(if (or (not num-start)
|
||||
(assoc "linenos" org-latex-minted-options))
|
||||
org-latex-minted-options
|
||||
(if (or (not num-start) (assoc "linenos" options))
|
||||
options
|
||||
(append
|
||||
`(("linenos")
|
||||
("firstnumber" ,(number-to-string (1+ num-start))))
|
||||
org-latex-minted-options)))
|
||||
options)))
|
||||
(let ((local-options (plist-get attributes :options)))
|
||||
(and local-options (concat "," local-options))))
|
||||
;; Language.
|
||||
(or (cadr (assq (intern lang) org-latex-minted-langs))
|
||||
(or (cadr (assq (intern lang)
|
||||
(plist-get info :latex-minted-langs)))
|
||||
(downcase lang))
|
||||
;; Source code.
|
||||
(let* ((code-info (org-export-unravel-code src-block))
|
||||
|
@ -2367,7 +2346,9 @@ contextual information."
|
|||
;; Case 4. Use listings package.
|
||||
(t
|
||||
(let ((lst-lang
|
||||
(or (cadr (assq (intern lang) org-latex-listings-langs)) lang))
|
||||
(or (cadr (assq (intern lang)
|
||||
(plist-get info :latex-listings-langs)))
|
||||
lang))
|
||||
(caption-str
|
||||
(when caption
|
||||
(let ((main (org-export-get-caption src-block))
|
||||
|
@ -2376,7 +2357,8 @@ contextual information."
|
|||
(format "{%s}" (org-export-data main info))
|
||||
(format "{[%s]%s}"
|
||||
(org-export-data secondary info)
|
||||
(org-export-data main info)))))))
|
||||
(org-export-data main info))))))
|
||||
(lst-opt (plist-get info :latex-listings-options)))
|
||||
(concat
|
||||
;; Options.
|
||||
(format
|
||||
|
@ -2384,16 +2366,16 @@ contextual information."
|
|||
(concat
|
||||
(org-latex--make-option-string
|
||||
(append
|
||||
org-latex-listings-options
|
||||
lst-opt
|
||||
(cond
|
||||
((and (not float) (plist-member attributes :float)) nil)
|
||||
((string= "multicolumn" float) '(("float" "*")))
|
||||
((and float (not (assoc "float" org-latex-listings-options)))
|
||||
`(("float" ,org-latex-default-figure-position))))
|
||||
((and float (not (assoc "float" lst-opt)))
|
||||
`(("float" ,(plist-get info :latex-default-figure-position)))))
|
||||
`(("language" ,lst-lang))
|
||||
(if label `(("label" ,label)) '(("label" " ")))
|
||||
(if caption-str `(("caption" ,caption-str)) '(("caption" " ")))
|
||||
(cond ((assoc "numbers" org-latex-listings-options) nil)
|
||||
(cond ((assoc "numbers" lst-opt) nil)
|
||||
((not num-start) '(("numbers" "none")))
|
||||
((zerop num-start) '(("numbers" "left")))
|
||||
(t `(("numbers" "left")
|
||||
|
@ -2438,7 +2420,7 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
"Transcode STRIKE-THROUGH from Org to LaTeX.
|
||||
CONTENTS is the text with strike-through markup. INFO is a plist
|
||||
holding contextual information."
|
||||
(org-latex--text-markup contents 'strike-through))
|
||||
(org-latex--text-markup contents 'strike-through info))
|
||||
|
||||
|
||||
;;;; Subscript
|
||||
|
@ -2515,7 +2497,7 @@ contextual information."
|
|||
;; "table.el" table. Convert it using appropriate tools.
|
||||
(org-latex--table.el-table table info)
|
||||
(let ((type (or (org-export-read-attribute :attr_latex table :mode)
|
||||
org-latex-default-table-mode)))
|
||||
(plist-get info :latex-default-table-mode))))
|
||||
(cond
|
||||
;; Case 1: Verbatim table.
|
||||
((string= type "verbatim")
|
||||
|
@ -2576,7 +2558,7 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
(alignment (org-latex--align-string table info))
|
||||
;; Determine environment for the table: longtable, tabular...
|
||||
(table-env (or (plist-get attr :environment)
|
||||
org-latex-default-table-environment))
|
||||
(plist-get info :latex-default-table-environment)))
|
||||
;; If table is a float, determine environment: table, table*
|
||||
;; or sidewaystable.
|
||||
(float-env (unless (member table-env '("longtable" "longtabu"))
|
||||
|
@ -2595,21 +2577,23 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
(and font (concat font "\n"))))
|
||||
(width (plist-get attr :width))
|
||||
(spreadp (plist-get attr :spread))
|
||||
(placement (or (plist-get attr :placement)
|
||||
(format "[%s]" org-latex-default-figure-position)))
|
||||
(placement
|
||||
(or (plist-get attr :placement)
|
||||
(format "[%s]" (plist-get info :latex-default-figure-position))))
|
||||
(centerp (if (plist-member attr :center) (plist-get attr :center)
|
||||
org-latex-tables-centered)))
|
||||
(plist-get info :latex-tables-centered)))
|
||||
(caption-above-p (plist-get info :latex-table-caption-above)))
|
||||
;; Prepare the final format string for the table.
|
||||
(cond
|
||||
;; Longtable.
|
||||
((equal "longtable" table-env)
|
||||
(concat (and fontsize (concat "{" fontsize))
|
||||
(format "\\begin{longtable}{%s}\n" alignment)
|
||||
(and org-latex-table-caption-above
|
||||
(and caption-above-p
|
||||
(org-string-nw-p caption)
|
||||
(concat caption "\\\\\n"))
|
||||
contents
|
||||
(and (not org-latex-table-caption-above)
|
||||
(and (not caption-above-p)
|
||||
(org-string-nw-p caption)
|
||||
(concat caption "\\\\\n"))
|
||||
"\\end{longtable}\n"
|
||||
|
@ -2622,11 +2606,11 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
(format " %s %s "
|
||||
(if spreadp "spread" "to") width) "")
|
||||
alignment)
|
||||
(and org-latex-table-caption-above
|
||||
(and caption-above-p
|
||||
(org-string-nw-p caption)
|
||||
(concat caption "\\\\\n"))
|
||||
contents
|
||||
(and (not org-latex-table-caption-above)
|
||||
(and (not caption-above-p)
|
||||
(org-string-nw-p caption)
|
||||
(concat caption "\\\\\n"))
|
||||
"\\end{longtabu}\n"
|
||||
|
@ -2635,7 +2619,7 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
(t (concat (cond
|
||||
(float-env
|
||||
(concat (format "\\begin{%s}%s\n" float-env placement)
|
||||
(if org-latex-table-caption-above caption "")
|
||||
(if caption-above-p caption "")
|
||||
(when centerp "\\centering\n")
|
||||
fontsize))
|
||||
(centerp (concat "\\begin{center}\n" fontsize))
|
||||
|
@ -2655,7 +2639,7 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
table-env)))
|
||||
(cond
|
||||
(float-env
|
||||
(concat (if org-latex-table-caption-above "" caption)
|
||||
(concat (if caption-above-p "" caption)
|
||||
(format "\n\\end{%s}" float-env)))
|
||||
(centerp "\n\\end{center}")
|
||||
(fontsize "}")))))))
|
||||
|
@ -2693,7 +2677,7 @@ property."
|
|||
(incf n)
|
||||
(unless (= n 2) (setq output (replace-match "" nil nil output))))))
|
||||
(let ((centerp (if (plist-member attr :center) (plist-get attr :center)
|
||||
org-latex-tables-centered)))
|
||||
(plist-get info :latex-tables-centered))))
|
||||
(if (not centerp) output
|
||||
(format "\\begin{center}\n%s\n\\end{center}" output))))))
|
||||
|
||||
|
@ -2709,7 +2693,7 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
(attr (org-export-read-attribute :attr_latex table))
|
||||
(inlinep (equal (plist-get attr :mode) "inline-math"))
|
||||
(env (or (plist-get attr :environment)
|
||||
org-latex-default-table-environment))
|
||||
(plist-get info :latex-default-table-environment)))
|
||||
(contents
|
||||
(mapconcat
|
||||
(lambda (row)
|
||||
|
@ -2735,7 +2719,7 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
(lambda (table)
|
||||
;; Non-nil when TABLE has the same mode as current table.
|
||||
(string= (or (org-export-read-attribute :attr_latex table :mode)
|
||||
org-latex-default-table-mode)
|
||||
(plist-get info :latex-default-table-mode))
|
||||
mode))))
|
||||
(concat
|
||||
;; Opening string. If TABLE is in the middle of a table cluster,
|
||||
|
@ -2791,16 +2775,18 @@ This function assumes TABLE has `org' as its `:type' property and
|
|||
"Transcode a TABLE-CELL element from Org to LaTeX.
|
||||
CONTENTS is the cell contents. INFO is a plist used as
|
||||
a communication channel."
|
||||
(concat (if (and contents
|
||||
org-latex-table-scientific-notation
|
||||
(string-match orgtbl-exp-regexp contents))
|
||||
;; Use appropriate format string for scientific
|
||||
;; notation.
|
||||
(format org-latex-table-scientific-notation
|
||||
(match-string 1 contents)
|
||||
(match-string 2 contents))
|
||||
contents)
|
||||
(when (org-export-get-next-element table-cell info) " & ")))
|
||||
(concat
|
||||
(let ((scientific-format (plist-get info :latex-table-scientific-notation)))
|
||||
(if (and contents
|
||||
scientific-format
|
||||
(string-match orgtbl-exp-regexp contents))
|
||||
;; Use appropriate format string for scientific
|
||||
;; notation.
|
||||
(format scientific-format
|
||||
(match-string 1 contents)
|
||||
(match-string 2 contents))
|
||||
contents))
|
||||
(when (org-export-get-next-element table-cell info) " & ")))
|
||||
|
||||
|
||||
;;;; Table Row
|
||||
|
@ -2814,12 +2800,13 @@ a communication channel."
|
|||
(when (eq (org-element-property :type table-row) 'standard)
|
||||
(let* ((attr (org-export-read-attribute :attr_latex
|
||||
(org-export-get-parent table-row)))
|
||||
(longtablep (member (or (plist-get attr :environment)
|
||||
org-latex-default-table-environment)
|
||||
'("longtable" "longtabu")))
|
||||
(longtablep
|
||||
(member (or (plist-get attr :environment)
|
||||
(plist-get info :latex-default-table-environment))
|
||||
'("longtable" "longtabu")))
|
||||
(booktabsp (if (plist-member attr :booktabs)
|
||||
(plist-get attr :booktabs)
|
||||
org-latex-tables-booktabs))
|
||||
(plist-get info :latex-tables-booktabs)))
|
||||
;; TABLE-ROW's borders are extracted from its first cell.
|
||||
(borders (org-export-table-cell-borders
|
||||
(car (org-element-contents table-row)) info)))
|
||||
|
@ -2883,10 +2870,12 @@ information."
|
|||
(let ((value (org-latex-plain-text
|
||||
(org-timestamp-translate timestamp) info)))
|
||||
(case (org-element-property :type timestamp)
|
||||
((active active-range) (format org-latex-active-timestamp-format value))
|
||||
((active active-range)
|
||||
(format (plist-get info :latex-active-timestamp-format) value))
|
||||
((inactive inactive-range)
|
||||
(format org-latex-inactive-timestamp-format value))
|
||||
(otherwise (format org-latex-diary-timestamp-format value)))))
|
||||
(format (plist-get info :latex-inactive-timestamp-format) value))
|
||||
(otherwise
|
||||
(format (plist-get info :latex-diary-timestamp-format) value)))))
|
||||
|
||||
|
||||
;;;; Underline
|
||||
|
@ -2895,7 +2884,7 @@ information."
|
|||
"Transcode UNDERLINE from Org to LaTeX.
|
||||
CONTENTS is the text with underline markup. INFO is a plist
|
||||
holding contextual information."
|
||||
(org-latex--text-markup contents 'underline))
|
||||
(org-latex--text-markup contents 'underline info))
|
||||
|
||||
|
||||
;;;; Verbatim
|
||||
|
@ -2904,7 +2893,8 @@ holding contextual information."
|
|||
"Transcode a VERBATIM object from Org to LaTeX.
|
||||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
(org-latex--text-markup (org-element-property :value verbatim) 'verbatim))
|
||||
(org-latex--text-markup
|
||||
(org-element-property :value verbatim) 'verbatim info))
|
||||
|
||||
|
||||
;;;; Verse Block
|
||||
|
|
|
@ -117,10 +117,7 @@
|
|||
(:man-tables-verbatim nil nil org-man-tables-verbatim)
|
||||
(:man-table-scientific-notation nil nil org-man-table-scientific-notation)
|
||||
(:man-source-highlight nil nil org-man-source-highlight)
|
||||
(:man-source-highlight-langs nil nil org-man-source-highlight-langs)
|
||||
(:man-pdf-process nil nil org-man-pdf-process)
|
||||
(:man-logfiles-extensions nil nil org-man-logfiles-extensions)
|
||||
(:man-remove-logfiles nil nil org-man-remove-logfiles)))
|
||||
(:man-source-highlight-langs nil nil org-man-source-highlight-langs)))
|
||||
|
||||
|
||||
|
||||
|
@ -525,7 +522,7 @@ CONTENTS holds the contents of the item. INFO is a plist holding
|
|||
contextual information."
|
||||
(let* ((code (org-element-property :value inline-src-block)))
|
||||
(cond
|
||||
(org-man-source-highlight
|
||||
((plist-get info :man-source-highlight)
|
||||
(let* ((tmpdir (if (featurep 'xemacs)
|
||||
temp-directory
|
||||
temporary-file-directory ))
|
||||
|
@ -534,8 +531,9 @@ contextual information."
|
|||
(out-file (make-temp-name
|
||||
(expand-file-name "reshilite" tmpdir)))
|
||||
(org-lang (org-element-property :language inline-src-block))
|
||||
(lst-lang (cadr (assq (intern org-lang)
|
||||
org-man-source-highlight-langs)))
|
||||
(lst-lang
|
||||
(cadr (assq (intern org-lang)
|
||||
(plist-get info :man-source-highlight-langs))))
|
||||
|
||||
(cmd (concat (expand-file-name "source-highlight")
|
||||
" -s " lst-lang
|
||||
|
@ -788,31 +786,22 @@ contextual information."
|
|||
(continued (org-export-get-loc src-block info))
|
||||
(new 0)))
|
||||
(retain-labels (org-element-property :retain-labels src-block)))
|
||||
(cond
|
||||
;; Case 1. No source fontification.
|
||||
((not org-man-source-highlight)
|
||||
(format ".RS\n.nf\n\\fC%s\\fP\n.fi\n.RE\n\n"
|
||||
(org-export-format-code-default src-block info)))
|
||||
(org-man-source-highlight
|
||||
(let* ((tmpdir (if (featurep 'xemacs)
|
||||
temp-directory
|
||||
temporary-file-directory ))
|
||||
|
||||
(in-file (make-temp-name
|
||||
(expand-file-name "srchilite" tmpdir)))
|
||||
(out-file (make-temp-name
|
||||
(expand-file-name "reshilite" tmpdir)))
|
||||
|
||||
(if (not (plist-get info :man-source-highlight))
|
||||
(format ".RS\n.nf\n\\fC%s\\fP\n.fi\n.RE\n\n"
|
||||
(org-export-format-code-default src-block info))
|
||||
(let* ((tmpdir (if (featurep 'xemacs) temp-directory
|
||||
temporary-file-directory))
|
||||
(in-file (make-temp-name (expand-file-name "srchilite" tmpdir)))
|
||||
(out-file (make-temp-name (expand-file-name "reshilite" tmpdir)))
|
||||
(org-lang (org-element-property :language src-block))
|
||||
(lst-lang (cadr (assq (intern org-lang)
|
||||
org-man-source-highlight-langs)))
|
||||
|
||||
(lst-lang
|
||||
(cadr (assq (intern org-lang)
|
||||
(plist-get info :man-source-highlight-langs))))
|
||||
(cmd (concat "source-highlight"
|
||||
" -s " lst-lang
|
||||
" -f groff_man "
|
||||
" -i " in-file
|
||||
" -o " out-file)))
|
||||
|
||||
(if lst-lang
|
||||
(let ((code-block ""))
|
||||
(with-temp-file in-file (insert code))
|
||||
|
@ -821,7 +810,7 @@ contextual information."
|
|||
(delete-file in-file)
|
||||
(delete-file out-file)
|
||||
code-block)
|
||||
(format ".RS\n.nf\n\\fC\\m[black]%s\\m[]\\fP\n.fi\n.RE" code)))))))
|
||||
(format ".RS\n.nf\n\\fC\\m[black]%s\\m[]\\fP\n.fi\n.RE" code))))))
|
||||
|
||||
|
||||
;;; Statistics Cookie
|
||||
|
@ -874,7 +863,7 @@ CONTENTS is the contents of the table. INFO is a plist holding
|
|||
contextual information."
|
||||
(cond
|
||||
;; Case 1: verbatim table.
|
||||
((or org-man-tables-verbatim
|
||||
((or (plist-get info :man-tables-verbatim)
|
||||
(let ((attr (read (format "(%s)"
|
||||
(mapconcat
|
||||
#'identity
|
||||
|
@ -949,7 +938,8 @@ This function assumes TABLE has `org' as its `:type' attribute."
|
|||
(let ((placement (plist-get attr :placement)))
|
||||
(cond ((string= placement 'center) "center")
|
||||
((string= placement 'left) nil)
|
||||
(t (if org-man-tables-centered "center" ""))))
|
||||
((plist-get info :man-tables-centered) "center")
|
||||
(t "")))
|
||||
(or (plist-get attr :boxtype) "box"))))
|
||||
|
||||
(title-line (plist-get attr :title-line))
|
||||
|
@ -1024,16 +1014,17 @@ This function assumes TABLE has `org' as its `:type' attribute."
|
|||
"Transcode a TABLE-CELL element from Org to Man
|
||||
CONTENTS is the cell contents. INFO is a plist used as
|
||||
a communication channel."
|
||||
(concat (if (and contents
|
||||
org-man-table-scientific-notation
|
||||
(string-match orgtbl-exp-regexp contents))
|
||||
;; Use appropriate format string for scientific
|
||||
;; notation.
|
||||
(format org-man-table-scientific-notation
|
||||
(match-string 1 contents)
|
||||
(match-string 2 contents))
|
||||
contents )
|
||||
(when (org-export-get-next-element table-cell info) "\t")))
|
||||
(concat
|
||||
(let ((scientific-format (plist-get info :man-table-scientific-notation)))
|
||||
(if (and contents
|
||||
scientific-format
|
||||
(string-match orgtbl-exp-regexp contents))
|
||||
;; Use appropriate format string for scientific notation.
|
||||
(format scientific-format
|
||||
(match-string 1 contents)
|
||||
(match-string 2 contents))
|
||||
contents))
|
||||
(when (org-export-get-next-element table-cell info) "\t")))
|
||||
|
||||
|
||||
;;; Table Row
|
||||
|
|
|
@ -191,15 +191,17 @@ a communication channel."
|
|||
(concat "sec-"
|
||||
(mapconcat 'number-to-string
|
||||
(org-export-get-headline-number
|
||||
headline info) "-"))))))
|
||||
headline info) "-")))
|
||||
nil nil info)))
|
||||
;; Headline text without tags.
|
||||
(heading (concat todo priority title)))
|
||||
(heading (concat todo priority title))
|
||||
(style (plist-get info :md-headline-style)))
|
||||
(cond
|
||||
;; Cannot create a headline. Fall-back to a list.
|
||||
((or (org-export-low-level-p headline info)
|
||||
(not (memq org-md-headline-style '(atx setext)))
|
||||
(and (eq org-md-headline-style 'atx) (> level 6))
|
||||
(and (eq org-md-headline-style 'setext) (> level 2)))
|
||||
(not (memq style '(atx setext)))
|
||||
(and (eq style 'atx) (> level 6))
|
||||
(and (eq style 'setext) (> level 2)))
|
||||
(let ((bullet
|
||||
(if (not (org-export-numbered-headline-p headline info)) "-"
|
||||
(concat (number-to-string
|
||||
|
@ -211,7 +213,7 @@ a communication channel."
|
|||
(and contents
|
||||
(replace-regexp-in-string "^" " " contents)))))
|
||||
;; Use "Setext" style.
|
||||
((eq org-md-headline-style 'setext)
|
||||
((eq style 'setext)
|
||||
(concat heading tags anchor "\n"
|
||||
(make-string (length heading) (if (= level 1) ?= ?-))
|
||||
"\n\n"
|
||||
|
|
219
lisp/ox-odt.el
219
lisp/ox-odt.el
|
@ -98,11 +98,6 @@
|
|||
'((:odt-styles-file "ODT_STYLES_FILE" nil nil t)
|
||||
;; Other variables.
|
||||
(:odt-content-template-file nil nil org-odt-content-template-file)
|
||||
(:odt-convert-capabilities nil nil org-odt-convert-capabilities)
|
||||
(:odt-convert-process nil nil org-odt-convert-process)
|
||||
(:odt-convert-processes nil nil org-odt-convert-processes)
|
||||
(:odt-create-custom-styles-for-srcblocks
|
||||
nil nil org-odt-create-custom-styles-for-srcblocks)
|
||||
(:odt-display-outline-level nil nil org-odt-display-outline-level)
|
||||
(:odt-fontify-srcblocks nil nil org-odt-fontify-srcblocks)
|
||||
(:odt-format-drawer-function nil nil org-odt-format-drawer-function)
|
||||
|
@ -111,9 +106,6 @@
|
|||
(:odt-inline-formula-rules nil nil org-odt-inline-formula-rules)
|
||||
(:odt-inline-image-rules nil nil org-odt-inline-image-rules)
|
||||
(:odt-pixels-per-inch nil nil org-odt-pixels-per-inch)
|
||||
(:odt-preferred-output-format nil nil org-odt-preferred-output-format)
|
||||
(:odt-prettify-xml nil nil org-odt-prettify-xml)
|
||||
(:odt-schema-dir nil nil org-odt-schema-dir)
|
||||
(:odt-styles-file nil nil org-odt-styles-file)
|
||||
(:odt-table-styles nil nil org-odt-table-styles)
|
||||
(:odt-use-date-fields nil nil org-odt-use-date-fields)
|
||||
|
@ -211,8 +203,7 @@ heuristically based on the values of `org-odt-lib-dir' and
|
|||
This directory contains the following XML files -
|
||||
\"OrgOdtStyles.xml\" and \"OrgOdtContentTemplate.xml\". These
|
||||
XML files are used as the default values of
|
||||
`org-odt-styles-file' and
|
||||
`org-odt-content-template-file'.
|
||||
`org-odt-styles-file' and `org-odt-content-template-file'.
|
||||
|
||||
The default value of this variable varies depending on the
|
||||
version of org in use and is initialized from
|
||||
|
@ -684,7 +675,8 @@ The default value simply returns the value of CONTENTS."
|
|||
|
||||
;;;; Headline
|
||||
|
||||
(defcustom org-odt-format-headline-function 'ignore
|
||||
(defcustom org-odt-format-headline-function
|
||||
'org-odt-format-headline-default-function
|
||||
"Function to format headline text.
|
||||
|
||||
This function will be called with 5 arguments:
|
||||
|
@ -696,14 +688,15 @@ TAGS the tags string, separated with colons \(string or nil\).
|
|||
|
||||
The function result will be used as headline text."
|
||||
:group 'org-export-odt
|
||||
:version "24.4"
|
||||
:package-version '(Org . "8.0")
|
||||
:version "24.5"
|
||||
:package-version '(Org . "8.3")
|
||||
:type 'function)
|
||||
|
||||
|
||||
;;;; Inlinetasks
|
||||
|
||||
(defcustom org-odt-format-inlinetask-function 'ignore
|
||||
(defcustom org-odt-format-inlinetask-function
|
||||
'org-odt-format-inlinetask-default-function
|
||||
"Function called to format an inlinetask in ODT code.
|
||||
|
||||
The function must accept six parameters:
|
||||
|
@ -716,8 +709,8 @@ The function must accept six parameters:
|
|||
|
||||
The function should return the string to be exported."
|
||||
:group 'org-export-odt
|
||||
:version "24.4"
|
||||
:package-version '(Org . "8.0")
|
||||
:version "24.5"
|
||||
:package-version '(Org . "8.3")
|
||||
:type 'function)
|
||||
|
||||
|
||||
|
@ -805,8 +798,8 @@ Use the latter option if you do not want the custom styles to be
|
|||
based on your current display settings. It is necessary that the
|
||||
styles.xml already contains needed styles for colorizing to work.
|
||||
|
||||
This variable is effective only if
|
||||
`org-odt-fontify-srcblocks' is turned on."
|
||||
This variable is effective only if `org-odt-fontify-srcblocks' is
|
||||
turned on."
|
||||
:group 'org-export-odt
|
||||
:version "24.1"
|
||||
:type 'boolean)
|
||||
|
@ -843,8 +836,7 @@ TABLE-STYLE-NAME is the style associated with the table through
|
|||
|
||||
TABLE-TEMPLATE-NAME is a set of - upto 9 - automatic
|
||||
TABLE-CELL-STYLE-NAMEs and PARAGRAPH-STYLE-NAMEs (as defined
|
||||
below) that is included in
|
||||
`org-odt-content-template-file'.
|
||||
below) that is included in `org-odt-content-template-file'.
|
||||
|
||||
TABLE-CELL-STYLE-NAME := TABLE-TEMPLATE-NAME + TABLE-CELL-TYPE +
|
||||
\"TableCell\"
|
||||
|
@ -1383,7 +1375,7 @@ original parsed data. INFO is a plist holding export options."
|
|||
;; Non-availability of styles.xml is not a critical
|
||||
;; error. For now, throw an error.
|
||||
(styles-file (or styles-file
|
||||
org-odt-styles-file
|
||||
(plist-get info :odt-styles-file)
|
||||
(expand-file-name "OrgOdtStyles.xml"
|
||||
org-odt-styles-dir)
|
||||
(error "org-odt: Missing styles file?"))))
|
||||
|
@ -1408,7 +1400,7 @@ original parsed data. INFO is a plist holding export options."
|
|||
(org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir)))))
|
||||
(t
|
||||
(error (format "Invalid specification of styles.xml file: %S"
|
||||
org-odt-styles-file))))
|
||||
(plist-get info :odt-styles-file)))))
|
||||
|
||||
;; create a manifest entry for styles.xml
|
||||
(org-odt-create-manifest-file-entry "text/xml" "styles.xml")
|
||||
|
@ -1469,7 +1461,7 @@ original parsed data. INFO is a plist holding export options."
|
|||
'("%Y-%M-%d %a" . "%Y-%M-%d %a %H:%M"))))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents
|
||||
(or org-odt-content-template-file
|
||||
(or (plist-get info :odt-content-template-file)
|
||||
(expand-file-name "OrgOdtContentTemplate.xml"
|
||||
org-odt-styles-dir)))
|
||||
;; Write automatic styles.
|
||||
|
@ -1483,7 +1475,7 @@ original parsed data. INFO is a plist holding export options."
|
|||
(when (setq props (or (plist-get props :rel-width) "96"))
|
||||
(insert (format org-odt-table-style-format style-name props))))
|
||||
;; - Dump date-styles.
|
||||
(when org-odt-use-date-fields
|
||||
(when (plist-get info :odt-use-date-fields)
|
||||
(insert (org-odt--build-date-styles (car custom-time-fmts)
|
||||
"OrgDate1")
|
||||
(org-odt--build-date-styles (cdr custom-time-fmts)
|
||||
|
@ -1502,7 +1494,8 @@ original parsed data. INFO is a plist holding export options."
|
|||
(lambda (x)
|
||||
(format
|
||||
"<text:sequence-decl text:display-outline-level=\"%d\" text:name=\"%s\"/>"
|
||||
org-odt-display-outline-level (nth 1 x)))
|
||||
(plist-get info :odt-display-outline-level)
|
||||
(nth 1 x)))
|
||||
org-odt-category-map-alist "\n")))
|
||||
;; Position the cursor to document body.
|
||||
(goto-char (point-min))
|
||||
|
@ -1558,7 +1551,7 @@ original parsed data. INFO is a plist holding export options."
|
|||
(concat
|
||||
(format "\n<text:p text:style-name=\"%s\">%s</text:p>"
|
||||
"OrgSubtitle"
|
||||
(if (and org-odt-use-date-fields timestamp)
|
||||
(if (and (plist-get info :odt-use-date-fields) timestamp)
|
||||
(org-odt--format-timestamp (car date))
|
||||
(org-export-data (plist-get info :date) info)))
|
||||
;; Separator
|
||||
|
@ -1643,7 +1636,7 @@ channel."
|
|||
CONTENTS holds the contents of the block. INFO is a plist
|
||||
holding contextual information."
|
||||
(let* ((name (org-element-property :drawer-name drawer))
|
||||
(output (funcall org-odt-format-drawer-function
|
||||
(output (funcall (plist-get info :odt-format-drawer-function)
|
||||
name contents)))
|
||||
output))
|
||||
|
||||
|
@ -1688,7 +1681,7 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
(defun org-odt-fixed-width (fixed-width contents info)
|
||||
"Transcode a FIXED-WIDTH element from Org to ODT.
|
||||
CONTENTS is nil. INFO is a plist holding contextual information."
|
||||
(org-odt-do-format-code (org-element-property :value fixed-width)))
|
||||
(org-odt-do-format-code (org-element-property :value fixed-width) info))
|
||||
|
||||
|
||||
;;;; Footnote Definition
|
||||
|
@ -1764,33 +1757,6 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
|
||||
;;;; Headline
|
||||
|
||||
(defun* org-odt-format-headline
|
||||
(todo todo-type priority text tags
|
||||
&key level section-number headline-label &allow-other-keys)
|
||||
(concat
|
||||
;; Todo.
|
||||
(when todo
|
||||
(let ((style (if (member todo org-done-keywords) "OrgDone" "OrgTodo")))
|
||||
(format "<text:span text:style-name=\"%s\">%s</text:span> "
|
||||
style todo)))
|
||||
(when priority
|
||||
(let* ((style (format "OrgPriority-%s" priority))
|
||||
(priority (format "[#%c]" priority)))
|
||||
(format "<text:span text:style-name=\"%s\">%s</text:span> "
|
||||
style priority)))
|
||||
;; Title.
|
||||
text
|
||||
;; Tags.
|
||||
(when tags
|
||||
(concat
|
||||
"<text:tab/>"
|
||||
(format "<text:span text:style-name=\"%s\">[%s]</text:span>"
|
||||
"OrgTags" (mapconcat
|
||||
(lambda (tag)
|
||||
(format
|
||||
"<text:span text:style-name=\"%s\">%s</text:span>"
|
||||
"OrgTag" tag)) tags " : "))))))
|
||||
|
||||
(defun org-odt-format-headline--wrap (headline backend info
|
||||
&optional format-function
|
||||
&rest extra-keys)
|
||||
|
@ -1815,17 +1781,16 @@ INFO is a plist holding contextual information."
|
|||
(org-export-get-tags headline info)))
|
||||
(headline-label (concat "sec-" (mapconcat 'number-to-string
|
||||
headline-number "-")))
|
||||
(format-function (cond
|
||||
((functionp format-function) format-function)
|
||||
((not (eq org-odt-format-headline-function 'ignore))
|
||||
(function*
|
||||
(lambda (todo todo-type priority text tags
|
||||
&allow-other-keys)
|
||||
(funcall org-odt-format-headline-function
|
||||
todo todo-type priority text tags))))
|
||||
(t 'org-odt-format-headline))))
|
||||
(format-function
|
||||
(if (functionp format-function) format-function
|
||||
(function*
|
||||
(lambda (todo todo-type priority text tags
|
||||
&key level section-number headline-label
|
||||
&allow-other-keys)
|
||||
(funcall (plist-get info :odt-format-headline-function)
|
||||
todo todo-type priority text tags))))))
|
||||
(apply format-function
|
||||
todo todo-type priority text tags
|
||||
todo todo-type priority text tags
|
||||
:headline-label headline-label :level level
|
||||
:section-number section-number extra-keys)))
|
||||
|
||||
|
@ -1901,6 +1866,33 @@ holding contextual information."
|
|||
(concat extra-targets anchored-title))
|
||||
contents))))))
|
||||
|
||||
(defun org-odt-format-headline-default-function
|
||||
(todo todo-type priority text tags)
|
||||
"Default format function for a headline.
|
||||
See `org-odt-format-headline-function' for details."
|
||||
(concat
|
||||
;; Todo.
|
||||
(when todo
|
||||
(let ((style (if (eq todo-type 'done) "OrgDone" "OrgTodo")))
|
||||
(format "<text:span text:style-name=\"%s\">%s</text:span> " style todo)))
|
||||
(when priority
|
||||
(let* ((style (format "OrgPriority-%s" priority))
|
||||
(priority (format "[#%c]" priority)))
|
||||
(format "<text:span text:style-name=\"%s\">%s</text:span> "
|
||||
style priority)))
|
||||
;; Title.
|
||||
text
|
||||
;; Tags.
|
||||
(when tags
|
||||
(concat
|
||||
"<text:tab/>"
|
||||
(format "<text:span text:style-name=\"%s\">[%s]</text:span>"
|
||||
"OrgTags" (mapconcat
|
||||
(lambda (tag)
|
||||
(format
|
||||
"<text:span text:style-name=\"%s\">%s</text:span>"
|
||||
"OrgTag" tag)) tags " : "))))))
|
||||
|
||||
|
||||
;;;; Horizontal Rule
|
||||
|
||||
|
@ -1942,29 +1934,33 @@ contextual information."
|
|||
"Transcode an INLINETASK element from Org to ODT.
|
||||
CONTENTS holds the contents of the block. INFO is a plist
|
||||
holding contextual information."
|
||||
(cond
|
||||
;; If `org-odt-format-inlinetask-function' is not 'ignore, call it
|
||||
;; with appropriate arguments.
|
||||
((not (eq org-odt-format-inlinetask-function 'ignore))
|
||||
(let ((format-function
|
||||
(function*
|
||||
(lambda (todo todo-type priority text tags
|
||||
&key contents &allow-other-keys)
|
||||
(funcall org-odt-format-inlinetask-function
|
||||
todo todo-type priority text tags contents)))))
|
||||
(org-odt-format-headline--wrap
|
||||
inlinetask nil info format-function :contents contents)))
|
||||
;; Otherwise, use a default template.
|
||||
(t
|
||||
(format "\n<text:p text:style-name=\"%s\">%s</text:p>"
|
||||
"Text_20_body"
|
||||
(org-odt--textbox
|
||||
(concat
|
||||
(format "\n<text:p text:style-name=\"%s\">%s</text:p>"
|
||||
"OrgInlineTaskHeading"
|
||||
(org-odt-format-headline--wrap inlinetask nil info))
|
||||
contents)
|
||||
nil nil "OrgInlineTaskFrame" " style:rel-width=\"100%\"")))))
|
||||
(let* ((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 (and todo (org-element-property :todo-type inlinetask)))
|
||||
(priority (and (plist-get info :with-priority)
|
||||
(org-element-property :priority inlinetask)))
|
||||
(text (org-export-data (org-element-property :title inlinetask) info))
|
||||
(tags (and (plist-get info :with-tags)
|
||||
(org-export-get-tags inlinetask info))))
|
||||
(funcall (plist-get info :odt-format-inlinetask-function)
|
||||
todo todo-type priority text tags contents)))
|
||||
|
||||
(defun org-odt-format-inlinetask-default-function
|
||||
(todo todo-type priority name tags contents)
|
||||
"Default format function for a inlinetasks.
|
||||
See `org-odt-format-inlinetask-function' for details."
|
||||
(format "\n<text:p text:style-name=\"%s\">%s</text:p>"
|
||||
"Text_20_body"
|
||||
(org-odt--textbox
|
||||
(concat
|
||||
(format "\n<text:p text:style-name=\"%s\">%s</text:p>"
|
||||
"OrgInlineTaskHeading"
|
||||
(org-odt-format-headline-default-function
|
||||
todo todo-type priority name tags))
|
||||
contents)
|
||||
nil nil "OrgInlineTaskFrame" " style:rel-width=\"100%\"")))
|
||||
|
||||
;;;; Italic
|
||||
|
||||
|
@ -2045,7 +2041,7 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
CONTENTS is nil. INFO is a plist holding contextual information."
|
||||
(let* ((latex-frag (org-remove-indentation
|
||||
(org-element-property :value latex-environment))))
|
||||
(org-odt-do-format-code latex-frag)))
|
||||
(org-odt-do-format-code latex-frag info)))
|
||||
|
||||
|
||||
;;;; Latex Fragment
|
||||
|
@ -2100,7 +2096,9 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
counter))
|
||||
info 'first-match)))))
|
||||
(scope (funcall --numbered-parent-headline-at-<=-n
|
||||
element (or n org-odt-display-outline-level) info))
|
||||
element
|
||||
(or n (plist-get info :odt-display-outline-level))
|
||||
info))
|
||||
(ordinal (funcall --enumerate element scope info predicate))
|
||||
(tag
|
||||
(concat
|
||||
|
@ -2220,8 +2218,8 @@ SHORT-CAPTION are strings."
|
|||
(org-odt-create-manifest-file-entry media-type target-file)
|
||||
target-file))
|
||||
|
||||
(defun org-odt--image-size (file &optional user-width
|
||||
user-height scale dpi embed-as)
|
||||
(defun org-odt--image-size
|
||||
(file info &optional user-width user-height scale dpi embed-as)
|
||||
(let* ((--pixels-to-cms
|
||||
(function (lambda (pixels dpi)
|
||||
(let ((cms-per-inch 2.54)
|
||||
|
@ -2233,7 +2231,7 @@ SHORT-CAPTION are strings."
|
|||
(and size-in-pixels
|
||||
(cons (funcall --pixels-to-cms (car size-in-pixels) dpi)
|
||||
(funcall --pixels-to-cms (cdr size-in-pixels) dpi))))))
|
||||
(dpi (or dpi org-odt-pixels-per-inch))
|
||||
(dpi (or dpi (plist-get info :odt-pixels-per-inch)))
|
||||
(anchor-type (or embed-as "paragraph"))
|
||||
(user-width (and (not scale) user-width))
|
||||
(user-height (and (not scale) user-height))
|
||||
|
@ -2322,7 +2320,7 @@ used as a communication channel."
|
|||
;; Handle `:width', `:height' and `:scale' properties. Read
|
||||
;; them as numbers since we need them for computations.
|
||||
(size (org-odt--image-size
|
||||
src-expanded
|
||||
src-expanded info
|
||||
(let ((width (plist-get attr-plist :width)))
|
||||
(and width (read width)))
|
||||
(let ((length (plist-get attr-plist :length)))
|
||||
|
@ -2351,7 +2349,7 @@ used as a communication channel."
|
|||
;; description. This quite useful for debugging.
|
||||
(desc (and replaces (org-element-property :value replaces))))
|
||||
(org-odt--render-image/formula entity href width height
|
||||
captions user-frame-params title desc)))
|
||||
captions user-frame-params title desc)))
|
||||
|
||||
|
||||
;;;; Links :: Math formula
|
||||
|
@ -2553,7 +2551,7 @@ used as a communication channel."
|
|||
;; Link should point to an image file.
|
||||
(lambda (l)
|
||||
(assert (eq (org-element-type l) 'link))
|
||||
(org-export-inline-image-p l org-odt-inline-image-rules))))
|
||||
(org-export-inline-image-p l (plist-get info :odt-inline-image-rules)))))
|
||||
|
||||
(defun org-odt--enumerable-latex-image-p (element info)
|
||||
(org-odt--standalone-link-p
|
||||
|
@ -2568,7 +2566,7 @@ used as a communication channel."
|
|||
;; Link should point to an image file.
|
||||
(lambda (l)
|
||||
(assert (eq (org-element-type l) 'link))
|
||||
(org-export-inline-image-p l org-odt-inline-image-rules))))
|
||||
(org-export-inline-image-p l (plist-get info :odt-inline-image-rules)))))
|
||||
|
||||
(defun org-odt--enumerable-formula-p (element info)
|
||||
(org-odt--standalone-link-p
|
||||
|
@ -2580,7 +2578,7 @@ used as a communication channel."
|
|||
;; Link should point to a MathML or ODF file.
|
||||
(lambda (l)
|
||||
(assert (eq (org-element-type l) 'link))
|
||||
(org-export-inline-image-p l org-odt-inline-formula-rules))))
|
||||
(org-export-inline-image-p l (plist-get info :odt-inline-formula-rules)))))
|
||||
|
||||
(defun org-odt--standalone-link-p (element info &optional
|
||||
paragraph-predicate
|
||||
|
@ -2720,7 +2718,7 @@ INFO is a plist holding contextual information. See
|
|||
;; Ensure DESC really exists, or set it to nil.
|
||||
(desc (and (not (string= desc "")) desc))
|
||||
(imagep (org-export-inline-image-p
|
||||
link org-odt-inline-image-rules))
|
||||
link (plist-get info :odt-inline-image-rules)))
|
||||
(path (cond
|
||||
((member type '("http" "https" "ftp" "mailto"))
|
||||
(concat type ":" raw-path))
|
||||
|
@ -2733,11 +2731,11 @@ INFO is a plist holding contextual information. See
|
|||
(cond
|
||||
;; Image file.
|
||||
((and (not desc) (org-export-inline-image-p
|
||||
link org-odt-inline-image-rules))
|
||||
link (plist-get info :odt-inline-image-rules)))
|
||||
(org-odt-link--inline-image link info))
|
||||
;; Formula file.
|
||||
((and (not desc) (org-export-inline-image-p
|
||||
link org-odt-inline-formula-rules))
|
||||
link (plist-get info :odt-inline-formula-rules)))
|
||||
(org-odt-link--inline-formula link info))
|
||||
;; Radio target: Transcode target's contents and use them as
|
||||
;; link's description.
|
||||
|
@ -2825,7 +2823,8 @@ INFO is a plist holding contextual information. See
|
|||
(let ((desc-element (car link-contents)))
|
||||
(and (eq (org-element-type desc-element) 'link)
|
||||
(org-export-inline-image-p
|
||||
desc-element org-odt-inline-image-rules))))
|
||||
desc-element
|
||||
(plist-get info :odt-inline-image-rules)))))
|
||||
;; Format link as a clickable image.
|
||||
(format "\n<draw:a xlink:type=\"simple\" xlink:href=\"%s\">\n%s\n</draw:a>"
|
||||
path desc)
|
||||
|
@ -3141,13 +3140,13 @@ and prefix with \"OrgSrc\". For example,
|
|||
(org-no-warnings (htmlfontify-string line))))
|
||||
|
||||
(defun org-odt-do-format-code
|
||||
(code &optional lang refs retain-labels num-start)
|
||||
(code info &optional lang refs retain-labels num-start)
|
||||
(let* ((lang (or (assoc-default lang org-src-lang-modes) lang))
|
||||
(lang-mode (and lang (intern (format "%s-mode" lang))))
|
||||
(code-lines (org-split-string code "\n"))
|
||||
(code-length (length code-lines))
|
||||
(use-htmlfontify-p (and (functionp lang-mode)
|
||||
org-odt-fontify-srcblocks
|
||||
(plist-get info :odt-fontify-srcblocks)
|
||||
(require 'htmlfontify nil t)
|
||||
(fboundp 'htmlfontify-string)))
|
||||
(code (if (not use-htmlfontify-p) code
|
||||
|
@ -3202,7 +3201,7 @@ and prefix with \"OrgSrc\". For example,
|
|||
(num-start (case (org-element-property :number-lines element)
|
||||
(continued (org-export-get-loc element info))
|
||||
(new 0))))
|
||||
(org-odt-do-format-code code lang refs retain-labels num-start)))
|
||||
(org-odt-do-format-code code info lang refs retain-labels num-start)))
|
||||
|
||||
(defun org-odt-src-block (src-block contents info)
|
||||
"Transcode a SRC-BLOCK element from Org to ODT.
|
||||
|
@ -3269,13 +3268,13 @@ contextual information."
|
|||
(let* ((table (org-export-get-parent-table element))
|
||||
(table-attributes (org-export-read-attribute :attr_odt table))
|
||||
(table-style (plist-get table-attributes :style)))
|
||||
(assoc table-style org-odt-table-styles)))
|
||||
(assoc table-style (plist-get info :odt-table-styles))))
|
||||
|
||||
(defun org-odt-get-table-cell-styles (table-cell info)
|
||||
"Retrieve styles applicable to a table cell.
|
||||
R and C are (zero-based) row and column numbers of the table
|
||||
cell. STYLE-SPEC is an entry in `org-odt-table-styles'
|
||||
applicable to the current table. It is `nil' if the table is not
|
||||
applicable to the current table. It is nil if the table is not
|
||||
associated with any style attributes.
|
||||
|
||||
Return a cons of (TABLE-CELL-STYLE-NAME . PARAGRAPH-STYLE-NAME).
|
||||
|
@ -3664,8 +3663,8 @@ information."
|
|||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
(let* ((raw-value (org-element-property :raw-value timestamp))
|
||||
(type (org-element-property :type timestamp)))
|
||||
(if (not org-odt-use-date-fields)
|
||||
(type (org-element-property :type timestamp)))
|
||||
(if (not (plist-get info :odt-use-date-fields))
|
||||
(let ((value (org-odt-plain-text
|
||||
(org-timestamp-translate timestamp) info)))
|
||||
(case (org-element-property :type timestamp)
|
||||
|
@ -3701,7 +3700,7 @@ channel."
|
|||
(format "<text:span text:style-name=\"%s\">%s</text:span>"
|
||||
"OrgDiaryTimestamp"
|
||||
(org-odt-plain-text (org-timestamp-translate timestamp)
|
||||
info)))))))
|
||||
info)))))))
|
||||
|
||||
|
||||
;;;; Underline
|
||||
|
|
|
@ -102,7 +102,6 @@ setting of `org-html-htmlize-output-type' is 'css."
|
|||
(underline . org-org-identity)
|
||||
(verbatim . org-org-identity)
|
||||
(verse-block . org-org-identity))
|
||||
:options-alist '((:org-htmlized-css-url nil nil org-org-htmlized-css-url))
|
||||
:menu-entry
|
||||
'(?O "Export to Org"
|
||||
((?O "As Org buffer" org-org-export-as-org)
|
||||
|
|
|
@ -129,7 +129,6 @@
|
|||
(:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t)
|
||||
(:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t)
|
||||
;; Other variables.
|
||||
(:texinfo-coding-system nil nil org-texinfo-coding-system)
|
||||
(: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)
|
||||
|
@ -142,10 +141,7 @@
|
|||
(:texinfo-def-table-markup nil nil org-texinfo-def-table-markup)
|
||||
(:texinfo-text-markup-alist nil nil org-texinfo-text-markup-alist)
|
||||
(:texinfo-format-drawer-function nil nil org-texinfo-format-drawer-function)
|
||||
(:texinfo-format-inlinetask-function nil nil org-texinfo-format-inlinetask-function)
|
||||
(:texinfo-info-process nil nil org-texinfo-info-process)
|
||||
(:texinfo-logfiles-extensions nil nil org-texinfo-logfiles-extensions)
|
||||
(:texinfo-remove-logfiles nil nil org-texinfo-remove-logfiles)))
|
||||
(:texinfo-format-inlinetask-function nil nil org-texinfo-format-inlinetask-function)))
|
||||
|
||||
|
||||
|
||||
|
@ -219,7 +215,8 @@ a format string in which the section title will be added."
|
|||
|
||||
;;; Headline
|
||||
|
||||
(defcustom org-texinfo-format-headline-function 'ignore
|
||||
(defcustom org-texinfo-format-headline-function
|
||||
'org-texinfo-format-headline-default-function
|
||||
"Function to format headline text.
|
||||
|
||||
This function will be called with 5 arguments:
|
||||
|
@ -229,23 +226,11 @@ 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).
|
||||
|
||||
The function result will be used in the section format string.
|
||||
|
||||
As an example, one could set the variable to the following, in
|
||||
order to reproduce the default set-up:
|
||||
|
||||
\(defun org-texinfo-format-headline (todo todo-type priority text tags)
|
||||
\"Default format function for a headline.\"
|
||||
\(concat (when todo
|
||||
\(format \"\\\\textbf{\\\\textsc{\\\\textsf{%s}}} \" todo))
|
||||
\(when priority
|
||||
\(format \"\\\\framebox{\\\\#%c} \" priority))
|
||||
text
|
||||
\(when tags
|
||||
\(format \"\\\\hfill{}\\\\textsc{%s}\"
|
||||
\(mapconcat 'identity tags \":\"))))"
|
||||
The function result will be used in the section format string."
|
||||
:group 'org-export-texinfo
|
||||
:type 'function)
|
||||
:type 'function
|
||||
:version "24.5"
|
||||
:package-version '(Org . "8.3"))
|
||||
|
||||
;;; Node listing (menu)
|
||||
|
||||
|
@ -353,7 +338,8 @@ The default function simply returns the value of CONTENTS."
|
|||
|
||||
;;; Inlinetasks
|
||||
|
||||
(defcustom org-texinfo-format-inlinetask-function 'ignore
|
||||
(defcustom org-texinfo-format-inlinetask-function
|
||||
'org-texinfo-format-inlinetask-default-function
|
||||
"Function called to format an inlinetask in Texinfo code.
|
||||
|
||||
The function must accept six parameters:
|
||||
|
@ -364,26 +350,7 @@ The function must accept six parameters:
|
|||
TAGS the inlinetask tags, as a list of strings.
|
||||
CONTENTS the contents of the inlinetask, as a string.
|
||||
|
||||
The function should return the string to be exported.
|
||||
|
||||
For example, the variable could be set to the following function
|
||||
in order to mimic default behavior:
|
||||
|
||||
\(defun org-texinfo-format-inlinetask \(todo type priority name tags contents\)
|
||||
\"Format an inline task element for Texinfo export.\"
|
||||
\(let ((full-title
|
||||
\(concat
|
||||
\(when todo
|
||||
\(format \"@strong{%s} \" todo))
|
||||
\(when priority (format \"#%c \" priority))
|
||||
title
|
||||
\(when tags
|
||||
\(format \":%s:\"
|
||||
\(mapconcat 'identity tags \":\")))))
|
||||
\(format (concat \"@center %s\n\n\"
|
||||
\"%s\"
|
||||
\"\n\"))
|
||||
full-title contents))"
|
||||
The function should return the string to be exported."
|
||||
:group 'org-export-texinfo
|
||||
:type 'function)
|
||||
|
||||
|
@ -462,9 +429,10 @@ nil."
|
|||
options
|
||||
","))
|
||||
|
||||
(defun org-texinfo--text-markup (text markup)
|
||||
(defun org-texinfo--text-markup (text markup info)
|
||||
"Format TEXT depending on MARKUP text markup.
|
||||
See `org-texinfo-text-markup-alist' for details."
|
||||
INFO is a plist used as a communication channel. See
|
||||
`org-texinfo-text-markup-alist' for details."
|
||||
(let ((fmt (cdr (assq markup org-texinfo-text-markup-alist))))
|
||||
(cond
|
||||
;; No format string: Return raw text.
|
||||
|
@ -567,7 +535,7 @@ recurse into all children as well."
|
|||
(t
|
||||
(setq text-menu (org-texinfo--generate-menu-items menu info))))
|
||||
(when text-menu
|
||||
(setq output (org-texinfo--format-menu text-menu))
|
||||
(setq output (org-texinfo--format-menu text-menu info))
|
||||
(mapconcat 'identity output "\n"))))
|
||||
|
||||
(defun org-texinfo--generate-detailed (menu level info)
|
||||
|
@ -652,8 +620,9 @@ entries."
|
|||
(org-element-property :title headline) info)))
|
||||
(list -1 title 'nil)))
|
||||
|
||||
(defun org-texinfo--format-menu (text-menu)
|
||||
(defun org-texinfo--format-menu (text-menu info)
|
||||
"Format the TEXT-MENU items to be properly printed in the menu.
|
||||
INFO is a plist containing contextual information.
|
||||
|
||||
Each entry in the menu should be provided as (length title
|
||||
description).
|
||||
|
@ -667,29 +636,22 @@ Other menu items are output as:
|
|||
|
||||
With the spacing between :: and description based on the length
|
||||
of the longest menu entry."
|
||||
|
||||
(let (output)
|
||||
(setq output
|
||||
(mapcar (lambda (name)
|
||||
(let* ((title (nth 1 name))
|
||||
(desc (nth 2 name))
|
||||
(length (nth 0 name))
|
||||
(column (max
|
||||
;;6 is "* " ":: " for inserted text
|
||||
length
|
||||
(-
|
||||
org-texinfo-node-description-column
|
||||
6)))
|
||||
(spacing (- column length)
|
||||
))
|
||||
(if (> length -1)
|
||||
(concat "* " title ":: "
|
||||
(make-string spacing ?\s)
|
||||
(if desc
|
||||
(concat desc)))
|
||||
(concat "\n" title "\n"))))
|
||||
text-menu))
|
||||
output))
|
||||
(mapcar
|
||||
(lambda (name)
|
||||
(let* ((title (nth 1 name))
|
||||
(desc (nth 2 name))
|
||||
(length (nth 0 name))
|
||||
(column (max
|
||||
length
|
||||
;; 6 is "* " ":: " for inserted text
|
||||
(- (plist-get info :texinfo-node-description-column) 6)))
|
||||
(spacing (- column length)))
|
||||
(if (> length -1)
|
||||
(concat "* " title ":: "
|
||||
(make-string spacing ?\s)
|
||||
(and desc (concat desc)))
|
||||
(concat "\n" title "\n"))))
|
||||
text-menu))
|
||||
|
||||
;;; Template
|
||||
|
||||
|
@ -708,7 +670,7 @@ holding export options."
|
|||
(subtitle (plist-get info :subtitle))
|
||||
(subauthor (plist-get info :subauthor))
|
||||
(class (plist-get info :texinfo-class))
|
||||
(header (nth 1 (assoc class org-texinfo-classes)))
|
||||
(header (nth 1 (assoc class (plist-get info :texinfo-classes))))
|
||||
(copying
|
||||
(org-element-map (plist-get info :parse-tree) 'headline
|
||||
(lambda (hl) (and (org-element-property :COPYING hl) hl)) info t))
|
||||
|
@ -841,7 +803,7 @@ holding export options."
|
|||
"Transcode BOLD from Org to Texinfo.
|
||||
CONTENTS is the text with bold markup. INFO is a plist holding
|
||||
contextual information."
|
||||
(org-texinfo--text-markup contents 'bold))
|
||||
(org-texinfo--text-markup contents 'bold info))
|
||||
|
||||
;;; Center Block
|
||||
|
||||
|
@ -860,7 +822,7 @@ information."
|
|||
(concat
|
||||
"@noindent"
|
||||
(format "@strong{%s} " org-clock-string)
|
||||
(format org-texinfo-inactive-timestamp-format
|
||||
(format (plist-get info :texinfo-inactive-timestamp-format)
|
||||
(concat (org-translate-time
|
||||
(org-element-property :raw-value
|
||||
(org-element-property :value clock)))
|
||||
|
@ -874,7 +836,7 @@ information."
|
|||
"Transcode a CODE object from Org to Texinfo.
|
||||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
(org-texinfo--text-markup (org-element-property :value code) 'code))
|
||||
(org-texinfo--text-markup (org-element-property :value code) 'code info))
|
||||
|
||||
;;; Comment
|
||||
|
||||
|
@ -882,7 +844,8 @@ channel."
|
|||
"Transcode a COMMENT object from Org to Texinfo.
|
||||
CONTENTS is the text in the comment. INFO is a plist holding
|
||||
contextual information."
|
||||
(org-texinfo--text-markup (org-element-property :value comment) 'comment))
|
||||
(org-texinfo--text-markup
|
||||
(org-element-property :value comment) 'comment info))
|
||||
|
||||
;;; Comment Block
|
||||
|
||||
|
@ -899,7 +862,7 @@ contextual information."
|
|||
CONTENTS holds the contents of the block. INFO is a plist
|
||||
holding contextual information."
|
||||
(let* ((name (org-element-property :drawer-name drawer))
|
||||
(output (funcall org-texinfo-format-drawer-function
|
||||
(output (funcall (plist-get info :texinfo-format-drawer-function)
|
||||
name contents)))
|
||||
output))
|
||||
|
||||
|
@ -968,7 +931,7 @@ holding contextual information."
|
|||
(let* ((class (plist-get info :texinfo-class))
|
||||
(level (org-export-get-relative-level headline info))
|
||||
(numberedp (org-export-numbered-headline-p headline info))
|
||||
(class-sectioning (assoc class org-texinfo-classes))
|
||||
(class-sectioning (assoc class (plist-get info :texinfo-classes)))
|
||||
;; Find the index type, if any
|
||||
(index (org-element-property :INDEX headline))
|
||||
;; Check if it is an appendix
|
||||
|
@ -1024,7 +987,7 @@ holding contextual information."
|
|||
"unnumbered"
|
||||
"appendix"
|
||||
(cdr sec)) "\n%s"))
|
||||
;; Otherwise number as needed.
|
||||
;; Otherwise number as needed.
|
||||
(t
|
||||
(concat menu node
|
||||
(funcall
|
||||
|
@ -1041,30 +1004,12 @@ holding contextual information."
|
|||
;; Create the headline text along with a no-tag version. The
|
||||
;; latter is required to remove tags from table of contents.
|
||||
(full-text (org-texinfo--sanitize-content
|
||||
(if (not (eq org-texinfo-format-headline-function 'ignore))
|
||||
;; User-defined formatting function.
|
||||
(funcall org-texinfo-format-headline-function
|
||||
todo todo-type priority text tags)
|
||||
;; Default formatting.
|
||||
(concat
|
||||
(when todo
|
||||
(format "@strong{%s} " todo))
|
||||
(when priority (format "@emph{#%s} " priority))
|
||||
text
|
||||
(when tags
|
||||
(format " :%s:"
|
||||
(mapconcat 'identity tags ":")))))))
|
||||
(funcall (plist-get info :texinfo-format-headline-function)
|
||||
todo todo-type priority text tags)))
|
||||
(full-text-no-tag
|
||||
(org-texinfo--sanitize-content
|
||||
(if (not (eq org-texinfo-format-headline-function 'ignore))
|
||||
;; User-defined formatting function.
|
||||
(funcall org-texinfo-format-headline-function
|
||||
todo todo-type priority text nil)
|
||||
;; Default formatting.
|
||||
(concat
|
||||
(when todo (format "@strong{%s} " todo))
|
||||
(when priority (format "@emph{#%c} " priority))
|
||||
text))))
|
||||
(funcall (plist-get info :texinfo-format-headline-function)
|
||||
todo todo-type priority text nil)))
|
||||
(pre-blanks
|
||||
(make-string (org-element-property :pre-blank headline) 10)))
|
||||
(cond
|
||||
|
@ -1131,6 +1076,15 @@ holding contextual information."
|
|||
(format (replace-regexp-in-string "%]" "%%]" section-fmt) full-text
|
||||
(concat pre-blanks contents))))))))
|
||||
|
||||
(defun org-texinfo-format-headline-default-function
|
||||
(todo todo-type priority text tags)
|
||||
"Default format function for a headline.
|
||||
See `org-texinfo-format-headline-function' for details."
|
||||
(concat (when todo (format "@strong{%s} " todo))
|
||||
(when priority (format "@emph{#%s} " priority))
|
||||
text
|
||||
(when tags (format " :%s:" (mapconcat 'identity tags ":")))))
|
||||
|
||||
;;; Inline Src Block
|
||||
|
||||
(defun org-texinfo-inline-src-block (inline-src-block contents info)
|
||||
|
@ -1156,23 +1110,19 @@ holding contextual information."
|
|||
(org-export-get-tags inlinetask info)))
|
||||
(priority (and (plist-get info :with-priority)
|
||||
(org-element-property :priority inlinetask))))
|
||||
;; If `org-texinfo-format-inlinetask-function' is provided, call it
|
||||
;; with appropriate arguments.
|
||||
(if (not (eq org-texinfo-format-inlinetask-function 'ignore))
|
||||
(funcall org-texinfo-format-inlinetask-function
|
||||
todo todo-type priority title tags contents)
|
||||
;; Otherwise, use a default template.
|
||||
(let ((full-title
|
||||
(concat
|
||||
(when todo (format "@strong{%s} " todo))
|
||||
(when priority (format "#%c " priority))
|
||||
title
|
||||
(when tags (format ":%s:"
|
||||
(mapconcat 'identity tags ":"))))))
|
||||
(format (concat "@center %s\n\n"
|
||||
"%s"
|
||||
"\n")
|
||||
full-title contents)))))
|
||||
(funcall (plist-get info :texinfo-format-inlinetask-function)
|
||||
todo todo-type priority title tags contents)))
|
||||
|
||||
(defun org-texinfo-format-inlinetask-default-function
|
||||
(todo todo-type priority title tags contents)
|
||||
"Default format function for a inlinetasks.
|
||||
See `org-texinfo-format-inlinetask-function' for details."
|
||||
(let ((full-title
|
||||
(concat (when todo (format "@strong{%s} " todo))
|
||||
(when priority (format "#%c " priority))
|
||||
title
|
||||
(when tags (format ":%s:" (mapconcat #'identity tags ":"))))))
|
||||
(format "@center %s\n\n%s\n" full-title contents)))
|
||||
|
||||
;;; Italic
|
||||
|
||||
|
@ -1180,7 +1130,7 @@ holding contextual information."
|
|||
"Transcode ITALIC from Org to Texinfo.
|
||||
CONTENTS is the text with italic markup. INFO is a plist holding
|
||||
contextual information."
|
||||
(org-texinfo--text-markup contents 'italic))
|
||||
(org-texinfo--text-markup contents 'italic info))
|
||||
|
||||
;;; Item
|
||||
|
||||
|
@ -1288,7 +1238,8 @@ INFO is a plist holding contextual information. See
|
|||
;; External link without a description part.
|
||||
(path (format "@uref{%s}" path))
|
||||
;; No path, only description. Try to do something useful.
|
||||
(t (format org-texinfo-link-with-unknown-path-format desc)))))
|
||||
(t
|
||||
(format (plist-get info :texinfo-link-with-unknown-path-format) desc)))))
|
||||
|
||||
|
||||
;;; Menu
|
||||
|
@ -1338,7 +1289,7 @@ CONTENTS is the contents of the list. INFO is a plist holding
|
|||
contextual information."
|
||||
(let* ((attr (org-export-read-attribute :attr_texinfo plain-list))
|
||||
(indic (or (plist-get attr :indic)
|
||||
org-texinfo-def-table-markup))
|
||||
(plist-get info :texinfo-def-table-markup)))
|
||||
(type (org-element-property :type plain-list))
|
||||
(table-type (plist-get attr :table-type))
|
||||
;; Ensure valid texinfo table type.
|
||||
|
@ -1402,21 +1353,21 @@ information."
|
|||
(when closed
|
||||
(concat
|
||||
(format "@strong{%s} " org-closed-string)
|
||||
(format org-texinfo-inactive-timestamp-format
|
||||
(format (plist-get info :texinfo-inactive-timestamp-format)
|
||||
(org-translate-time
|
||||
(org-element-property :raw-value closed))))))
|
||||
(let ((deadline (org-element-property :deadline planning)))
|
||||
(when deadline
|
||||
(concat
|
||||
(format "@strong{%s} " org-deadline-string)
|
||||
(format org-texinfo-active-timestamp-format
|
||||
(format (plist-get info :texinfo-active-timestamp-format)
|
||||
(org-translate-time
|
||||
(org-element-property :raw-value deadline))))))
|
||||
(let ((scheduled (org-element-property :scheduled planning)))
|
||||
(when scheduled
|
||||
(concat
|
||||
(format "@strong{%s} " org-scheduled-string)
|
||||
(format org-texinfo-active-timestamp-format
|
||||
(format (plist-get info :texinfo-active-timestamp-format)
|
||||
(org-translate-time
|
||||
(org-element-property :raw-value scheduled))))))))
|
||||
" ")
|
||||
|
@ -1532,7 +1483,7 @@ CONTENTS is the contents of the table. INFO is a plist holding
|
|||
contextual information."
|
||||
(cond
|
||||
;; Case 1: verbatim table.
|
||||
((or org-texinfo-tables-verbatim
|
||||
((or (plist-get info :texinfo-tables-verbatim)
|
||||
(let ((attr (mapconcat 'identity
|
||||
(org-element-property :attr_latex table)
|
||||
" ")))
|
||||
|
@ -1610,16 +1561,18 @@ Rather than return an invalid table, nothing is returned."
|
|||
"Transcode a TABLE-CELL element from Org to Texinfo.
|
||||
CONTENTS is the cell contents. INFO is a plist used as
|
||||
a communication channel."
|
||||
(concat (if (and contents
|
||||
org-texinfo-table-scientific-notation
|
||||
(string-match orgtbl-exp-regexp contents))
|
||||
;; Use appropriate format string for scientific
|
||||
;; notation.
|
||||
(format org-texinfo-table-scientific-notation
|
||||
(match-string 1 contents)
|
||||
(match-string 2 contents))
|
||||
contents)
|
||||
(when (org-export-get-next-element table-cell info) "\n@tab ")))
|
||||
(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 ")))
|
||||
|
||||
;;; Table Row
|
||||
|
||||
|
@ -1663,10 +1616,10 @@ information."
|
|||
(org-timestamp-translate timestamp) info)))
|
||||
(case (org-element-property :type timestamp)
|
||||
((active active-range)
|
||||
(format org-texinfo-active-timestamp-format value))
|
||||
(format (plist-get info :texinfo-active-timestamp-format) value))
|
||||
((inactive inactive-range)
|
||||
(format org-texinfo-inactive-timestamp-format value))
|
||||
(t (format org-texinfo-diary-timestamp-format value)))))
|
||||
(format (plist-get info :texinfo-inactive-timestamp-format) value))
|
||||
(t (format (plist-get info :texinfo-diary-timestamp-format) value)))))
|
||||
|
||||
;;; Verbatim
|
||||
|
||||
|
@ -1674,7 +1627,8 @@ information."
|
|||
"Transcode a VERBATIM object from Org to Texinfo.
|
||||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
(org-texinfo--text-markup (org-element-property :value verbatim) 'verbatim))
|
||||
(org-texinfo--text-markup
|
||||
(org-element-property :value verbatim) 'verbatim info))
|
||||
|
||||
;;; Verse Block
|
||||
|
||||
|
|
|
@ -1063,7 +1063,7 @@ drops support for Emacs 24.1 and 24.2."
|
|||
(org-open-at-point)
|
||||
(and (switch-to-buffer "*info*")
|
||||
(prog1
|
||||
(looking-at "\nOrg Mode Manual")
|
||||
(looking-at "\nThe Emacs Editor")
|
||||
(kill-buffer))))))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue