emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcel van der Boom <marcel@hsdev.com>
To: emacs-orgmode@gnu.org
Cc: Marcel van der Boom <marcel@hsdev.com>
Subject: [PATCH] Add author and title to exported PDF properties
Date: Mon, 12 May 2014 23:40:10 +0200	[thread overview]
Message-ID: <1399930810-23164-1-git-send-email-marcel@hsdev.com> (raw)

* lisp/ox-latex.el (org-latex-template): add pdfauthor and pdftitle
(org-latex-hyperref-template): add placeholders for author and title
(org-latex-template): adjust default template with author and title

This adds author and title to the pdf properties of the exported PDF
file when using the LaTeX backend.
---
 lisp/ox-latex.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cea21be..844f2cd 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -349,7 +349,7 @@ the toc:nil option, not to those generated with #+TOC keyword."
   :type 'string)
 
 (defcustom org-latex-hyperref-template
-  "\\hypersetup{\n pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
+  "\\hypersetup{\n pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c},\n pdfauthor={%a},\n pdftitle={%t}}"
   "Template for hyperref package options.
 
 Value is a format string, which can contain the following placeholders:
@@ -357,6 +357,8 @@ Value is a format string, which can contain the following placeholders:
   %k for KEYWORDS line
   %d for DESCRIPTION line
   %c for CREATOR line
+  %a for AUTHOR line
+  %t for TITLE line
 
 Set it to the empty string to ignore the command completely."
   :group 'org-export-latex
@@ -1216,6 +1218,8 @@ holding export options."
      (format-spec (plist-get info :latex-hyperref)
                   (format-spec-make
                    ?k (or (plist-get info :keywords) "")
+		   ?a (or (first (plist-get info :author)) "")
+		   ?t (or (first (plist-get info :title)) "")
                    ?d (or (plist-get info :description)"")
                    ?c (if (plist-get info :with-creator)
                           (plist-get info :creator)
-- 
1.9.1

             reply	other threads:[~2014-05-12 21:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 21:40 Marcel van der Boom [this message]
2014-05-14  7:05 ` [PATCH] Add author and title to exported PDF properties Nicolas Goaziou
2014-05-14 12:24   ` Marcel van der Boom
2014-05-14 12:48     ` Nicolas Goaziou
2014-05-14 15:48       ` Marcel van der Boom
2014-05-15 12:14         ` Sebastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399930810-23164-1-git-send-email-marcel@hsdev.com \
    --to=marcel@hsdev.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).