branch: externals/org
commit 53cd3f83c96728fff22bcc2e51a6ce1fa5aba279
Author: Pedro A. Aranda <paag...@gmail.com>
Commit: Ihor Radchenko <yanta...@posteo.net>

    ox-latex: Export PDF metadata using hyperref according to 
org-export-with-...
    
    * lisp/ox-latex.el: Adjust PDF metadata according to the existing
    settings in `org-export-with-title', `org-export-with-author', and
    `org-export-with-creator'.
    * lisp/ox-latex.el: (org-latex--format-spec): Replace author, title
    and creator fields with "" when the corresponding
    org-export-with-... is nil.
    * etc/ORG-NEWS: Announce the change.
    
    Link: https://list.orgmode.org/87zfivm8qt.fsf@localhost/T/#t
---
 etc/ORG-NEWS     |  9 +++++++++
 lisp/ox-latex.el | 16 ++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index a878f37762..332586f4f3 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -557,6 +557,15 @@ were tangled into a file named =NAME.bibtex=.  Now, they 
are tangled
 into a file named =FILE.bib=, using the standard extension =.bib=,
 matching the rest of the ecosystem, including BibTeX and LaTeX.
 
+*** LaTeX export now respects ~org-latex-with...~ options in the PDF matedata
+
+Previously, the LaTeX exporter handled the PDF metadata =pdfcreator=,
+=pdfauthor= and =pdftitle= as defined in
+~org-latex-hyperref-template~. This has changed and these three fields
+will be defined as empty and not produce any metadata if their
+corresponding ~org-latex-with-author~, ~org-latex-with-title~, or
+~org-latex-with-creator~ option is set to ~nil~.
+
 * Version 9.7
 
 ** Important announcements and breaking changes
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index a7ab4ca7b4..af3ac308b5 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1940,16 +1940,24 @@ INFO is a plist used as a communication channel."
                     ;; Here the actual name of the LANGUAGE or LANG is used.
                    (or (plist-get plist :lang-name)
                        lang))))
-    `((?a . ,(org-export-data (plist-get info :author) info))
-      (?t . ,(org-export-data (plist-get info :title) info))
-      (?s . ,(org-export-data (plist-get info :subtitle) info))
+    `((?a . ,(if (plist-get info :with-author)
+                 (org-export-data (plist-get info :author) info)
+               ""))
+      (?t . ,(if (plist-get info :with-title)
+                 (org-export-data (plist-get info :title) info)
+               ""))
+      (?s . ,(if (plist-get info :with-title)
+                 (org-export-data (plist-get info :subtitle) info)
+               ""))
       (?k . ,(org-export-data (org-latex--wrap-latex-math-block
                               (plist-get info :keywords) info)
                              info))
       (?d . ,(org-export-data (org-latex--wrap-latex-math-block
                               (plist-get info :description) info)
                              info))
-      (?c . ,(plist-get info :creator))
+      (?c . ,(if (plist-get info :with-creator)
+                 (plist-get info :creator)
+               ""))
       (?l . ,language)
       (?L . ,(capitalize language))
       (?D . ,(org-export-data (org-export-get-date info) info)))))

Reply via email to