emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to suppress \label commands in beamer export
@ 2011-09-01 17:02 Darlan Cavalcante Moreira
  2011-09-02  8:41 ` Eric S Fraga
  0 siblings, 1 reply; 4+ messages in thread
From: Darlan Cavalcante Moreira @ 2011-09-01 17:02 UTC (permalink / raw)
  To: Orgmode Mailing List

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


I'm trying to convert a presentation I've done in beamer to org-mode. I'm
going to improve this presentation and add more stuff to it. I'd like to do
it in org-mode.

However, org adds \label{sec-numbers} in the generated tex file after all
environments and this adds some blank space between the blocks in the final
presentation. I understand this extra blank space is more like a latex
issue, but I couldn't find a way to stop org-mode from creating the \label
lines.

In order to reproduce this, export the attached org file to a beamer
presentation. Notice how Block 1 and Block 2 (as well as Block 3 and
Block 4) have a lot of blank space between them. In fact, this makes Block
2 and Block 4 goes out of the frame.

Now, in the .tex file that org created, erase all the \label lines and
compile the file again. Notice how the blank space between the blocks
changes and now Block 2 and Block 4 fit nicely inside each frame.


Note: I use the overprint environment. The attached file has two lines that
must be executed in order to make overprint work. Maybe this environment
should be added to org-beamer-environments-default.

--
Darlan


[-- Attachment #2: test_org_beamer.org --]
[-- Type: application/octet-stream, Size: 4182 bytes --]

#+TITLE:     This is the title
#+AUTHOR:    Darlan Cavalcante Moreira
#+EMAIL:     darcamo@gmail.com
#+DATE:      \today
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:
#+STARTUP: odd

#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation]
#+BEAMER_FRAME_LEVEL: 2

#+BEAMER_HEADER_EXTRA: \usetheme[nonav,nologo]{Gtel}\usecolortheme{default}
#+LATEX_HEADER: \usepackage{pxfonts} % Font normal
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)
#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC


* This is a section

*** This is frame 1
***** Columns Environment                                                    :B_columns:
      :PROPERTIES:
      :BEAMER_env: columns
      :END:
******* 0.4                                                                   :B_column:
        :PROPERTIES:
        :BEAMER_env: column
        :END:
        A figure could be here
******* 0.6                                                                   :B_column:
        :PROPERTIES:
        :BEAMER_env: column
        :END:
********* Overprint: Block 1 -> Block 3                                    :B_overprint:
          :PROPERTIES:
          :BEAMER_env: overprint
          :END:
*********** 1                                                                :B_onslide:
            :PROPERTIES:
            :BEAMER_env: onslide
            :END:
************* Block 1                                                          :B_block:
              :PROPERTIES:
              :BEAMER_env: block
              :END:
              - Some text
              - More text
                - More text
              - More text
              - More text
*********** 2                                                                :B_onslide:
            :PROPERTIES:
            :BEAMER_env: onslide
            :END:
************* Block 3                                                          :B_block:
              :PROPERTIES:
              :BEAMER_env: block
              :END:
              Some Equation
              #+begin_center
              \(
              y = Ax+b
              \)              
              #+end_center
              - Some text
              - More text
              - And more
********* Overprint: Block 2 -> Block 4                                    :B_overprint:
          :PROPERTIES:
          :BEAMER_env: overprint
          :END:
*********** 1                                                                :B_onslide:
            :PROPERTIES:
            :BEAMER_env: onslide
            :END:
************* Block 2                                                          :B_block:
              :PROPERTIES:
              :BEAMER_env: block
              :END:
              - Some text
              - More text
              - More text
              - More text
*********** 2                                                                :B_onslide:
            :PROPERTIES:
            :BEAMER_env: onslide
            :END:
************* Block 4                                                          :B_block:
              :PROPERTIES:
              :BEAMER_env: block
              :END:
              Another equation
              #+begin_center
              \(
              x = A^{-1}(y-b)
              \)
              #+end_center
              - More text

* Make overprint works                                                        :noexport:

  Just add overprint and onslide to org-beamer-environments-extra as below
  #+begin_src emacs-lisp
    ;; (setq org-beamer-environments-extra nil)
    (add-to-list 'org-beamer-environments-extra '("overprint" "O" "\\begin{overprint}" "\\end{overprint}"))
    (add-to-list 'org-beamer-environments-extra '("onslide" "l" "\\onslide<%h>" ""))
  #+end_src

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





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

* Re: How to suppress \label commands in beamer export
  2011-09-01 17:02 How to suppress \label commands in beamer export Darlan Cavalcante Moreira
@ 2011-09-02  8:41 ` Eric S Fraga
  2011-09-02 12:14   ` Darlan Cavalcante Moreira
  0 siblings, 1 reply; 4+ messages in thread
From: Eric S Fraga @ 2011-09-02  8:41 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: Orgmode Mailing List

Darlan Cavalcante Moreira <darcamo@gmail.com> writes:

> I'm trying to convert a presentation I've done in beamer to org-mode. I'm
> going to improve this presentation and add more stuff to it. I'd like to do
> it in org-mode.
>
> However, org adds \label{sec-numbers} in the generated tex file after all
> environments and this adds some blank space between the blocks in the final
> presentation. I understand this extra blank space is more like a latex
> issue, but I couldn't find a way to stop org-mode from creating the \label
> lines.

Having looked at the code, there definitely does not appear to be any
way to turn these off.  It would be straightforward to modify the code

--8<---------------cut here---------------start------------->8---
(when label
	  (insert (mapconcat (lambda (l) (format "\\label{%s}" l))
			     label-list "\n") "\n"))
--8<---------------cut here---------------end--------------->8---

or, more likely, the code in =org-export-latex-subcontent= which
actually defines =label=? This could be made optional depending on the
num: #+OPTION, say?  But it may not be straightforward because labels
are not only due to sectioning, if I understand the code correctly...

However, the problem with spacing appears to be because of some
interaction between labels and overprint.  I wonder if maybe there is an
easier way (in the meantime) to accomplish what you want without
overprint?  Just curious...

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.238.gc51b7)

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

* Re: How to suppress \label commands in beamer export
  2011-09-02  8:41 ` Eric S Fraga
@ 2011-09-02 12:14   ` Darlan Cavalcante Moreira
  2011-09-02 12:51     ` Eric S Fraga
  0 siblings, 1 reply; 4+ messages in thread
From: Darlan Cavalcante Moreira @ 2011-09-02 12:14 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira, Orgmode Mailing List


Thanks Eric,

The ideal case if if I could disable label creation and labels would be
created only when I specifically write a <<target>>, for instance. But I
understand this is hard coded right now.

If I don't use overlays at all to change the blocks in the right side and
just put them into separates frames, then the figure in the left (when I
put one there) will slight change its vertical position. This is annoying
and it is the reason why overprint is used.

I'll try to use overlayarea instead. The overlayarea environment requires
two arguments, the width and the height of the area. Overprint is just a
more user friendly way to use overlayarea where the width is "all space
available" and the height is automatically determined as the height of the
largest thing inside the overlayarea.

Since overlayarea requires two arguments, like
--8<---------------cut here---------------start------------->8---
\begin{overlayarea}{width}{height}
\only<1> {lalala}
\only<2> {lelele}
\end{overlayarea}
--8<---------------cut here---------------end--------------->8---
is there a suggested way to map oberlayarea into
org-beamer-environments-extra? The only way I can think is to require the
user to type "{width}{height}" in the headline (with the curly brackets)
and use somethink like "\\begin{overprint}%h" in the template definition.

--
Darlan


At Fri, 02 Sep 2011 09:41:32 +0100,
Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
> 
> Darlan Cavalcante Moreira <darcamo@gmail.com> writes:
> 
> > I'm trying to convert a presentation I've done in beamer to org-mode. I'm
> > going to improve this presentation and add more stuff to it. I'd like to do
> > it in org-mode.
> >
> > However, org adds \label{sec-numbers} in the generated tex file after all
> > environments and this adds some blank space between the blocks in the final
> > presentation. I understand this extra blank space is more like a latex
> > issue, but I couldn't find a way to stop org-mode from creating the \label
> > lines.
> 
> Having looked at the code, there definitely does not appear to be any
> way to turn these off.  It would be straightforward to modify the code
> 
> --8<---------------cut here---------------start------------->8---
> (when label
> 	  (insert (mapconcat (lambda (l) (format "\\label{%s}" l))
> 			     label-list "\n") "\n"))
> --8<---------------cut here---------------end--------------->8---
> 
> or, more likely, the code in =org-export-latex-subcontent= which
> actually defines =label=? This could be made optional depending on the
> num: #+OPTION, say?  But it may not be straightforward because labels
> are not only due to sectioning, if I understand the code correctly...
> 
> However, the problem with spacing appears to be because of some
> interaction between labels and overprint.  I wonder if maybe there is an
> easier way (in the meantime) to accomplish what you want without
> overprint?  Just curious...
> 
> -- 
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
> : using Org-mode version 7.7 (release_7.7.238.gc51b7)

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

* Re: How to suppress \label commands in beamer export
  2011-09-02 12:14   ` Darlan Cavalcante Moreira
@ 2011-09-02 12:51     ` Eric S Fraga
  0 siblings, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2011-09-02 12:51 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: Orgmode Mailing List

Darlan Cavalcante Moreira <darcamo@gmail.com> writes:

> Thanks Eric,
>
> The ideal case if if I could disable label creation and labels would be
> created only when I specifically write a <<target>>, for instance. But I
> understand this is hard coded right now.

Yes but it should be fairly easy to change (for somebody with a better
understanding of the code than I ;-). 

> If I don't use overlays at all to change the blocks in the right side and
> just put them into separates frames, then the figure in the left (when I
> put one there) will slight change its vertical position. This is annoying
> and it is the reason why overprint is used.

The way I get around this type of problem is to [t] align the columns.
For some cases, this might not be ideal (e.g. if the figure on the left
is small in a vertical sense) but it is often more than "good enough"
(TM).

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.239.gd856)

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

end of thread, other threads:[~2011-09-02 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-01 17:02 How to suppress \label commands in beamer export Darlan Cavalcante Moreira
2011-09-02  8:41 ` Eric S Fraga
2011-09-02 12:14   ` Darlan Cavalcante Moreira
2011-09-02 12:51     ` Eric S Fraga

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