The trick is actually to include the new package file (normally the ".sty" file) in the search path of your editor. There are two usual ways:
- If you might only use the package file once or not many times, or if you would not be bothered by copying the package file everywhere, the most straight forward solution is to keep the ".sty" file under the same directory as your ".tex" file. But as mentioned above, if you are creating a series of files, such as lecture slides, you have to copy the ".sty" under every directory.
- Another more efficient and "once for all" solution is to add the ".sty" file, namely the package under the system default directory, where the editor will check every time when it compiles the ".tex" file. For Mac users who are using TeXShop, the searching path is: "/Users/your_name/Library/texmf/tex/latex", replace "your_name" with the login of your computer. Notice that you can create sub-directories under the above directory.
In fact, the above directory is just one of severals that will be searched, there is a more deeply embedded one under "/usr/local/texlive". However, modifying structures there might cause some unknown problem later on. So it is suggested to just use the directory mentioned above in the second method.
没有评论:
发表评论