auctex
[Top][All Lists]

## [AUCTeX] Using Private Macros and Style Files

 From: Eric Finster Subject: [AUCTeX] Using Private Macros and Style Files Date: Wed, 18 Feb 2009 00:12:05 -0500

Greetings,

I have a question regarding using private macros and style files.  Here's my situation:  I wanted to split off my common preamble stuff and command definitions so that I can share them among different projects.  To do this, I put them in files called "macros.sty" and "preamble.sty" and placed them in my private texmf structure, so that they are located at

~/texmf/tex/latex/preamble.sty
~/texmf/tex/latex/macros.sty

I would like AUCTex to automatically import these definitions whenever I have a project that includes them with a \usepackage command.  This seems to work okay if I have copies of the files in the same directory as the current project, but I have not been able to get it to work with the files located in a central place as above.

I set the following variables using emacs customization:

TeX-macro-private = ~/texmf/tex/latex
TeX-auto-private = ~/texmf/tex/latex/auto
TeX-style-private = ~/texmf/tex/latex/style

If I run the command "TeX-auto-generate", then AUCTex indeed seems to generate the correct style files and put them in the right place.  But my custom environments and commands are still not available.  That is, it seems that the generated style files are never being run.  On the other hand, compilation works just fine inside AUCTex, so my tex distribution (TeXLive, I believe, under Ubuntu) seems to find everything just fine.

Could anyone make any suggestions on how to get this working?  I'd really appreciate it.

Second:  I use quite a few diagrams in my work, so I wanted to see if I could make AUCTex help me with writing them.  I use xypic to do most of the diagrams, so I overloaded the hook for the command \xymatrix to prompt me for various templates which could serve as a starting point.  (This seemed smarter than defining new commands in LaTeX itself, since often I'd like to generate a diagram and then modify it and not be tied to a fixed version coming from a new macro.)  I put the code in a file "~/texmf/tex/latex/style/diagrams.el"  Can I make AUCTex automatically load this whenever I use xypic in a document?  Are there any other approaches to integrating AUCTex and xypic I should know about?

Sorry for the long message, but thanks in advance.

Eric Finster