[texhax] How to manage personal TeX files (Was: Question)

Vladimir Lomov lomov.vl at gmail.com
Fri Dec 9 04:53:22 CET 2011


Hello,
** Hoo, Karlene [2011-12-08 12:51:36 -0600]:

> Dear TUG ORG,

> I use MiKTex 2.9 within a WinEdt environment on a PC laptop.
You didn't tell what OS do you use (WinXP, Windows Vista, Windows 7,
Windows 2003 server, etc)

> I am trying to enter a root name that has a blank space in the naming structure:

> \usepackage{"C:\Program Files\MiKTex 2.9\texfiles\myfiles\mathbbold"}

> The problem is that the compiler ignores the spacing between the word Program and the word Files and also between the word MiKTex and the word 2.9

>  I thought this problem was taken care of by the use of the double quotes but this is not so. I also have tried single quotes.

> Any hints on how to fix this problem?
Just don't use such constructions.

(A short how to)

== How to make TeX use my personal files ==

Suppose that you have you personal TeX (LaTeX actually) files:
`my_style.tex' and `my_package.sty' (here I won't describe the different
between tex and sty and how to write correct sty file) and you want to
use them in you document like in example

-------------------------------------------
\documentclass{article}

\usepackage{my_package} %% Of course we talk here about `my_package.sty' file
%% Rest of preamble

\begin{document}
%% Document body
\end{document}
-------------------------------------------

In order to latex engine find file `my_package.sty' it should be located
either in current directory or in some standard directory.

The first option is not optimal if the package will be used many times
by many documents. So, let's consider the second way.

Below I will use the variable USERPROFILE to point to your `home'
directory. Run in terminal (cmd.exe) the command
C:\> echo %USERPROFILE%
and would know your `home' directory.

1. Create in %USERPROFILE% the directory texmf and subdirectories tex
and latex:
  %USERPROFILE%/texmf/tex/latex
  (I use `/' instead of `\')
2. Create in %USERPROFILE%/tex/latex directory, say, karlene:
  %USERPROFILE%/tex/latex/karlene
3. Put your tex files there.
4. Configure MiKTeX to search for that files there:
  4.1 Start->Program*->MiKTeX->Maintainance->Settings
    * For Windows Vista,7,.. "All Programs"
  4.2 Tab "Roots", use "Add" button to browser to the %USERPROFILE%/texmf
  directory and add it.
  4.3 On first tab "General" push button "Refresh FNDB".

After that you could try to run your example document. All should work
fine.

N.B. I would recomment to use %USERPROFILE%/texmf directory than that
MiKTeX suggests (%USERPROFILE%\AppData\Local\MikTeX\2.9 on Windows 7)
because a) after MiKTeX upgrade (say version 2.10 will be released)
tat directory will be "lost" in search and b) you could the same
directory with TeX Live as well.


---
WBR, Vladimir Lomov

-- 
Mencken and Nathan's Ninth Law of The Average American:
	The quality of a champagne is judged by the amount of noise the
	cork makes when it is popped.


More information about the texhax mailing list