emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Marcel van der Boom <marcel@hsdev.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Add author and title to exported PDF properties
Date: Wed, 14 May 2014 09:05:14 +0200	[thread overview]
Message-ID: <8738gcn8lx.fsf@gmail.com> (raw)
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")

Hello,

Marcel van der Boom <marcel@hsdev.com> 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

  reply	other threads:[~2014-05-14  7:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 21:40 [PATCH] Add author and title to exported PDF properties Marcel van der Boom
2014-05-14  7:05 ` Nicolas Goaziou [this message]
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=8738gcn8lx.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=marcel@hsdev.com \
    /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).