Skip to content

Commit

Permalink
lisp/ox-latex: Omit empty date
Browse files Browse the repository at this point in the history
* lisp/ox-latex.el: (org-latex-template): When no date is provided or
the export option date is nil, the empty '\date{}' string is no
longer included in the exported latex document.

The default behaviour for ox-latex was to include an empty date line as
'\date{}'.  This empty date line can affect more complex latex templates
when the date is for example set by the template on compilation, or when
the date command is overwritten entirely.  In this new patch, the date
line is omitted from the exported document.

TINYCHANGE
  • Loading branch information
Bob Vergauwen authored and yantar92 committed Jul 30, 2022
1 parent 2027445 commit a753d0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lisp/ox-latex.el
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,8 @@ holding export options."
((or author email) (format "\\author{%s}\n" (or author email)))))
;; Date.
(let ((date (and (plist-get info :with-date) (org-export-get-date info))))
(format "\\date{%s}\n" (org-export-data date info)))
(when date
(format "\\date{%s}\n" (org-export-data date info))))
;; Title and subtitle.
(let* ((subtitle (plist-get info :subtitle))
(formatted-subtitle
Expand Down

0 comments on commit a753d0d

Please sign in to comment.