emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* questions about exporting to latex using beamer documentclass
@ 2009-07-04 23:31 ` Spike Spiegel
  2009-07-05  1:34   ` Nick Dokos
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Spike Spiegel @ 2009-07-04 23:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I have the following in my .emacs:

(add-to-list 'org-export-latex-classes
             '("beamer"
               "\\documentclass[11pt]{beamer}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{hyperref}
\\usepackage{verbatim}
\\usetheme{Singapore}
\\usecolortheme{dove}"
               ("\\begin{frame}{%s}"
                "\\end{frame}"
                "\\begin{frame}{%s}"
                "\\end{frame}")))


and I'm having a hard time to figure out the solution to the following problems:
- there are no "section/subsection" tex commands added before the
frame one and I don't see how to add it in there since a section and
subsection can be in the same frame
- I'm in the situation that I need to pass options to an image
(\includegraphics) in a frame's title (frames are beamer's idea of
slide). Based on the docs it seems I should be doing something like
"#+ATTR_LaTeX: width=5cm,angle=90" but I can't put that within a
headline before the image and it won't work if I put it before it
because it'll end up outside of the frame
- I also need to include an image in the titlepage but I don't see any
way to override \maketitle other than maybe renewcommand'ing it, which
I tried with #+LaTeX_HEADER, but kept getting errors, altho that might
have been me. While poking around I noticed
org-export-latex-title-command in org-latex.el but I'm unsure how I'd
use that to achieve my goal.

On a side note, a little feature request: would it be possible to
produce an indented tex file? post editing is otherwise quite painful

thanks

-- 
"Behind every great man there's a great backpack" - B.

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-04 23:31 ` questions about exporting to latex using beamer documentclass Spike Spiegel
@ 2009-07-05  1:34   ` Nick Dokos
  2009-07-05  3:40   ` Nick Dokos
  2009-07-05 21:25   ` Russell Adams
  2 siblings, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2009-07-05  1:34 UTC (permalink / raw)
  To: Spike Spiegel; +Cc: emacs-orgmode

Spike Spiegel <fsmlab@gmail.com> wrote:

> ...
>
> On a side note, a little feature request: would it be possible to
> produce an indented tex file? post editing is otherwise quite painful
> 

Try
         C-x h C-M-\ 

or equivalently

        M-x mark-whole-buffer
        M-x indent-region

when editing the TeX file.

HTH,
Nick

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-04 23:31 ` questions about exporting to latex using beamer documentclass Spike Spiegel
  2009-07-05  1:34   ` Nick Dokos
@ 2009-07-05  3:40   ` Nick Dokos
  2009-07-05 11:52     ` Spike Spiegel
  2009-07-05 21:25   ` Russell Adams
  2 siblings, 1 reply; 9+ messages in thread
From: Nick Dokos @ 2009-07-05  3:40 UTC (permalink / raw)
  To: Spike Spiegel; +Cc: emacs-orgmode

Spike Spiegel <fsmlab@gmail.com> wrote:

> ...
> - I also need to include an image in the titlepage but I don't see any
> way to override \maketitle other than maybe renewcommand'ing it, which
> I tried with #+LaTeX_HEADER, but kept getting errors, altho that might
> have been me. While poking around I noticed
> org-export-latex-title-command in org-latex.el but I'm unsure how I'd
> use that to achieve my goal.
> 

This can be done using beamer's \titlegraphic command. Add

#+LaTeX_HEADER: \titlegraphic{\includegraphics{foo.png}}

to your org file.

HTH,
Nick

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-05  3:40   ` Nick Dokos
@ 2009-07-05 11:52     ` Spike Spiegel
  2009-07-05 15:24       ` Nick Dokos
                         ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Spike Spiegel @ 2009-07-05 11:52 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hi Nicholas,

On Sun, Jul 5, 2009 at 4:40 AM, Nick Dokos<nicholas.dokos@hp.com> wrote:
> Spike Spiegel <fsmlab@gmail.com> wrote:
>
>> ...
>> - I also need to include an image in the titlepage but I don't see any
>> way to override \maketitle other than maybe renewcommand'ing it, which
>> I tried with #+LaTeX_HEADER, but kept getting errors, altho that might
>> have been me. While poking around I noticed
>> org-export-latex-title-command in org-latex.el but I'm unsure how I'd
>> use that to achieve my goal.
>>
>
> This can be done using beamer's \titlegraphic command. Add
>
> #+LaTeX_HEADER: \titlegraphic{\includegraphics{foo.png}}
>

Both answers spot on, thanks, with just a minor problem: adding
\titlegraphic won't make the spacing between \title \author \data as
produced by \maketitle shrink so the entire slide is pretty much used
up and the image doesn't fit in. Is there a way to override that?

Wrt your reply in pvt to my other question, sorry if I wasn't clear.
Your suggestion of using \includegraphics straight into the heading
works just fine, my issue is that I was trying to do it the org way
and use a link (as in C-u C-c C-l) which would have then requried a
#+ATTR_LaTeX header to pass in the width parameter.

I did some more work last night and came across another issues:
- #BEGIN_VERBATIM won't work because to use the \begin{verbatim}
environment the \being{frame} requires [fragile]

Also, given a variable like org-export-latex-image-default-option, is
there any way to override it per file or per document class?

Last thing, if you're gonna use latex commands requiring paths to
files, how do you insert the path? using C-u C-l isn't really an
option as that will add a link and not just the path to the file so
then you have to delete the [[ ]].

thanks again for all the help

-- 
"Behind every great man there's a great backpack" - B.

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-05 11:52     ` Spike Spiegel
@ 2009-07-05 15:24       ` Nick Dokos
  2009-07-05 15:38       ` Nick Dokos
  2009-07-05 16:40       ` Nick Dokos
  2 siblings, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2009-07-05 15:24 UTC (permalink / raw)
  To: Spike Spiegel; +Cc: emacs-orgmode

Spike Spiegel <fsmlab@gmail.com> wrote:


> > #+LaTeX_HEADER: \titlegraphic{\includegraphics{foo.png}}
> >
> 
> Both answers spot on, thanks, with just a minor problem: adding
> \titlegraphic won't make the spacing between \title \author \data as
> produced by \maketitle shrink so the entire slide is pretty much used
> up and the image doesn't fit in. Is there a way to override that?
> 

Yes - you should read sec. 16.3 (on templates) of the Beamer User Guide.
You can redefine the title page template and format the title page any
way you wish (within limits of course: it all has to fit on one slide).

For example, try adding this to the preamble (note that I made the image bigger, but
if it doesn't fit, you can use the same method to make it smaller):

,----
| \titlegraphic{\begin{center}\includegraphics[width=5cm]{foo.png}\end{center}}
| 
| \title{Example presentation}
| \author{Nick Dokos \\ $<$\href{mailto:nicholas.dokos@hp.com}{nicholas.dokos@hp.com}$>$}
| \date{04 July 2009}
| 
| \setbeamertemplate{title page}{
|  \centering{
|   \inserttitle\inserttitle\inserttitle\inserttitle\inserttitle\inserttitle\inserttitle\inserttitle \\
|   \insertauthor \\
|   \insertdate \\
|   \inserttitlegraphic}}
`----

You might also try asking questions about beamer on comp.text.tex (after
all, this has nothing to do with org-mode). I don't know if Till Tantau
hangs out there any longer, but you are still much more likely to get
answers to such questions there.

HTH,
Nick

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-05 11:52     ` Spike Spiegel
  2009-07-05 15:24       ` Nick Dokos
@ 2009-07-05 15:38       ` Nick Dokos
  2009-07-05 16:40       ` Nick Dokos
  2 siblings, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2009-07-05 15:38 UTC (permalink / raw)
  To: Spike Spiegel; +Cc: emacs-orgmode

Spike Spiegel <fsmlab@gmail.com> wrote:

> ...
> I did some more work last night and came across another issues:
> - #BEGIN_VERBATIM won't work because to use the \begin{verbatim}
> environment the \being{frame} requires [fragile]
> 

I worked around this when working on my presentation by putting verbatim stuff
in a file and using \verbatiminput:

,----
| #+LaTeX_CLASS: beamer
| #+TITLE: Example presentation
| #+AUTHOR: Nick Dokos \\ $<$\href{mailto:nicholas.dokos@hp.com}{nicholas.dokos@hp.com}$>$
| #+EMAIL: nicholas.dokos@hp.com
| #+OPTIONS: toc:nil H:2
| #+LaTeX_HEADER: \titlegraphic{\includegraphics{foo.png}}
| * Why \includegraphics[width=5cm]{foo.png}
| ** Reason 1.
|    Text explaining reason #1.
| ** Reason 2.
|    ... more explanations.
| ** Reason 3.
|    Blah, blah, blah.
|  
| ** Reason 4.
|    Why not?
| 
| * What
| ** First piece.
| #+LaTeX: \verbatiminput{foo.1}
| ** Second piece.
| #+LaTeX: \verbatiminput{foo.2}
| ** Third piece.
| ** Fourth piece.
`----

HTH,
Nick

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-05 11:52     ` Spike Spiegel
  2009-07-05 15:24       ` Nick Dokos
  2009-07-05 15:38       ` Nick Dokos
@ 2009-07-05 16:40       ` Nick Dokos
  2009-07-06 16:24         ` Carsten Dominik
  2 siblings, 1 reply; 9+ messages in thread
From: Nick Dokos @ 2009-07-05 16:40 UTC (permalink / raw)
  To: Spike Spiegel; +Cc: emacs-orgmode

Spike Spiegel <fsmlab@gmail.com> wrote:

> ... 
> Also, given a variable like org-export-latex-image-default-option, is
> there any way to override it per file or per document class?
> ... 

Well, yes and no (mostly no - but see below):

o You can of course customize this variable, but that's a global setting.

o You can use the ":latex-image-options" property to set the above variable,
  but that is used in org-publish-project-alist, not for exporting. From org-exp.el:

,----
| (defconst org-export-plist-vars
|   '((:link-up		      nil	  org-export-html-link-up)
|     
|     ...
| 
|     (:latex-image-options     nil	  org-export-latex-image-default-option))
|   "List of properties that represent export/publishing variables.
| Each element is a list of 3 items:
| 1. The property that is used internally, and also for org-publish-project-alist
| 2. The string that can be used in the OPTION lines to set this option,
|    or nil if this option cannot be changed in this way
| 3. The customization variable that sets the default for this option."
| )
`----

o You can modify the setting of the org-export-plist-vars (either by modifying your copy
  of org-exp.el or by some other method) to change the line

     (:latex-image-options     nil	  org-export-latex-image-default-option))

  to

     (:latex-image-options     "latex-image-options"	  org-export-latex-image-default-option))

  and then use

     #+OPTIONS: latex-image-options:width=1cm

  in your org file.

  [BTW, if you are using git, small local variations from the canonical org-mode can be easily
   accommodated, by using a local branch and git rebase.]

o You can try to convince Carsten that this should be part of canonical org-mode.

HTH,
Nick

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-04 23:31 ` questions about exporting to latex using beamer documentclass Spike Spiegel
  2009-07-05  1:34   ` Nick Dokos
  2009-07-05  3:40   ` Nick Dokos
@ 2009-07-05 21:25   ` Russell Adams
  2 siblings, 0 replies; 9+ messages in thread
From: Russell Adams @ 2009-07-05 21:25 UTC (permalink / raw)
  To: emacs-orgmode

Here's how I use "prosper", follow the examples below. After exporting
to tex, you must use the "latex" command (not pdflatex), followed by "dvipdf".

Enjoy!

~/.emacs:

(setq org-export-latex-classes (cons '("prosper"
"% BEGIN Prosper Defaults
\\documentclass[pdf, contemporain]{prosper}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{hyperref}
\\hypersetup{colorlinks,linkcolor=blue}
% END Prosper Defaults

"
("\\begin{slide}{%s}"
"\\end{slide}"
"\\begin{slide}{%s}"
"\\end{slide}"))
org-export-latex-classes))

Ledger.org (see http://adamsinfoserv.com/ under Presentations):

#+LaTeX_CLASS: prosper
#+TITLE:     Ledger & CLI Accounting
#+AUTHOR:    Russell Adams
#+EMAIL:     rladams@adamsinfoserv.com
#+DATE:      2009-06-27
#+OPTIONS:   H:3 num:nil toc:nil \n:t @:t ::t |:t ^:nil -:t f:t *:t <:t
#+OPTIONS:   TeX:nil LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc

* Slide

 - Item
 - Item
 - Item

* COMMENT Local Vars

#+ Local Variables:
#+ org-export-latex-title-command: ""
#+ End:


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

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

* Re: questions about exporting to latex using beamer documentclass
  2009-07-05 16:40       ` Nick Dokos
@ 2009-07-06 16:24         ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2009-07-06 16:24 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


On Jul 5, 2009, at 6:40 PM, Nick Dokos wrote:

> Spike Spiegel <fsmlab@gmail.com> wrote:
>
>> ...
>> Also, given a variable like org-export-latex-image-default-option, is
>> there any way to override it per file or per document class?
>> ...
>
> Well, yes and no (mostly no - but see below):
>
> o You can of course customize this variable, but that's a global  
> setting.
>
> o You can use the ":latex-image-options" property to set the above  
> variable,
>  but that is used in org-publish-project-alist, not for exporting.  
> From org-exp.el:
>
> ,----
> | (defconst org-export-plist-vars
> |   '((:link-up		      nil	  org-export-html-link-up)
> |
> |     ...
> |
> |     (:latex-image-options     nil	  org-export-latex-image-default- 
> option))
> |   "List of properties that represent export/publishing variables.
> | Each element is a list of 3 items:
> | 1. The property that is used internally, and also for org-publish- 
> project-alist
> | 2. The string that can be used in the OPTION lines to set this  
> option,
> |    or nil if this option cannot be changed in this way
> | 3. The customization variable that sets the default for this  
> option."
> | )
> `----
>
> o You can modify the setting of the org-export-plist-vars (either by  
> modifying your copy
>  of org-exp.el or by some other method) to change the line
>
>     (:latex-image-options     nil	  org-export-latex-image-default- 
> option))
>
>  to
>
>     (:latex-image-options     "latex-image-options"	  org-export- 
> latex-image-default-option))
>
>  and then use
>
>      #+OPTIONS: latex-image-options:width=1 cm
>
>  in your org file.
>
>  [BTW, if you are using git, small local variations from the  
> canonical org-mode can be easily
>   accommodated, by using a local branch and git rebase.]
>
> o You can try to convince Carsten that this should be part of  
> canonical org-mode.

You can now do (I think)

#+BIND: org-export-latex-image-default-option "width=1cm"

This will work for any variables that are not addressed by
#+OPTIONS and similar lines.  It will not work for anything
that is in `org-export-plist-vars', and that is confusing.
Any ideas on how these should interact?

- Carsten

>
> HTH,
> Nick
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2009-07-06 16:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <fsmlab@gmail.com>
2009-07-04 23:31 ` questions about exporting to latex using beamer documentclass Spike Spiegel
2009-07-05  1:34   ` Nick Dokos
2009-07-05  3:40   ` Nick Dokos
2009-07-05 11:52     ` Spike Spiegel
2009-07-05 15:24       ` Nick Dokos
2009-07-05 15:38       ` Nick Dokos
2009-07-05 16:40       ` Nick Dokos
2009-07-06 16:24         ` Carsten Dominik
2009-07-05 21:25   ` Russell Adams

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