From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: latex (beamer) export and short title Date: Fri, 06 Jul 2012 23:00:45 +0200 Message-ID: <87hatkbo5e.fsf@med.uni-goettingen.de> References: <87d34dc8nz.fsf@med.uni-goettingen.de> <87ipe11fq5.fsf@altern.org> <80liixuvvr.fsf@somewhere.org> <87txxlay20.fsf@med.uni-goettingen.de> <87bojtq8vv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SnFfJ-0006yG-JN for emacs-orgmode@gnu.org; Fri, 06 Jul 2012 17:02:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SnFfH-0006VM-L4 for emacs-orgmode@gnu.org; Fri, 06 Jul 2012 17:02:13 -0400 Received: from plane.gmane.org ([80.91.229.3]:55214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SnFfH-0006V5-EL for emacs-orgmode@gnu.org; Fri, 06 Jul 2012 17:02:11 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SnFfD-0001Th-Dh for emacs-orgmode@gnu.org; Fri, 06 Jul 2012 23:02:07 +0200 Received: from vpn-2008.gwdg.de ([134.76.2.8]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Jul 2012 23:02:07 +0200 Received: from andreas.leha by vpn-2008.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Jul 2012 23:02:07 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Nicolas, Nicolas Goaziou writes: > Hello, > > Andreas Leha writes: > >> I'd be a regular user of such functionality, especially for >> presentations. But as the concept is useful in other (LaTeX-) >> documents, a more general support for short titles might be appropriate, >> I'd say. > > It is as simple as using a filter to remove the title provided by the > template and install your own. > > #+begin_src emacs-lisp > (defun ngz-enforce-my-title (contents backend info) > ;; In LaTeX export, if I defined a title with a short title, remove > ;; default title command provided by template, if any. > (if (or (not (eq backend 'e-latex)) > (not (string-match "^\\\\title\\[.*\\]{.*}$" contents)) > (not (string-match "^\\\\title{.*}\n" contents))) > contents > (replace-match "" nil nil contents))) > > (add-to-list 'org-export-filter-final-output-functions 'ngz-enforce-my-title) > #+end_src > > Now you can use the following Org setup: > > #+begin_src org > #+TITLE: Long Title > #+LATEX_HEADER: \title[short title]{long title} > #+end_src > thanks a lot for this, both the reminder that filters can do this and the provided function. For sure, it works, and I'll be a happy user of this. In general: If org-mode exports 'A' which I'd rather like to be 'B', then I can convert 'A' to 'B' after the export (e.g. via a filter). It would be easier if it was 'B' right away. The support for short titles in LaTeX export might be a general enough concept to be supported right away. I guess, at least a few people will add the identical snippet from above to their .emacs right now... So, why not have the above filter included and active by default? But don't take this too seriously. For me the own filter solution works great. I already have a filter, that strips the #+XXX keywords from the export, where I can easily add another filter function. And the general need for short titles has been surprisingly low, apparently. So, thanks again, Andreas