From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-export-latex-hyperref-options-format Date: Thu, 20 Feb 2014 11:22:58 +0100 Message-ID: <87zjlm13st.fsf@gmail.com> References: <87a9dpo0as.fsf@gmail.com> <8738jhnx1m.fsf@gmail.com> <878ut72qyo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGQmD-0001a3-LD for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 05:22:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGQm5-0003ty-8h for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 05:22:45 -0500 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:44890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGQm5-0003tu-1b for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 05:22:37 -0500 Received: by mail-wi0-f171.google.com with SMTP id cc10so5689199wib.4 for ; Thu, 20 Feb 2014 02:22:36 -0800 (PST) In-Reply-To: (Joe Hirn's message of "Wed, 19 Feb 2014 16:43:20 -0600") 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: Joe Hirn Cc: emacs-orgmode@gnu.org Hello, Joe Hirn writes: > Hi just sat down to code this up. I assume the keywords are so we can use > data within the plist argument (info) passed to `org-latex-template'. But > I'm not exactly sure what you mean by %k for keywords. > > Are you suggesting we could do something like: > > "\\hypersetup{\n pdfkeywords={%kkeywords},\n > pdfsubject={%kdescription},\n pdfcreator={%kcreator}}\n" > > If that's the idea, is there a more powerful construct than regex matching > for achieving this? Otherwise, can you give me an example of what you had > in mind for the keyword placeholders. I'm suggesting to use `format-spec', e.g., something like: (and org-latex-hyperref-template (format-spec org-latex-hyperref-template (format-spec-make ?k (or (plist-get info :keywords) "") ?d (or (plist-get info :description) "") ?c (if (not (plist-get info :with-creator)) "" (plist-get info :creator))))) Thus, when `org-latex-hyperref-template' is nil, no "\hyperref" command is inserted, otherwise, it is a format string where %k is replaced with KEYWORDS, %d with DESCRIPTION and %c with CREATOR. Default value for the variable would be: "\\hypersetup{\n pdfkeywords={%k},\n pdfsubject={%d},\n pdfcreator={%c}}\n" A (require 'format-spec) will be needed in the beginning of "ox-latex.el". Regards, -- Nicolas Goaziou