emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Some LaTeX Beamer / org-mode questions
@ 2016-05-30  8:38 Florian Lindner
  2016-05-30  9:06 ` Rainer M Krug
  2016-05-30  9:19 ` Rasmus
  0 siblings, 2 replies; 14+ messages in thread
From: Florian Lindner @ 2016-05-30  8:38 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm working on my first presentation using org mode together with latex
beamer (until now, I produce the slide using beamer only).

The top of my org file looks like that:

#+startup: beamer
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Boadilla
#+LATEX_HEADER: \author[me]{\underline{me}, co1, co2}
#+LATEX_HEADER: \title[short title]{multi line long title}
#+LATEX_HEADER: \subtitle{subtitle}
#+LATEX_HEADER: \institute[short institute]{multi line long institute}

This works so far, except the title. Since I do not set a title using
#+TITLE, org-mode sets a default \title{presentation}. How can I omit that?

Is there a more elegant way to achieve the settings like above? Especially

- The short and version of title, author and institute.
- The multi line (\\) formatting
- The subtitle

Thanks!

Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  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
  1 sibling, 0 replies; 14+ messages in thread
From: Rainer M Krug @ 2016-05-30  9:06 UTC (permalink / raw)
  To: Florian Lindner; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

Florian Lindner <mailinglists@xgm.de> writes:

> Hello,
>
> I'm working on my first presentation using org mode together with latex
> beamer (until now, I produce the slide using beamer only).

Same as me - beamer in org is really niche when you get the hang of it
(still not completely there).

>
> The top of my org file looks like that:
>
> #+startup: beamer
> #+LATEX_CLASS: beamer
>
> #+LATEX_CLASS_OPTIONS: [presentation]
> #+BEAMER_THEME: Boadilla
> #+LATEX_HEADER: \author[me]{\underline{me}, co1, co2}
> #+LATEX_HEADER: \title[short title]{multi line long title}
> #+LATEX_HEADER: \subtitle{subtitle}
> #+LATEX_HEADER: \institute[short institute]{multi line long institute}

You could use
#+BEAMER_HEADER: instead of #+LATEX_HEADER: - makes it clearer and is
only inserted when exporting to beamer.

>
> This works so far, except the title. Since I do not set a title using
> #+TITLE, org-mode sets a default \title{presentation}. How can I omit that?
>
> Is there a more elegant way to achieve the settings like above? Especially
>
> - The short and version of title, author and institute.
> - The multi line (\\) formatting
> - The subtitle

Don't know - but wopuld really like to know as well.

Rainer

>
> Thanks!
>
> Florian
>
>

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  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
  1 sibling, 1 reply; 14+ messages in thread
From: Rasmus @ 2016-05-30  9:19 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Florian Lindner <mailinglists@xgm.de> writes:

> I'm working on my first presentation using org mode together with latex
> beamer (until now, I produce the slide using beamer only).
>
> The top of my org file looks like that:
>
> #+startup: beamer
> #+LATEX_CLASS: beamer
>
> #+LATEX_CLASS_OPTIONS: [presentation]
> #+BEAMER_THEME: Boadilla
> #+LATEX_HEADER: \author[me]{\underline{me}, co1, co2}
> #+LATEX_HEADER: \title[short title]{multi line long title}
> #+LATEX_HEADER: \subtitle{subtitle}
> #+LATEX_HEADER: \institute[short institute]{multi line long institute}
>
> This works so far, except the title. Since I do not set a title using
> #+TITLE, org-mode sets a default \title{presentation}. How can I omit
> that?

#+options: title:nil

> Is there a more elegant way to achieve the settings like above? Especially
>
> - The short and version of title, author and institute.

Don't know.

> - The multi line (\\) formatting

\\ at eol is org syntax for forced line break.

> - The subtitle

#+subtitle:

Hope that helps,
Rasmus

-- 
One thing that is clear: it's all down hill from here 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  2016-05-30  9:19 ` Rasmus
@ 2016-05-30 11:33   ` Florian Lindner
  2016-05-30 11:53     ` Rasmus
  0 siblings, 1 reply; 14+ messages in thread
From: Florian Lindner @ 2016-05-30 11:33 UTC (permalink / raw)
  To: emacs-orgmode



On Mon, 30 May 2016 11:19:52 +0200
Rasmus <rasmus@gmx.us> wrote:

> Hi,
> 
> Florian Lindner <mailinglists@xgm.de> writes:
> 
> > I'm working on my first presentation using org mode together with
> > latex beamer (until now, I produce the slide using beamer only).
> >
> > The top of my org file looks like that:
> >
> > #+startup: beamer
> > #+LATEX_CLASS: beamer
> >
> > #+LATEX_CLASS_OPTIONS: [presentation]
> > #+BEAMER_THEME: Boadilla
> > #+LATEX_HEADER: \author[me]{\underline{me}, co1, co2}
> > #+LATEX_HEADER: \title[short title]{multi line long title}
> > #+LATEX_HEADER: \subtitle{subtitle}
> > #+LATEX_HEADER: \institute[short institute]{multi line long
> > institute}
> >
> > This works so far, except the title. Since I do not set a title
> > using #+TITLE, org-mode sets a default \title{presentation}. How
> > can I omit that?  
> 
> #+options: title:nil

Sorry, can't make it work.
> 
> > Is there a more elegant way to achieve the settings like above?
> > Especially
> >
> > - The short and version of title, author and institute.  
> 
> Don't know.
> 
> > - The multi line (\\) formatting  
> 
> \\ at eol is org syntax for forced line break.
> 
> > - The subtitle  
> 
> #+subtitle:

Neither that works for me

#+startup: beamer
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Boadilla
#+LATEX_HEADER: \author[me]{me and the coauthors}
#+LATEX_HEADER: \title[short title]{long title \\ next line}
#+LATEX_HEADER: \institute[short institute]{long institute}
#+subtitle: subtitle
#+OPTIONS: H:2 toc:t num:t title:nil

The subtitle is ignored and the resulting tex file still contains
\title{presentation}

Thanks,
Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  2016-05-30 11:33   ` Florian Lindner
@ 2016-05-30 11:53     ` Rasmus
  2016-06-01  8:44       ` Florian Lindner
  0 siblings, 1 reply; 14+ messages in thread
From: Rasmus @ 2016-05-30 11:53 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Florian Lindner <mailinglists@xgm.de> writes:

>> #+options: title:nil
>
> Sorry, can't make it work.
>> #+subtitle:
>
> Neither that works for me

Are you sure you are using an up-to-date version of Org?
M-x org-version should return 8.3.something.

Rasmus

-- 
Governments should be afraid of their people

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  2016-05-30 11:53     ` Rasmus
@ 2016-06-01  8:44       ` Florian Lindner
  2016-06-01 10:26         ` Rasmus
  0 siblings, 1 reply; 14+ messages in thread
From: Florian Lindner @ 2016-06-01  8:44 UTC (permalink / raw)
  To: emacs-orgmode



On Mon, 30 May 2016 13:53:52 +0200
Rasmus <rasmus@gmx.us> wrote:

> Hi,
> 
> Florian Lindner <mailinglists@xgm.de> writes:
> 
> >> #+options: title:nil  
> >
> > Sorry, can't make it work.  
> >> #+subtitle:  
> >
> > Neither that works for me  
> 
> Are you sure you are using an up-to-date version of Org?
> M-x org-version should return 8.3.something.

Ah, you were right. I used the builtin org version.

It works now, however, when I set the title:nil is does not produce a
title page at all.

#+BEGIN_LATEX
\maketitle
#+END_LATEX

inserts a title page, but after the table of contents.

Any way to work around that?

Best,
Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  2016-06-01  8:44       ` Florian Lindner
@ 2016-06-01 10:26         ` Rasmus
  2016-06-02  8:37           ` Florian Lindner
  0 siblings, 1 reply; 14+ messages in thread
From: Rasmus @ 2016-06-01 10:26 UTC (permalink / raw)
  To: emacs-orgmode

Florian Lindner <mailinglists@xgm.de> writes:

> On Mon, 30 May 2016 13:53:52 +0200
> Rasmus <rasmus@gmx.us> wrote:
>
>> Hi,
>> 
>> Florian Lindner <mailinglists@xgm.de> writes:
>> 
>> >> #+options: title:nil  
>> >
>> > Sorry, can't make it work.  
>> >> #+subtitle:  
>> >
>> > Neither that works for me  
>> 
>> Are you sure you are using an up-to-date version of Org?
>> M-x org-version should return 8.3.something.
>
> Ah, you were right. I used the builtin org version.
>
> It works now, however, when I set the title:nil is does not produce a
> title page at all.
>
> #+BEGIN_LATEX
> \maketitle
> #+END_LATEX

Or:

@@latex:\maketitle@@.

What exactly are you missing from the standard title page support of Org?

> inserts a title page, but after the table of contents.
>
> Any way to work around that?

Yes, the #+TOC keyword combined with the option toc:nil.

     http://orgmode.org/org.html#Table-of-contents

Rasmus

-- 
Dobbelt-A

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  2016-06-01 10:26         ` Rasmus
@ 2016-06-02  8:37           ` Florian Lindner
  2016-06-02  9:49             ` Rasmus
  0 siblings, 1 reply; 14+ messages in thread
From: Florian Lindner @ 2016-06-02  8:37 UTC (permalink / raw)
  To: emacs-orgmode



On Wed, 01 Jun 2016 12:26:07 +0200
Rasmus <rasmus@gmx.us> wrote:

> Florian Lindner <mailinglists@xgm.de> writes:
> 
> > On Mon, 30 May 2016 13:53:52 +0200
> > Rasmus <rasmus@gmx.us> wrote:
> >  
> >> Hi,
> >> 
> >> Florian Lindner <mailinglists@xgm.de> writes:
> >>   
> >> >> #+options: title:nil    
> >> >
> >> > Sorry, can't make it work.    
> >> >> #+subtitle:    
> >> >
> >> > Neither that works for me    
> >> 
> >> Are you sure you are using an up-to-date version of Org?
> >> M-x org-version should return 8.3.something.  
> >
> > Ah, you were right. I used the builtin org version.
> >
> > It works now, however, when I set the title:nil is does not produce
> > a title page at all.
> >
> > #+BEGIN_LATEX
> > \maketitle
> > #+END_LATEX  
> 
> Or:
> 
> @@latex:\maketitle@@.
> 
> What exactly are you missing from the standard title page support of
> Org?

Nothing really, but when I use title:t, org mode sets a
\title{presentation} in the tex file which overwrites my own title. If
I set title:nil, it sets \title{} still overwriting my own title.

> > inserts a title page, but after the table of contents.
> >
> > Any way to work around that?  
> 
> Yes, the #+TOC keyword combined with the option toc:nil.

Ah, ok, I think I got using these settings now:

#+startup: beamer
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Boadilla
#+OPTIONS: H:2 num:t title:nil toc:nil

#+BEGIN_LATEX
\author[me]{me and the coauthors}
\title[short title]{long title \\ next line}
\subtitle{subtitle}
\institute[short institute]{long institute}
\maketitle
#+END_LATEX


As I said, all I want is to have a standard title page followed by a
toc, but I need to set also the short version of title, institute and
author.

Well it works, albeit not very elegant.

Best,
Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  2016-06-02  8:37           ` Florian Lindner
@ 2016-06-02  9:49             ` Rasmus
  2016-06-14 12:43               ` Nicolas Goaziou
  0 siblings, 1 reply; 14+ messages in thread
From: Rasmus @ 2016-06-02  9:49 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: mail

[-- Attachment #1: Type: text/plain, Size: 2085 bytes --]

Florian Lindner <mailinglists@xgm.de> writes:

> On Wed, 01 Jun 2016 12:26:07 +0200
> Rasmus <rasmus@gmx.us> wrote:
>
>> Florian Lindner <mailinglists@xgm.de> writes:
>> 
>> > On Mon, 30 May 2016 13:53:52 +0200
>> > Rasmus <rasmus@gmx.us> wrote:
>> >  
>> >> Hi,
>> >> 
>> >> Florian Lindner <mailinglists@xgm.de> writes:
>> >>   
>> >> >> #+options: title:nil    
>> >> >
>> >> > Sorry, can't make it work.    
>> >> >> #+subtitle:    
>> >> >
>> >> > Neither that works for me    
>> >> 
>> >> Are you sure you are using an up-to-date version of Org?
>> >> M-x org-version should return 8.3.something.  
>> >
>> > Ah, you were right. I used the builtin org version.
>> >
>> > It works now, however, when I set the title:nil is does not produce
>> > a title page at all.
>> >
>> > #+BEGIN_LATEX
>> > \maketitle
>> > #+END_LATEX  
>> 
>> Or:
>> 
>> @@latex:\maketitle@@.
>> 
>> What exactly are you missing from the standard title page support of
>> Org?
>
> Nothing really, but when I use title:t, org mode sets a
> \title{presentation} in the tex file which overwrites my own title. If
> I set title:nil, it sets \title{} still overwriting my own title.
>
>> > inserts a title page, but after the table of contents.
>> >
>> > Any way to work around that?  
>> 
>> Yes, the #+TOC keyword combined with the option toc:nil.
>
> Ah, ok, I think I got using these settings now:
>
> #+startup: beamer
> #+LATEX_CLASS: beamer
>
> #+LATEX_CLASS_OPTIONS: [presentation]
> #+BEAMER_THEME: Boadilla
>
> #+OPTIONS: H:2 num:t title:nil toc:nil
>
> #+BEGIN_LATEX
> \author[me]{me and the coauthors}
> \title[short title]{long title \\ next line}
> \subtitle{subtitle}
> \institute[short institute]{long institute}
> \maketitle
> #+END_LATEX

I see.

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

Maybe we can have a titlegraphics like,

#+attr_beamer: :titlegraphics t
[[file:link.pdf]]

I've attached some rough patches that does this.  Maybe you can test them?

Rasmus

-- 
What will be next?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-beamer-Remove-customizable-subtitle.patch --]
[-- Type: text/x-diff, Size: 1447 bytes --]

From bb8621ce40a14d9ada2b6cb5629568533298f285 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Thu, 2 Jun 2016 11:44:56 +0200
Subject: [PATCH 1/2] ox-beamer: Remove customizable subtitle

* lisp/ox-beamer.el (org-beamer-subtitle-format): Removed.
---
 lisp/ox-beamer.el | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 4505e2c..4ac91d0 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -134,16 +134,6 @@ You might want to put e.g. \"allowframebreaks=0.9\" here."
   :group 'org-export-beamer
   :type '(string :tag "Outline frame options"))
 
-
-(defcustom org-beamer-subtitle-format "\\subtitle{%s}"
-  "Format string used for transcoded subtitle.
-The format string should have at most one \"%s\"-expression,
-which is replaced with the subtitle."
-  :group 'org-export-beamer
-  :version "25.1"
-  :package-version '(Org . "8.3")
-  :type '(string :tag "Format string"))
-
 \f
 ;;; Internal Variables
 
@@ -243,7 +233,6 @@ Return overlay specification, as a string, or nil."
   :options-alist
   '((:headline-levels nil "H" org-beamer-frame-level)
     (:latex-class "LATEX_CLASS" nil "beamer" t)
-    (:beamer-subtitle-format nil nil org-beamer-subtitle-format)
     (:beamer-column-view-format "COLUMNS" nil org-beamer-column-view-format)
     (:beamer-theme "BEAMER_THEME" nil org-beamer-theme)
     (:beamer-color-theme "BEAMER_COLOR_THEME" nil nil t)
-- 
2.8.3


[-- Attachment #3: 0002-ox-beamer-Add-short-titlepage-properties.patch --]
[-- Type: text/x-diff, Size: 5305 bytes --]

From b7792069f1c2f7c86bc8767d9e26b4f7345c2685 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Thu, 2 Jun 2016 11:45:49 +0200
Subject: [PATCH 2/2] ox-beamer: Add short titlepage properties

* lisp/ox-beamer.el: Add #+short_{title,subtitle,author,date,institute}
  and #+institute and the :titlegraphic option.
---
 lisp/ox-beamer.el | 81 ++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 68 insertions(+), 13 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 4ac91d0..ce19d4d 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -240,6 +240,12 @@ Return overlay specification, as a string, or nil."
     (:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t)
     (:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t)
     (:beamer-header "BEAMER_HEADER" nil nil newline)
+    (:beamer-short-title "SHORT_TITLE" nil nil parse)
+    (:beamer-short-subtitle "SHORT_SUBTITLE" nil nil parse)
+    (:beamer-short-author "SHORT_AUTHOR" nil nil parse)
+    (:beamer-short-date "SHORT_DATE" nil nil parse)
+    (:beamer-institute "INSTITUTE" nil nil parse)
+    (:beamer-short-institute "SHORT_INSTITUTE" nil nil parse)
     (:beamer-environments-extra nil nil org-beamer-environments-extra)
     (:beamer-frame-default-options nil nil org-beamer-frame-default-options)
     (:beamer-outline-frame-options nil nil org-beamer-outline-frame-options)
@@ -751,7 +757,12 @@ used as a communication channel."
 			    ref
 			    contents))))))))
      ;; 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)))))))
 
 
 ;;;; 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)))
+	    (email (and (plist-get info :with-email)
+			(org-export-data (plist-get info :email) info)))
+	    )
        (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)))))
      ;; 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) "")
+	       (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))
+     ;; Subtitle.
      (when (org-string-nw-p subtitle)
-       (concat (format (plist-get info :beamer-subtitle-format) subtitle) "\n"))
+       (let ((short-subtitle (plist-get info :beamer-short-subtitle)))
+	 (format "\\subtitle%s{%s}\n"
+		 (if short-subtitle (format "[%s]" (org-export-data short-subtitle info)) "")
+		 subtitle)))
+     ;; Institute.
+     (let ((institute (plist-get info :beamer-institute))
+	   (short-institute (plist-get info :beamer-short-institute)))
+       (when institute
+	 (format "\\institute%s{%s}\n"
+		 (if short-institute (format "[%s]" (org-export-data short-institute info)) "")
+		 (org-export-data institute info))))
+     ;; 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)))
+       (when titlegraphic-link
+	 (format "\\titlegraphic{%s}\n"
+		 (org-trim (org-latex--inline-image titlegraphic-link info)))))
      ;; Beamer-header
      (let ((beamer-header (plist-get info :beamer-header)))
        (when beamer-header
-- 
2.8.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Some LaTeX Beamer / org-mode questions
  2016-06-02  9:49             ` Rasmus
@ 2016-06-14 12:43               ` Nicolas Goaziou
  2016-09-21 11:21                 ` [patch] more Beamer properties Rasmus
  0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Goaziou @ 2016-06-14 12:43 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [patch] more Beamer properties
  2016-06-14 12:43               ` Nicolas Goaziou
@ 2016-09-21 11:21                 ` Rasmus
  2016-09-21 20:49                   ` Nicolas Goaziou
  0 siblings, 1 reply; 14+ messages in thread
From: Rasmus @ 2016-09-21 11:21 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3971 bytes --]

Hi,

Thanks for the suggestions.

Sorry about the slow reply...  I'm lacking time ATM.

I simplified the patch to only add the short version of properties and not
include the titlegraphics.

> 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.

I dropped this.  One might need to add attributes to the graphic.  The
#+titlegraphics approach wouldn’t allow it.  I think it’s a problem that
can be pushed down the line.

>>  ;;;; 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)))

Should all be fixed.

Thanks,
Rasmus

-- 
Human: An animal that complicates things more than strictly necessary

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-beamer-Remove-customizable-subtitle.patch --]
[-- Type: text/x-diff, Size: 2123 bytes --]

From 56737ea87fd523d2e88b732af110008b993c7310 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Thu, 2 Jun 2016 11:44:56 +0200
Subject: [PATCH 1/2] ox-beamer: Remove customizable subtitle

* lisp/ox-beamer.el (org-beamer-subtitle-format): Remove.
  (:options-alist): Remove :beamer-subtitle-format.
---
 doc/org.texi      |  4 +---
 lisp/ox-beamer.el | 11 -----------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 56779e8..2c9cb64 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -11077,9 +11077,7 @@ can use several @code{#+KEYWORDS} if the description is is long.
 
 @item SUBTITLE
 @cindex #+SUBTITLE (Beamer)
-@vindex org-beamer-subtitle-format
-The document subtitle.  This is typeset using the format string
-@code{org-beamer-subtitle-format}.  It can also access via
+The document subtitle.  It can also access via
 @code{org-latex-hyperref-template} or typeset as part of the front
 matter via @code{org-latex-title-command}.
 @end table
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 2d1d53f..fc17d3e 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -134,16 +134,6 @@ You might want to put e.g. \"allowframebreaks=0.9\" here."
   :group 'org-export-beamer
   :type '(string :tag "Outline frame options"))
 
-
-(defcustom org-beamer-subtitle-format "\\subtitle{%s}"
-  "Format string used for transcoded subtitle.
-The format string should have at most one \"%s\"-expression,
-which is replaced with the subtitle."
-  :group 'org-export-beamer
-  :version "25.1"
-  :package-version '(Org . "8.3")
-  :type '(string :tag "Format string"))
-
 \f
 ;;; Internal Variables
 
@@ -239,7 +229,6 @@ Return overlay specification, as a string, or nil."
   :options-alist
   '((:headline-levels nil "H" org-beamer-frame-level)
     (:latex-class "LATEX_CLASS" nil "beamer" t)
-    (:beamer-subtitle-format nil nil org-beamer-subtitle-format)
     (:beamer-column-view-format "COLUMNS" nil org-beamer-column-view-format)
     (:beamer-theme "BEAMER_THEME" nil org-beamer-theme)
     (:beamer-color-theme "BEAMER_COLOR_THEME" nil nil t)
-- 
2.10.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-ox-beamer-Add-short-title-metainfo-properties.patch --]
[-- Type: text/x-diff, Size: 4470 bytes --]

From 2235d17c0bb4fcb8f5b06c4330a56e2a1732162b Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Thu, 2 Jun 2016 11:45:49 +0200
Subject: [PATCH 2/2] ox-beamer: Add short title metainfo properties

* lisp/ox-beamer.el: (beamer :option-alist): Add :beamer-short-title,
:beamer-short-subtitle, :beamer-short-author, :beamer-short-date,
:beamer-institute, :beamer-short-institute
(org-beamer-template): Use new properties.
---
 lisp/ox-beamer.el | 70 ++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 57 insertions(+), 13 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index fc17d3e..3263d75 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -236,6 +236,12 @@ Return overlay specification, as a string, or nil."
     (:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t)
     (:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t)
     (:beamer-header "BEAMER_HEADER" nil nil newline)
+    (:beamer-short-title "SHORT_TITLE" nil nil parse)
+    (:beamer-short-subtitle "SHORT_SUBTITLE" nil nil parse)
+    (:beamer-short-author "SHORT_AUTHOR" nil nil parse)
+    (:beamer-short-date "SHORT_DATE" nil nil parse)
+    (:beamer-institute "INSTITUTE" nil nil parse)
+    (:beamer-short-institute "SHORT_INSTITUTE" nil nil parse)
     (:beamer-environments-extra nil nil org-beamer-environments-extra)
     (:beamer-frame-default-options nil nil org-beamer-frame-default-options)
     (:beamer-outline-frame-options nil nil org-beamer-outline-frame-options)
@@ -852,21 +858,59 @@ 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))))
-       (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)))))
+     (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
+			       (let ((short-auth (plist-get info :beamer-short-author)))
+				 (if short-auth
+				     (format "[%s]"
+					     (org-export-data short-auth info))
+				   ""))))
+	    (email (and (plist-get info :with-email)
+			(org-string-nw-p
+			 (org-export-data (plist-get info :email) info)))))
+       (cond ((and author email)
+	      (format "\\author%s{%s\\thanks{%s}}\n"
+		      short-author author email))
+	     ((or author email)
+	      (format "\\author%s{%s}\n"
+		      short-author (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)))
+	    (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)
+				  "")
+	       (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))
+     ;; Subtitle.
      (when (org-string-nw-p subtitle)
-       (concat (format (plist-get info :beamer-subtitle-format) subtitle) "\n"))
+       (let ((short-subtitle (plist-get info :beamer-short-subtitle)))
+	 (format "\\subtitle%s{%s}\n"
+		 (if short-subtitle
+		     (format "[%s]" (org-export-data short-subtitle info))
+		   "")
+		 subtitle)))
+     ;; Institute.
+     (let ((institute (plist-get info :beamer-institute))
+	   (short-institute (plist-get info :beamer-short-institute)))
+       (when institute
+	 (format "\\institute%s{%s}\n"
+		 (if short-institute
+		     (format "[%s]" (org-export-data short-institute info))
+		   "")
+		 (org-export-data institute info))))
      ;; Beamer-header
      (let ((beamer-header (plist-get info :beamer-header)))
        (when beamer-header
-- 
2.10.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [patch] more Beamer properties
  2016-09-21 11:21                 ` [patch] more Beamer properties Rasmus
@ 2016-09-21 20:49                   ` Nicolas Goaziou
  2016-09-22  8:42                     ` Rasmus
  0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Goaziou @ 2016-09-21 20:49 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hello,

Rasmus <rasmus@gmx.us> writes:

>> I think
>>
>>   #+TITLEGRAPHICS: [[file:link.pdf]]
>>
>> would be cleaner.
>
> I dropped this.  One might need to add attributes to the graphic.  The
> #+titlegraphics approach wouldn’t allow it.

Well, wouldn't the following work?

  #+attr_beamer: :attribute1 value1 :attribute2 value2
  #+TITLEGRAPHICS: [[file:link.pdf]]

> +    (:beamer-short-title "SHORT_TITLE" nil nil parse)
> +    (:beamer-short-subtitle "SHORT_SUBTITLE" nil nil parse)
> +    (:beamer-short-author "SHORT_AUTHOR" nil nil parse)
> +    (:beamer-short-date "SHORT_DATE" nil nil parse)
> +    (:beamer-institute "INSTITUTE" nil nil parse)
> +    (:beamer-short-institute "SHORT_INSTITUTE" nil nil parse)

Per above, would the following be cleaner?

  #+attr_beamer: :short shortdate
  #+date: longdate

Ditto for title, institute, author...

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [patch] more Beamer properties
  2016-09-21 20:49                   ` Nicolas Goaziou
@ 2016-09-22  8:42                     ` Rasmus
  2016-09-22 22:51                       ` Nicolas Goaziou
  0 siblings, 1 reply; 14+ messages in thread
From: Rasmus @ 2016-09-22  8:42 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

>>> I think
>>>
>>>   #+TITLEGRAPHICS: [[file:link.pdf]]
>>>
>>> would be cleaner.
>>
>> I dropped this.  One might need to add attributes to the graphic.  The
>> #+titlegraphics approach wouldn’t allow it.
>
> Well, wouldn't the following work?
>
>   #+attr_beamer: :attribute1 value1 :attribute2 value2
>
>   #+TITLEGRAPHICS: [[file:link.pdf]]
>
>> +    (:beamer-short-title "SHORT_TITLE" nil nil parse)
>> +    (:beamer-short-subtitle "SHORT_SUBTITLE" nil nil parse)
>> +    (:beamer-short-author "SHORT_AUTHOR" nil nil parse)
>> +    (:beamer-short-date "SHORT_DATE" nil nil parse)
>> +    (:beamer-institute "INSTITUTE" nil nil parse)
>> +    (:beamer-short-institute "SHORT_INSTITUTE" nil nil parse)
>
> Per above, would the following be cleaner?
>
>   #+attr_beamer: :short shortdate
>
>   #+date: longdate
>
> Ditto for title, institute, author...

Looks good, but how do I get the element representation of a parsed
keyword in the :options-alist?

In the buffer, I can do

   (org-export-read-attribute :attr_beamer (org-element-at-point))

But this does not work with what is stored in the info list.

I’m probably missing something obvious here...

Thanks,
Rasmus

-- 
History is what should never happen again

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [patch] more Beamer properties
  2016-09-22  8:42                     ` Rasmus
@ 2016-09-22 22:51                       ` Nicolas Goaziou
  0 siblings, 0 replies; 14+ messages in thread
From: Nicolas Goaziou @ 2016-09-22 22:51 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hello,

Rasmus <rasmus@gmx.us> writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

>> Per above, would the following be cleaner?
>>
>>   #+attr_beamer: :short shortdate
>>
>>   #+date: longdate
>>
>> Ditto for title, institute, author...

> Looks good, but how do I get the element representation of a parsed
> keyword in the :options-alist?
>
> In the buffer, I can do
>
>    (org-export-read-attribute :attr_beamer (org-element-at-point))
>
> But this does not work with what is stored in the info list.

Good point. Let's forget about this suggestion. 

Feel free to push the last iteration of the patch. Please also add
documentation and an entry in ORG-NEWS.

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-09-22 22:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).