Skip to content

Invoking Texdoc without switching the TEXMF trees

Takuto ASAKURA edited this page Dec 27, 2019 · 1 revision

As it is described in the README, generally you don't have to install Texdoc by yourself. For users who want to try or test the development version, you can install it to your TEXMFHOME. The detailed procedure also is described in the README. We highly recommend you to use Texdoc by installing it by following the instructions.

The explanation on this page is for advanced users who want to use Texdoc in a TEXMF tree which is not the set up current TEXMF tree. Such users are mostly having multiple TEXMFDISTs (i.e., TeX Live distributions) at the same time in their local environment.

First of all, since Texdoc is not a standalone program, it always should be placed in the correct position in a TEXMF following TDS. Specifically, all script files (*.tlu) should be placed in <YOUR TEXMF>/scripts/texdoc/. In case you placed the Texdoc program to the correct position in a TEXMF, you can invoke it by executing the main program texdoc.tlu, e.g., with the absolute path:

$ texlua <YOUR TEXMF>/scripts/texdoc/texdoc.tlu <arguments>

In this case, regardless of the current TEXMFMAIN, Texdoc in <YOUR TEXMF> will be invoked and documents in <YOUR TEXMF> will be searched. On the other hand, documents in the current TEXMFMAIN will not be searched.

This behavior is implemented by setting temporal TEXMFAUXTREES and TEXMFDIST to the <YOUR TEXMF> when the real path of the executed texdoc.tlu is in a TEXMF tree which is not the current TEXMFDIST. For now, the system command realpath is required to do this. Therefore, systems without the command such as Windows and some Linux distributions are not supported for this feature.

Note that Texdoc also uses some TEXMF trees other than TEXMFDIST, e.g.,

  • TEXMFHOME for its configuration files, and
  • TEXMFVAR for a cache file.

Texdoc will not automatically change these variables, so users are responsible to set these variables to what they want to use.

You can read the detailed discussions about this specification in the issue #44.