emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* latex (beamer) export and short title
@ 2012-07-03 12:48 Andreas Leha
  2012-07-06  8:00 ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Leha @ 2012-07-03 12:48 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I am having trouble to find a way to set a short title for the exported
beamer document.


Illustration:

I'd like to see
,----
| \title[short title]{long title}
`----
in the exported latex document.


The first shot
,----
|  #+TITLE: [short title]{long title}
`----
was too easy, I guess.


Overriding org's setting of \title with
,----
| #+TITLE:       long title
| #+latex_header: \title[short title]{long title}
`----
does not work either, as org's setting gets into the tex later.


What is the way to accomplish this?

Regards,
Andreas

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

* Re: latex (beamer) export and short title
  2012-07-03 12:48 latex (beamer) export and short title Andreas Leha
@ 2012-07-06  8:00 ` Bastien
  2012-07-06  8:38   ` Sebastien Vauban
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2012-07-06  8:00 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

Hi Andreas,

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Overriding org's setting of \title with
> ,----
> | #+TITLE:       long title
> | #+latex_header: \title[short title]{long title}
> `----
> does not work either, as org's setting gets into the tex later.

There is no way to do this right now.

From what I've seen, \title[shorttitle]{title} is a beamerism, right?

If so, we may hack something in the next Beamer export library without
changing the LaTeX export library.

-- 
 Bastien

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

* Re: latex (beamer) export and short title
  2012-07-06  8:00 ` Bastien
@ 2012-07-06  8:38   ` Sebastien Vauban
  2012-07-06  8:57     ` Bastien
  2012-07-06 12:12     ` Andreas Leha
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastien Vauban @ 2012-07-06  8:38 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien,

Bastien wrote:
> Andreas Leha <andreas.leha-A1rZ2h3LdSKGMSlLMZIubhS11BummzK+@public.gmane.org> writes:
>
>> Overriding org's setting of \title with
>> ,----
>> | #+TITLE:       long title
>> | #+latex_header: \title[short title]{long title}
>> `----
>> does not work either, as org's setting gets into the tex later.
>
> There is no way to do this right now.
>
> From what I've seen, \title[shorttitle]{title} is a beamerism, right?

I have the impression that it's as well for other LaTeX classes, such as
article, report and book.

At least, it's so for ASMart: see
http://tex.stackexchange.com/questions/44510/title-too-long-when-using-amsart.

> If so, we may hack something in the next Beamer export library without
> changing the LaTeX export library.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: latex (beamer) export and short title
  2012-07-06  8:38   ` Sebastien Vauban
@ 2012-07-06  8:57     ` Bastien
  2012-07-06 12:12     ` Andreas Leha
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2012-07-06  8:57 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Sébastien,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> I have the impression that it's as well for other LaTeX classes, such as
> article, report and book.

Can you send me a minimal .tex where \title[shorttitle]{title} works?

With the package you need for that?

It does not work on my machine.

-- 
 Bastien

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

* Re: latex (beamer) export and short title
  2012-07-06  8:38   ` Sebastien Vauban
  2012-07-06  8:57     ` Bastien
@ 2012-07-06 12:12     ` Andreas Leha
  2012-07-06 14:09       ` Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Leha @ 2012-07-06 12:12 UTC (permalink / raw)
  To: emacs-orgmode

Hi Bastien and Sebastien,

thanks for taking this further!

"Sebastien Vauban"
<wxhgmqzgwmuf@spammotel.com> writes:

> Hi Bastien,
>
> Bastien wrote:
>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>
>>> Overriding org's setting of \title with
>>> ,----
>>> | #+TITLE:       long title
>>> | #+latex_header: \title[short title]{long title}
>>> `----
>>> does not work either, as org's setting gets into the tex later.
>>
>> There is no way to do this right now.
>>
>> From what I've seen, \title[shorttitle]{title} is a beamerism, right?

The reason for me asking was indeed a beamer presentation.

>
> I have the impression that it's as well for other LaTeX classes, such as
> article, report and book.
>
> At least, it's so for ASMart: see
> http://tex.stackexchange.com/questions/44510/title-too-long-when-using-amsart.
>

Thanks for looking this up.  The short title for footlines is something
that I have used occasionally as well.

>> If so, we may hack something in the next Beamer export library without
>> changing the LaTeX export library.

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.


Regards,
Andreas

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

* Re: latex (beamer) export and short title
  2012-07-06 12:12     ` Andreas Leha
@ 2012-07-06 14:09       ` Nicolas Goaziou
  2012-07-06 19:24         ` Bastien
  2012-07-06 21:00         ` Andreas Leha
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2012-07-06 14:09 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

Hello,

Andreas Leha <andreas.leha@med.uni-goettingen.de> 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


Regards,

-- 
Nicolas Goaziou

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

* Re: latex (beamer) export and short title
  2012-07-06 14:09       ` Nicolas Goaziou
@ 2012-07-06 19:24         ` Bastien
  2012-07-06 21:00         ` Andreas Leha
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2012-07-06 19:24 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Andreas Leha, emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> 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

Argh...  this is why I love the new org-export.el !!  :)

-- 
 Bastien

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

* Re: latex (beamer) export and short title
  2012-07-06 14:09       ` Nicolas Goaziou
  2012-07-06 19:24         ` Bastien
@ 2012-07-06 21:00         ` Andreas Leha
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Leha @ 2012-07-06 21:00 UTC (permalink / raw)
  To: emacs-orgmode

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Andreas Leha <andreas.leha@med.uni-goettingen.de> 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

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

end of thread, other threads:[~2012-07-06 21:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-03 12:48 latex (beamer) export and short title Andreas Leha
2012-07-06  8:00 ` Bastien
2012-07-06  8:38   ` Sebastien Vauban
2012-07-06  8:57     ` Bastien
2012-07-06 12:12     ` Andreas Leha
2012-07-06 14:09       ` Nicolas Goaziou
2012-07-06 19:24         ` Bastien
2012-07-06 21:00         ` Andreas Leha

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