Apparently Miktex sometimes doesn't properly set the TEXMFHOME variable, or rather leaves it empty, even though you manually add folders to the "root" list and refresh the file name database. So how do I set the TEXMFHOME variable? Another way of phrasing the question: What is the Miktex version of tlmgr conf texmf TEXMFHOME ~/path/to/texmf
?
[Tex/LaTex] Setting TEXMFHOME variable when using Miktex portable
environment-variablesmiktextexmf
Best Answer
First a remark:
I do not use MikTeX portable myself, and honestly I don’t understand it entirely. So let me give some hints from what I’ve found. Maybe some other can give additional information.
MiKTeX apparently does not take use of the kpse mechanism. The recommended method in MikTeX for adding a local TeXMF tree is to use the MiKTeX Options dialogue:
miktex-portable.cmd
.<miktex-portable>\miktex\config\miktexstartup.ini
. Your local TEXMF tree must not be a subfolder of<miktex-portable>
.What I wanted to do now doesn’t seem to work, I consider it a bug in MiKTeX 2.9: After activation of “Show MiKTeX-maintained root directories” one should be able to change the order of the folders, but I couldn’t manage this.According to
<miktex-portable>\doc\miktex\miktex.pdf
, section 4.6, (or see<miktex-portable>\doc\miktex\localadditions.html
, as web link : http://docs.miktex.org/manual/localadditions.html) there are 2 other ways:--include-directory=dir
, e.g.latex --include-directory=C:\path\to\my\style\files thesis.tex
. I don’t know, whether this works with a full local TEXMF tree, but I fear it does not.Instead of absolute paths I would favour relative ones together with the use of command line parameters, e.g. if you save a batch script
latex.cmd
directly in lets sayX:\miktex-portable
and have your local TEXMF tree inX:\localtexmf
Then you could do
latex.cmd <command line options> file_to_compile.tex
.On the other hand you could consider the use of the portable texlive version.