TeX Live on cygwin: A few tricks
Since LaTeX works so well in the Linux/UNIX world (with tools like xFig for example) I installed cygwin on my Win7 machine to accompany the win32 installation of TeX Live. So I already had a TeX Live directory under
and then I thought maybe I should just do it all inside cygwin. but it was not so easy… so this is about “Getting latex to work on cygwin when it is already installed as a windows application in C:\Program Files (texlive in both cases).”
I am on win32 but 64 bit may be the same, I don’t know.
(1) Installed cygwin using setup-x86.exe, including TeX Live.
(2) A quick test using kpathsea shows that the files are not where TeX is expecting them:
does not gives you the actual distribution texmf tree. For example, if you run:
it thinks it should look in
when really it should look in
(3) But this is not so bad — there is a cygwin version of texmf.cnf, you just need to copy it to where texconfig will look for it:
$ cp /usr/share/texmf/web2c/texmf.cnf /usr/share/texmf/web2c/texmf_noncygwin_backup_cnf.bak
$ cp /usr/share/texmf-dist/web2c/texmf.cnf /usr/share/texmf/web2c/
(4) But then it did not work. The reason was that cygwin default install was incorporating the PATH from Windows into the cygwin PATH. This was easy to test:
$ echo $PATH
(5) What was happening was that texconfig was finding the config files in the win32 installation and getting confused. Since I am happy for my cygwin to be essentially independent of any binaries installed outside it (and if I want to use them I’ll tell it to myself) I just changed the PATH statement in my .bash_profile to overwrite the system-defined path with a simple:
(6) And the last trick was that Windows was defining an environment variable
which was misleading texconfig. Whether this was the problem or the whole path was the problem I’m not sure, so I cleaned up both. I just added
to my .bash_profile as well. This may be overkill, but that way if I add a font or something and rerun mktexlsr in the furture when I have forgotten all this it should still work.
(7) Configure TeX…
$ texhash (or mktexlsr) (should list the files it is updating)
$ texconfig confall
I decided to manually create the directories under $HOME that it was expecting, though I don’t think you need to:
$ mkdir -p .cache/texmf/fonts
$ mkdir -p .config/texmf
$ mkdir -pv .local/share/texmf
Then the big one…
$ texconfig init
(8) Note the end of the messages output from init:
WARNING: you are switching to updmap's per-user mappings.
You have run updmap (as opposed to updmap-sys) for the first time; this has created configuration files which are local to your personal account.
Any changes in system map files will *not* be automatically reflected in your files; furthermore, running updmap-sys will no longer have any effect for you. As a consequence, you have to rerun updmap yourself after any change in the system directories; for example, if a new font
package is added.
If you want to undo this, remove the files mentioned above.
(Run updmap --help for full documentation of updmap.)
Transcript written on "/home/username/.cache/texmf/web2c/updmap.log".
updmap: Updating ls-R files.
Or just do this.