[O] latex export settings in init files

2011-03-28 Thread Chris Beard
Hello,
I've tried to modify some default latex export settings based on info from here
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg07645.html

I basically add to the org-mode-hook to do:
(setq org-export-latex-classes (cons '(myarticle
 % BEGIN My Article Defaults
  \\documentclass[10pt,letterpaper]{article}

  
\\usepackage[letterpaper,includeheadfoot,top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry};;
more settings after this...
)
   org-export-latex-classes))

This works if I evaluate it after I've been exporting to latex, but I
get an error whenever I start up emacs:

setq: Symbol's value as variable is void: org-export-latex-classes

I'm guessing there's some org-mode latex-export thing that I need to
load first, but I'm not very familiar with how to do this. Any advice?

Thank you
Chris



Re: [O] latex export settings in init files

2011-03-28 Thread Eric S Fraga
Chris Beard wcbear...@wabash.edu writes:

 Hello,
 I've tried to modify some default latex export settings based on info from 
 here
 http://www.mail-archive.com/emacs-orgmode@gnu.org/msg07645.html

 I basically add to the org-mode-hook to do:
 (setq org-export-latex-classes (cons '(myarticle
  % BEGIN My Article Defaults
   \\documentclass[10pt,letterpaper]{article}

   
 \\usepackage[letterpaper,includeheadfoot,top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry};;
 more settings after this...
 )
org-export-latex-classes))

 This works if I evaluate it after I've been exporting to latex, but I
 get an error whenever I start up emacs:

 setq: Symbol's value as variable is void: org-export-latex-classes

 I'm guessing there's some org-mode latex-export thing that I need to
 load first, but I'm not very familiar with how to do this. Any advice?

 Thank you
 Chris

I have:

--8---cut here---start-8---
(require 'org-install)
(require 'org-exp)
(require 'org-atom)
(require 'org-exp-bibtex)
(require 'org-latex)
--8---cut here---end---8---

before any customisations.

By the way, for the types of customisation you are doing above
(obviously, I don't know what you have omitted), I find it easier to
define an org template that has the appropriate #+LaTeX_CLASS_OPTIONS
and #+LATEX_HEADER lines.
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.115.g00134.dirty)



Re: [O] latex export settings in init files

2011-03-28 Thread Chris Malone
Hi Chris,

I would try Eric's suggestion of making sure you have all the correct
require statements in your .emacs file.  If that doesn't work, make sure
you have a recent version of =org-mode= --- I've run into this problem in
the past, even with the appropriate requires, but with an old version of
=org-mode=.

Chris

On Mon, Mar 28, 2011 at 8:05 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 Chris Beard wcbear...@wabash.edu writes:

  Hello,
  I've tried to modify some default latex export settings based on info
 from here
  http://www.mail-archive.com/emacs-orgmode@gnu.org/msg07645.html
 
  I basically add to the org-mode-hook to do:
  (setq org-export-latex-classes (cons '(myarticle
   % BEGIN My Article Defaults
\\documentclass[10pt,letterpaper]{article}
 
 
 \\usepackage[letterpaper,includeheadfoot,top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry};;
  more settings after this...
  )
 org-export-latex-classes))
 
  This works if I evaluate it after I've been exporting to latex, but I
  get an error whenever I start up emacs:
 
  setq: Symbol's value as variable is void: org-export-latex-classes
 
  I'm guessing there's some org-mode latex-export thing that I need to
  load first, but I'm not very familiar with how to do this. Any advice?
 
  Thank you
  Chris

 I have:

 --8---cut here---start-8---
 (require 'org-install)
 (require 'org-exp)
 (require 'org-atom)
 (require 'org-exp-bibtex)
 (require 'org-latex)
 --8---cut here---end---8---

 before any customisations.

 By the way, for the types of customisation you are doing above
 (obviously, I don't know what you have omitted), I find it easier to
 define an org template that has the appropriate #+LaTeX_CLASS_OPTIONS
 and #+LATEX_HEADER lines.
 --
 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
 : using Org-mode version 7.5 (release_7.5.115.g00134.dirty)




Re: [O] latex export settings in init files

2011-03-28 Thread Aankhen
Hi Chris,

On Mon, Mar 28, 2011 at 17:25, Chris Beard wcbear...@wabash.edu wrote:
 Hello,
 I've tried to modify some default latex export settings based on info from 
 here
 http://www.mail-archive.com/emacs-orgmode@gnu.org/msg07645.html

 I basically add to the org-mode-hook to do:

 [snip]

 This works if I evaluate it after I've been exporting to latex, but I
 get an error whenever I start up emacs:

 setq: Symbol's value as variable is void: org-export-latex-classes

 I'm guessing there's some org-mode latex-export thing that I need to
 load first, but I'm not very familiar with how to do this. Any advice?

An alternative to flat out ‘require’-ing everything is
‘eval-after-load’.  For example:

,
| (eval-after-load 'org-export-latex
|   '(progn
|  (add-to-list org-export-latex-classes '(myarticle . ...))
|
|  (setq org-export-latex-date-format %Y %B %d
|org-export-latex-custom-lang-environments '((python listings)
`

I use this approach  autoloads almost universally in my init file,
following some advice I read.[1] It’s a trade-off between failing
early if you have errors and speeding up Emacs’s initialization.  It
can also be less than straightforward to understand…

Aankhen

[1]: http://a-nickels-worth.blogspot.com/2007/11/effective-emacs.html