This is a note for users of teTeX related ports in the FreeBSD ports collection. If you notice any problems which are not mentioned here or have any suggestions/comments/questions, please let me (hrs@FreeBSD.org) know. Thanks. (5 Jun 2005) Note that if you have environment variables for teTeX in a wrong way (such as TEXINPUTS, TEXMF, TEXMFCNF, and so on), they may prevents teTeX from working. Please unset them first if you do not know what they are for since typically they are not needed. However, some TeX related packages may suggest to set TEXINPUTS. In that case, please make sure the TEXINPUTS includes a trailing ":" character, which indicates the standard search paths are also used. For example: (NG) TEXINPUTS=/home/hrs/texinputs:/usr/local/share/texmf (OK) TEXINPUTS=/home/hrs/texinputs:/usr/local/share/texmf: Also you do not have to add the standard TEXMF directories, $PREFIX/share/texmf*, into the variable. - Upgrade procedure: You can upgrade teTeX related packages with portupgrade(1), but it can cause problems due to files which are not removed for some reasons. If your teTeX environment became broken, please follow the procedure described below before submitting a PR: 1. Deinstall all of the TeX related packages in your system. Please use pkg_delete first, not `make deinstall' in each port directory. Type the following commands, for example. # pkg_delete latex-\* # pkg_delete \*-platex-\* # pkg_delete \*xdvik-\* # pkg_delete \*dvipsk-\* # pkg_delete \*-texfamily-\* # pkg_delete \*-ptex-\* # pkg_delete \*teTeX-base-\* # pkg_delete \*teTeX-texmf-\* # pkg_delete \*tex-texmflocal-\* # pkg_delete \*teTeX-\* (a prompt `#' means `run it as root', and `%' means `run it as a regular user) If you get an error like the following during pkg_delete, try `pkg_delete ' for the packages displayed: # pkg_delete \*-ptex-\* pkg_delete: package 'ja-ptex-tetex-3.1.8' is required by these other packages and may not be deinstalled: ja-latex2html-2002.2.1j2.0_1 ja-dvipsk-tetex-5.94a_2 ja-xdvik-tetex-22.40y1.1.21_5 In above example, try these and continue the procedure after that: # pkg_delete ja-latex2html-2002.2.1j2.0_1 # pkg_delete ja-dvipsk-tetex-5.94a_2 # pkg_delete ja-xdvik-tetex-22.40y1.1.21_5 (the version numbers may vary in your environment) You may get an error which says `no such package `foo' installed'. You can ignore it and go on in that case. Also, if you still get another error which prevents pkg_delete, try `pkg_delete -f '. 2. Once the deinstallation finished, type the following command and see what is displayed: % find /usr/local/share/texmf* -type f If some files are displayed, they may be files installed or rewritten by yourself. If you did not install or rewrite such files manually, you can remove them safely by using this command: # rm -rf /usr/local/share/texmf* If you are familiar to the teTeX distribution and customized the environment by rewriting or installing any files by yourself, files you touched should be displayed here. You may want to make a backup copy these files before removing them. In either case, make sure to remove /usr/local/share/texmf* directories. 3. Install print/teTeX (or japanese/teTeX for Japanese TeX). # cd /usr/ports/print/teTeX # make install If you want to use U.S. letter size by default, set WITH_LETTERSIZE=YES in the command line like this: # cd /usr/ports/print/teTeX # make WITH_LETTERSIZE=YES install These commands install TeX binaries including eTeX, LaTeX2e, PDFTeX, and so on, and several popular dviware such as xdvi and dvips. Typically you do not need further configuration to use TeX. - Notes for advanced users: * Compatibility teTeX-3.0 uses PDFeTeX as the primary TeX engine for most of the formats, and latex(1), etex(1), pdflatex(1), and pdftex(1) are symlink'd to pdfetex(1) actually (but this does not mean latex(1) generates a PDF output). So format files which are generated by using initex(1) or `tex -ini' can be no longer used with other formats generated by PDFeTeX, which include LaTeX, PDFTeX, and so on except plain TeX. When you try to use a format file with a wrong engine, you will get the following error: % tex \&latex /tmp/a.tex This is TeX, Version 3.141592 (Web2C 7.5.4) ---! /usr/local/share/texmf-var/web2c/latex.fmt was written by pdfetex (Fatal format file error; I'm stymied) In above example, while a format file `latex' was generated by pdfetex(1), you tried to use it with tex(1). This problem seldom occurs because teTeX related packages in the ports collection automatically regenerate such format files, but you may have to regenerate the format file by using pdfetex(1). * Directory structure The teTeX related packages in the FreeBSD ports collection use these directories: ${HOME}/.texmf-config: private area (if any) ${HOME}/.texmf-var: private area (if any) ${HOME}/texmf: private area (if any) ${PREFIX}/share/texmf-config: various configuration files ${PREFIX}/share/texmf-var: files generated by fmtutil(1) and so on ${PREFIX}/share/texmf: files installed by the ports collection ${PREFIX}/share/texmf-local: files installed by the ports collection ${PREFIX}/share/texmf-dist: files in the teTeX distribution The TeX related utilities will look for the necessary files in these directories in this order, and the first match rule is applied. Since teTeX-3.0 it provides texmf-config and texmf-dist, so difference between share/texmf-local and share/texmf is not clear now. In the near future, I will modify all of the TeX related ports to use share/texmf as the directory for additional files installed by the ports collection, and share/texmf-local as one for site-local configuration which will not be modified even if the TeX related ports are installed or deinstalled.