From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Some LaTeX Beamer / org-mode questions Date: Thu, 02 Jun 2016 11:49:03 +0200 Message-ID: <87eg8fq5tc.fsf@gmx.us> References: <20160530103806.30cbddd9@asaru> <87fuszuclj.fsf@gmx.us> <20160530133335.45ad8693@asaru> <8737ozu5gv.fsf@gmx.us> <20160601104419.0a52f45e@asaru> <874m9dryrk.fsf@gmx.us> <20160602103705.298b0726@asaru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8PFl-0001we-Ad for emacs-orgmode@gnu.org; Thu, 02 Jun 2016 05:49:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8PFh-0006kX-4I for emacs-orgmode@gnu.org; Thu, 02 Jun 2016 05:49:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:42269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8PFg-0006kQ-Oy for emacs-orgmode@gnu.org; Thu, 02 Jun 2016 05:49:21 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b8PFf-0006MN-5t for emacs-orgmode@gnu.org; Thu, 02 Jun 2016 11:49:19 +0200 Received: from ip-178-203-233-70.hsi10.unitymediagroup.de ([178.203.233.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2016 11:49:19 +0200 Received: from rasmus by ip-178-203-233-70.hsi10.unitymediagroup.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2016 11:49:19 +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" To: emacs-orgmode@gnu.org Cc: mail@nicolasgoaziou.fr --=-=-= Content-Type: text/plain Florian Lindner writes: > On Wed, 01 Jun 2016 12:26:07 +0200 > Rasmus wrote: > >> Florian Lindner writes: >> >> > On Mon, 30 May 2016 13:53:52 +0200 >> > Rasmus wrote: >> > >> >> Hi, >> >> >> >> Florian Lindner 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? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-beamer-Remove-customizable-subtitle.patch >From bb8621ce40a14d9ada2b6cb5629568533298f285 Mon Sep 17 00:00:00 2001 From: Rasmus 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")) - ;;; 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 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0002-ox-beamer-Add-short-titlepage-properties.patch Content-Transfer-Encoding: 8bit >From b7792069f1c2f7c86bc8767d9e26b4f7345c2685 Mon Sep 17 00:00:00 2001 From: Rasmus 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 --=-=-=--