# How to force MikTeX' texdoc to open package manuals with a PDF reader rather than the DVI viewer?

I am working on a machine with MikTeX installed. When I want to open a certain package manual, I type `texdoc packagename`. However, I don't want to open it with Yap (the DVI viewer in MiKTeX). Acrobat Reader has been installed.

How to force MikTeX's `texdoc` to open package manuals with Acrobat Reader rather than Yap?

Note that I never find this problem when using TeXLive.

-
I have `viewer_pdf = /usr/bin/acroread %s >/dev/null 2>/dev/null &` in my `~/texmf/texdoc/texdoc.cnf` config file which works fine with TeXLive under Linux. In principle this should work as well MikTeX under Windows, you just need to change the call to Windows format. –  Martin Scharrer May 5 '12 at 12:37

On my PC with miktex 2.9. `texdoc packagename` (or the alias `mthelp packagename`) normally opens a webpage in my browser with a list of the various files belonging to the documentation of the package.

`texdoc --view packagename` tries to open the "main" documentation file. If this file is a `pdf` it is opened in the pdf-viewer, if it is a `dvi` the dvi-viewer YAP is used. In quite a lot of the older packages there isn't a `pdf` yet, the documentation exists only as `dvi` so it isn't possible to force texdoc to open such a `dvi` in a pdf viewer.

What you can do is: If you find a package where the documentation in miktex is still in a `dvi`-format and there exists a `pdf` version on CTAN then make a feature request at the miktex tracker that the miktex packages gets updated.

-
Sometimes on my machine, the html files are in Polish! Machine locale is set to english. –  Yiannis Lazarides May 5 '12 at 14:40
@YiannisLazarides: Surely you searched `texdoc latex2e`. It happened to me, too, some times. There’s a file `latex2e.html` in `<MiKTeX>\doc\html\polish\latex2e` (but there are more more under the `polish` subfolder). With Martin’s answer it should be possible, that first the existing PDF files are searched. –  Speravir May 6 '12 at 13:02

According to the sources, mthelp/texdoc looks for documentation files in the following order by default: `.chm;.html;.dvi;.pdf;.ps;.txt`. So if it finds a DVI file, it's preferred over the PDF variant.

It's possible to override the configuration by adding the registry key `HKEY_CURRENT_USER\Software\MiKTeX.org\MiKTeX\2.9\mthelp\DocExtensions` and assign the desired format sequence to it, e.g. `.chm;.html;.pdf;.dvi;.ps;.txt`. Now, PDF docs should be preferred over DVI if available.

The registry key can easily be added/changed using the `reg` command on the command-line:

``````reg add HKCU\Software\MiKTeX.org\MiKTeX\2.9\mthelp /v DocExtensions /d ".chm;.html;.p
df;.dvi;.ps;.txt"
``````

As noted by Speravir in the comment below, the texdoc executable (just a duplicate of mthelp) looks for the DocExtensions entry in registry key `HKEY_CURRENT_USER\Software\MiKTeX.org\MiKTeX\2.9\texdoc` and doesn't use the mthelp settings. Thus, it's possible to define different lookup sequences for both utilities. In order to assign the value, the above call of `reg.exe` must be altered to

``````reg add HKCU\Software\MiKTeX.org\MiKTeX\2.9\texdoc /v DocExtensions /d ".chm;.html;.p
df;.dvi;.ps;.txt"
``````
-
The options for the `reg` command must begin with `/` instead of `-`, at least in WinXP! –  Speravir May 6 '12 at 0:48
Yes, you're right. On Win 7, you can also use hyphens instead of slashes. I'll edit the above command-line to be compatible. –  Martin May 6 '12 at 7:20
I just observed an issue: When `texdoc` is used instead of `mthelp`, exactly what the OP did and what is mostly proposed here, one has to do a copy of the `mthelp` registry entry: `HKCU\Software\MiKTeX.org\MiKTeX\2.9\texdoc` etc. Please add this to your answer. –  Speravir May 6 '12 at 14:21

In addition to the other answers: A lot of the documentation, which in TeXlive is in PDF format, is in MiKTeX contained in the DVI format. As far as I see, documentation in PDF format is only added on package updates, but only, when the package authors provide it by themselves. At time of writing the most recent DVI file in my MIKTeX installation is `silence-doc.dvi` with a file date 1st febr. 2012 for the package `silence` v1.4 from 2011/12/06.

What you always can do yourself is converting the DVI files into PDF: `dvipdfmx <filename>` should work in most cases, sometimes you will have to do `dvips <filename>` and in a second step `ps2pdf <filename>`. Then save these PDF files in a local TeXMF tree and together with Martin’s answer you should get the wanted behaviour.

-
@UlrikeFischer: Oh, sorry I overlooked parts of your answer. –  Speravir May 5 '12 at 21:13