From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Add author and title to exported PDF properties Date: Wed, 14 May 2014 09:05:14 +0200 Message-ID: <8738gcn8lx.fsf@gmail.com> References: <1399930810-23164-1-git-send-email-marcel@hsdev.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkTF9-0005J7-FW for emacs-orgmode@gnu.org; Wed, 14 May 2014 03:04:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkTF3-0001XG-HE for emacs-orgmode@gnu.org; Wed, 14 May 2014 03:04:47 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:54413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkTF3-0001XC-As for emacs-orgmode@gnu.org; Wed, 14 May 2014 03:04:41 -0400 Received: by mail-wg0-f50.google.com with SMTP id x12so1420991wgg.21 for ; Wed, 14 May 2014 00:04:40 -0700 (PDT) In-Reply-To: <1399930810-23164-1-git-send-email-marcel@hsdev.com> (Marcel van der Boom's message of "Mon, 12 May 2014 23:40:10 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Marcel van der Boom Cc: emacs-orgmode@gnu.org Hello, Marcel van der Boom writes: Thanks for your patch. A few comments follow. > * 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 You need full stops at the end of sentences, and upper case letters after the colons. > (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}}" Nitpick: the number of space characters after newline characters should be consistent, even though it wasn't the case before your patch. > + ?a (or (first (plist-get info :author)) "") > + ?t (or (first (plist-get info :title)) "") This part is buggy. Both (plist-get info :author) and (plist-get info :title) will return a "secondary list", which is a list of strings and syntax objects. You usually need to handle these with `org-export-data', not `first'. Alas, in this case, `org-export-data' may not be appropriate, as some objects should be exported differently in these keywords. For example, you may want to remove footnote references, radio-targets, targets, links and possibly any LaTeX markup (e.g., are "\textbf{bold}" macros allowed in these keywords?). The usual way to achieve this is to create an anonymous export back-end, derived from `latex', with `org-export-create-backend', and let it handle specially problematic objects. You then use it within `org-export-data-with-backend'. See `org-html--format-toc-headline' for an example. Regards, -- Nicolas Goaziou