Maybe you can include the sty file as a code block that will be tangled before export. You should put that block in a section tagged no-export. Depending on your setup, you may need to make a code block to build your latex file and/or pdf to make sure the tangling happens. at the top keep this #+LATEX_HEADER: \usepackage{filestyle} and in the last section do this * build :noexport: #+begin_src text :tangle filestyle.sty latex code for style #+end_src #+begin_src emacs-lisp (org-babel-tangle) (save-buffer) (org-latex-export-to-pdf) #+end_src and finally put your cursor in the last block, and type C-c C-c. that should do what you want. John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Sun, Jun 1, 2014 at 2:57 AM, Steven Arntson wrote: > I've been learning to export from org to latex (to pdf), and have had > great success. There's a simplification to the process I'd like to make, > though, if it's possible. > > Right now I use files: file.org and filestyle.sty. The .sty gives > the latex-specific instruction, and I point to it from file.org with a > line of #+LATEX_HEADER: \usepackage{filestyle}. This works great, but > I'd love to have just one file, not two, to keep things simple. > > So I tried putting the contents of filestyle.sty near the top of file.org > inside of #+BEGIN_latex and #+END_latex, but it doesn't quite work. It > incompletely works, which is perplexing... > > I'd appreciate any ideas about this--can it be done? > > Thank you! > Steven > > >