[OS X TeX] Placement of files

Murray Eisenberg murrayeisenberg at gmail.com
Mon Oct 1 11:49:31 EDT 2018

My understanding is that a .sty file may be anywhere if you provide an explicit path to it relative to the location of the .tex source that loads it.

I’m using the same kind of file configuration, also for a book. The main file, let’s call it NewBook.tex, which inputs (actually, includes) all the other content files is in a folder ~/Documents/Publications/NewBook.  (For the sake of clarity, in this message I’ve changed the actual folder and file names).

Most of my own custom .sty packages are in a subfolder ~/Documents/Publications/NewBook/preamble. (A few, common to many projects, are in the local texmf tree.) One of them is mystyle.sty. This is loaded in NewBook.tex by:


This works just fine. 

Actually, I’ve made things more complicated than that, because I have a great many customizations, which I’ve chunked into a bunch of separate custom .sty files. The main file NewBook.tex has the command


and in subfolder preamble I have a file preamble.tex that contains the actual loading of those custom style files, e.g.:


> On 1 Oct2018, at 11:21 AM, Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu> wrote:
> I am, even after many years and several changes of computers and TeXShop installations, still confused about where to put things.
> Here is my immediate problem:
> I have a folder, called “Book(update 2018) which has the text files for a book; among the .tex file is also a folder called Bookmacros(2018) in which I have the user-defined macros I use in this book.This is an update of a book already submitted and in fact under production at the publisher, but I wanted an up-to-date corrected version, which is the intention of this folder.  In the master tex file (which calls all the others) I have the command
> \usepackage{Bookmacros(2018)/formatstyle} pointing to the macro file inside the Bookmacros(2018) folder that governs some formatting issues.
> It is clear to me that this file is not being accessed (but some other version elsewhere on my computer is) because when I compile the masterful
> i get an error message about an undefined control sequence referring to a macro that I have triple-checked is correctly defined in the format macros.sty file inside this folder.
> Can someone clarify how TeX searches for .sty files (and other macro files).
> I recall that there is a central place where such files can be put to always be accessible to .tex files anywhere on the computer, and would like to be reminded of this, but also here I am concerned with overriding any obsolete versions of this file that may have been left lying around.  Am I using the wrong format to point into this subfolder?
> Zbigniew Nitecki
> Department of Mathematics
> Tufts University
> Medford, MA 02155
> telephones:
> my office     (617) 627-3843
> dept. off.    (617) 627-3234
> dept. fax    (617) 627-3966
> http://sites.tufts.edu/znitecki/ <http://sites.tufts.edu/znitecki/>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
> List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
>                https://email.esm.psu.edu/pipermail/macosx-tex/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

Murray Eisenberg			murrayeisenberg at gmail.com
503 King Farm Blvd #101	Home (240)-246-7240
Rockville, MD 20850-6667	Mobile (413)-427-5334

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20181001/faf762a5/attachment.html>

More information about the MacOSX-TeX mailing list