summaryrefslogtreecommitdiff
path: root/lisp/ox-latex.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ox-latex.el')
-rw-r--r--lisp/ox-latex.el52
1 files changed, 26 insertions, 26 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index e1173ef..3609881 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -5,6 +5,8 @@
;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
;; Keywords: outlines, hypermedia, calendar, wp
+;; This file is part of GNU Emacs.
+
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@@ -554,7 +556,8 @@ returned as-is."
;;;; Drawers
-(defcustom org-latex-format-drawer-function nil
+(defcustom org-latex-format-drawer-function
+ (lambda (name contents) contents)
"Function called to format a drawer in LaTeX code.
The function must accept two parameters:
@@ -563,19 +566,16 @@ The function must accept two 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-drawer-default \(name contents\)
- \"Format a drawer element for LaTeX export.\"
- contents\)"
+The default function simply returns the value of CONTENTS."
:group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.3")
:type 'function)
;;;; Inlinetasks
-(defcustom org-latex-format-inlinetask-function nil
+(defcustom org-latex-format-inlinetask-function 'ignore
"Function called to format an inlinetask in LaTeX code.
The function must accept six parameters:
@@ -655,7 +655,7 @@ into previewing problems, please consult
:group 'org-export-latex
:type '(choice
(const :tag "Use listings" t)
- (const :tag "Use minted" 'minted)
+ (const :tag "Use minted" minted)
(const :tag "Export verbatim" nil)))
(defcustom org-latex-listings-langs
@@ -690,8 +690,8 @@ a list containing two strings: the name of the option, and the
value. For example,
(setq org-latex-listings-options
- '((\"basicstyle\" \"\\small\")
- (\"keywordstyle\" \"\\color{black}\\bfseries\\underbar\")))
+ '((\"basicstyle\" \"\\\\small\")
+ (\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\")))
will typeset the code in a small size font with underlined, bold
black keywords.
@@ -1210,12 +1210,8 @@ channel."
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let* ((name (org-element-property :drawer-name drawer))
- (output (if (functionp org-latex-format-drawer-function)
- (funcall org-latex-format-drawer-function
- name contents)
- ;; If there's no user defined function: simply
- ;; display contents of the drawer.
- contents)))
+ (output (funcall org-latex-format-drawer-function
+ name contents)))
(org-latex--wrap-label drawer output)))
@@ -1323,13 +1319,13 @@ 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-sectionning (assoc class org-latex-classes))
+ (class-sectioning (assoc class org-latex-classes))
;; Section formatting will set two placeholders: one for
;; the title and the other for the contents.
(section-fmt
- (let ((sec (if (functionp (nth 2 class-sectionning))
- (funcall (nth 2 class-sectionning) level numberedp)
- (nth (1+ level) class-sectionning))))
+ (let ((sec (if (functionp (nth 2 class-sectioning))
+ (funcall (nth 2 class-sectioning) level numberedp)
+ (nth (1+ level) class-sectioning))))
(cond
;; No section available for that LEVEL.
((not sec) nil)
@@ -1500,7 +1496,7 @@ holding contextual information."
(org-element-property :priority inlinetask))))
;; If `org-latex-format-inlinetask-function' is provided, call it
;; with appropriate arguments.
- (if (functionp org-latex-format-inlinetask-function)
+ (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.
@@ -1620,7 +1616,7 @@ CONTENTS is nil. INFO is a plist holding contextual information."
(value (org-remove-indentation
(org-element-property :value latex-environment))))
(if (not (org-string-nw-p label)) value
- ;; Environment is labelled: label must be within the environment
+ ;; Environment is labeled: label must be within the environment
;; (otherwise, a reference pointing to that element will count
;; the section instead).
(with-temp-buffer
@@ -2852,9 +2848,13 @@ Return PDF file name or an error if it couldn't be produced."
;; Else remove log files, when specified, and signal end of
;; process to user, along with any error encountered.
(when (and (not snippet) org-latex-remove-logfiles)
- (dolist (ext org-latex-logfiles-extensions)
- (let ((file (concat out-dir base-name "." ext)))
- (when (file-exists-p file) (delete-file file)))))
+ (dolist (file (directory-files
+ out-dir t
+ (concat (regexp-quote base-name)
+ "\\(?:\\.[0-9]+\\)?"
+ "\\."
+ (regexp-opt org-latex-logfiles-extensions))))
+ (delete-file file)))
(message (concat "Process completed"
(if (not errors) "."
(concat " with errors: " errors)))))