all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: Some LaTeX Beamer / org-mode questions
Date: Tue, 14 Jun 2016 14:43:33 +0200	[thread overview]
Message-ID: <87fusg0wlm.fsf@saiph.selenimh> (raw)
In-Reply-To: <87eg8fq5tc.fsf@gmx.us> (rasmus@gmx.us's message of "Thu, 02 Jun 2016 11:49:03 +0200")

Hello,

Rasmus <rasmus@gmx.us> writes:

> Re the beamer manual 10.1, we could add the following keywords,
> #+short_title, #+short_subtitle, #+short_date , #+institute and
> #+short_institute.

Thank you for your work. 

I didn't test your patch. However, here are some late comments about
this suggestion.

> Maybe we can have a titlegraphics like,
>
> #+attr_beamer: :titlegraphics t
> [[file:link.pdf]]

I think

  #+TITLEGRAPHICS: [[file:link.pdf]]

would be cleaner.

>       ;; Otherwise, use `latex' back-end.
> -     (t (org-export-with-backend 'latex link contents info)))))
> +     (t (cond ((and (org-export-inline-image-p link)
> +		    (plist-get (org-export-read-attribute
> +				:attr_beamer (org-export-get-parent-element link))
> +			       :titlegraphic))
> +	       "")
> +	      (t (org-export-with-backend 'latex link contents info)))))))

The last `cond' could be merged with the one above. It looks like
there's unnecessary branching here.

Anyway, it probably should not be included per suggestion above.
>  
>  ;;;; Plain List
> @@ -855,21 +866,65 @@ holding export options."
>         (when (integerp sec-num)
>  	 (format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
>       ;; Author.
> -     (let ((author (and (plist-get info :with-author)
> -			(let ((auth (plist-get info :author)))
> -			  (and auth (org-export-data auth info)))))
> -	   (email (and (plist-get info :with-email)
> -		       (org-export-data (plist-get info :email) info))))
> +     (let* ((author (and (plist-get info :with-author)
> +			 (let ((auth (plist-get info :author)))
> +			   (and auth (org-export-data auth info)))))
> +	    (short-author (and author (plist-get info :short-author)))

Since "short-author" is `parsed', this should be wrapped within
`org-export-data' somehow. You do it below, but it introduces some code
duplication.

> +	    (email (and (plist-get info :with-email)
> +			(org-export-data (plist-get info :email) info)))
> +	    )

You left a dangling parenthesis.

>         (cond ((and author email (not (string= "" email)))
> -	      (format "\\author{%s\\thanks{%s}}\n" author email))
> -	     ((or author email) (format "\\author{%s}\n" (or author email)))))
> +	      (format "\\author%s{%s\\thanks{%s}}\n"
> +		      (if short-author
> +			  (format "[%s]" (org-export-data short-author info)) "")
> +		      author email))
> +	     ((or author email) (format "\\author%s{%s}\n"
> +					(if short-author
> +					    (format "[%s]" (org-export-data short-author info)) "")
> +					(or author email)))))

See above. Also, I would move the (format ...) below (or author email)

>       ;; Date.
> -     (let ((date (and (plist-get info :with-date) (org-export-get-date info))))
> -       (format "\\date{%s}\n" (org-export-data date info)))
> -     ;; Title
> -     (format "\\title{%s}\n" title)
> +     (let* ((date (and (plist-get info :with-date) (org-export-get-date info)))
> +	    ;; TODO: add optional argument of ‘org-export-get-date’.
> +	    (short-date (and date (org-export-data
> +				   (org-export-get-date
> +				    (plist-put info :date
> +					       (plist-get info :beamer-short-date)))
> +				   info))))
> +       (format "\\date%s{%s}\n" (if (org-string-nw-p short-date)
> +				    (format "[%s]" short-date) "")

I would put the "" below (format "[%s]" short-date): it doesn't make
clear there is an else branch otherwise.

> +	       (org-export-data date info)))
> +     ;; Title.
> +     (let ((short-title (and title
> +			     (plist-get info :beamer-short-title))))
> +       (format "\\title%s{%s}\n"
> +	       (if short-title (format "[%s]" (org-export-data short-title info)) "")
> +	       title))

See above.

> +     ;; Titlegraphics.
> +     (let ((titlegraphic-link
> +	    (org-element-map (plist-get info :parse-tree) 'link
> +	      (lambda (link)
> +		(when (and (org-export-inline-image-p link)
> +			   (plist-get (org-export-read-attribute
> +				       :attr_beamer (org-export-get-parent-element link))
> +				      :titlegraphic))
> +		  link))
> +	      info t)))

See above.

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2016-06-14 12:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30  8:38 Some LaTeX Beamer / org-mode questions Florian Lindner
2016-05-30  9:06 ` Rainer M Krug
2016-05-30  9:19 ` Rasmus
2016-05-30 11:33   ` Florian Lindner
2016-05-30 11:53     ` Rasmus
2016-06-01  8:44       ` Florian Lindner
2016-06-01 10:26         ` Rasmus
2016-06-02  8:37           ` Florian Lindner
2016-06-02  9:49             ` Rasmus
2016-06-14 12:43               ` Nicolas Goaziou [this message]
2016-09-21 11:21                 ` [patch] more Beamer properties Rasmus
2016-09-21 20:49                   ` Nicolas Goaziou
2016-09-22  8:42                     ` Rasmus
2016-09-22 22:51                       ` Nicolas Goaziou

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

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

  git send-email \
    --in-reply-to=87fusg0wlm.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.