Some notes on LaTeX

April 5, 2008: Notes on the location of document classes and bibtex files

  1. To see whether or not a certain bib, sty or cls file is found or not, there is a useful command in your MiKTeX installation (e.g. C:\MiKTeX\miktex\bin\, in my case) called findtexmf, which will travel the directories of base files defined in the miktex.ini to see whether a given file is found. Try searching for article.sty.
  2. If you would like to add a new "generally available" sty or cls file, just copy the contents to %MIKTEX%\tex\latex\base\, or some subdirectory of it. Then you have to run Start -> Programs -> MiKTeX -> Settings and Refresh FNDB. Run the utility in 1. above to make sure that the file is now found. Same should be done for your bib and bst files. The former usually go into %MIKTEX%\bibtex\bib\base and the former to %MIKTEX%\bibtex\bib\base. Do not forget to refresh the FNDB database.

March 28, 2008: LaTeX2html Installation notes

Today I suffered quite a bit trying to make LaTeX2html work on my Windows machine. Here are a few pointers for those poor souls that are attempting something similar.

I will not rewrite the whole installation process. A good start can be found here. I will only write about some of the problems that I found, and how I solved them. Everything that is needed should be put on the c:\ directory. Perl has a tendency to complain when folders with spaces are used. My file tree is the following:

  1. c:\gnuwin32, this is the netpbm utilities.
  2. c:\miktex, the LaTeX directory, this solved the famous dvips version ... no problem.
  3. c:\perl, the Pearl directory
  4. c:\progra~1\ghostgum\gs\gs8.54\bin, the path to the GhostScript utilities. Notice that I've used the short (DOS) name for the path.
  5. c:\tmp, this will be the folder where temporary files (such as images) are put for further processing.
  6. I installed the LaTeX2html on c:\progs, to avoid the "Program Files" Windows directory.

Some of these preferences have to be set up in the prefs.pm file before running the config.bat command. Below are the chages I did to this file:

  1. Line 126: $prefs{'EXTRAPATH'} = 'C:\\progra~1\\ghostgum\\gs\\gs8.54\\bin;C:\\GnuWin32\\bin';
  2. Line 131: $prefs{'PREFIX'} = 'C:\\progs\\latex2html';
  3. Line 371: $prefs{'PIPES'} = 0;, this is not strictly necessary, because the configuration script checks this and sets it appropriatly, but this is what I did.

Once I had all this in place, I was getting a very annoying error:

Converting image #2 pstoimg.bat: Error: "pnmtopng.exe -interlace -trans gray85 < c:\tmp\l2h1368\p3692.pnm > img1.png" failed: Bad file descriptor. Error while converting image

This took a while to figure out. Basically the problem lies in that gray85 could not be recognized. This is due in part to the fact that there is no pointer to the /styles/rgb.txt file in the LaTeX2html directory. Even having an environment variable to it didn't help. What did the trick was to modify the pstoimg.bat file at line 1261, and change gray85 to #d9d9d9.

Another thing is to make sure that the %PATH% and auxiliary system variables are pointing to the relevant programs. My relevant system variables are:

  1. Path=C:\MiKTeX\miktex\bin;C:\Perl\site\bin;C:\Perl\bin;c:\program files\ghostgum\ghostview\gsview\;c:\program files\ghostgum\gs\gs8.51\lib;c:\program files\ghostgum\g s\gs8.51\bin;C:\progs\latex2html\bin;C:\texmf\miktex\bin;
  2. TMP=c:\tmp