Menu

#1280 Incorrect texdoc error message in a portable context

None
fixed
nobody
texdoc (2)
1
2015-05-17
2015-03-22
Jan S.
No

The following problem occurs when the package documentation is started from TeXstudio.

But first to my configuration:
I'm using the portable version of MikTeX and the portable version of TeXstudio (Win7x64). Therefore the file types like .dvi, .ps etc. are not associated to any program on my system. This is a problem for texdoc, because it just opens the documentation, terminates and let the os handle the rest.

But as described in the manual it is possible to set some enviroment variables which point to the correct location of the viewer (e. g. MIKTEX_VIEW_dvi). If this is done, texdoc can also be used in a portable context, but with one difference: texdoc opens the package documentation and does not terminate.

The last part conflicts with TeXstudio, because it waits abour 2 seconds for the termination of texdoc and gives an error message otherwise (as far as I can see the relevant method is "void Help::viewTexdoc(QString package)"). Now I can open package documentation from TeXstudio and it opens correctly, but after 2 seconds I get the "texdoc took too long to open the documentation for the package:" error message (btw. if I don't set the enviroment variable at all and try to open the package documentation TeXstudio crashes on my system after showing me two error messages).

I would have two ideas to fix this:

  1. Use the "texdoc --print-only <package>" command to just get the relevant exection commando and execute that commando afterwards independent from texdoc.</package>
  2. Don't use texdoc to view the documentation at all. When you know where the documentation file is located, wouldn't it be better to start them by using the internal configurations for view-dvi, view-ps, etc. (distinguishable by the file ending)?

I would prefer the second approach, because the user has just to make sure that the paths to the viewer are set correctly and then the rest works out of the box.

I hope this helps you and thanks for your work, you are great!

Discussion

  • Tim Hoffmann

    Tim Hoffmann - 2015-04-06

    This is not so easy. texdoc appears to be quite inconsistent (both among different distributions (MikTeX / TeXlive) and also within MikTeX using different commands).

    For example (using MikTeX):

    >texdoc --view xcolor
    # opens C:\Users\Tim\AppData\Roaming\MiKTeX\2.9\doc\latex\xcolor\xcolor.pdf
    
    >texdoc --print-only xcolor
    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" C:\Users\Tim\AppData\Local\MiKTeX\2.9\miktex\mthelp\xcolor.html
    
    >texdoc --list-only xcolor
    C:\Users\Tim\AppData\Roaming\MiKTeX\2.9\doc\latex\xcolor\xcolor.pdf
    C:\Users\Tim\AppData\Roaming\MiKTeX\2.9\doc\latex\xcolor\xcolor2.pdf
    C:\Users\Tim\AppData\Roaming\MiKTeX\2.9\doc\latex\xcolor\xcolor.pdf
    
    • executing the result of --print-only does not yield the same result as --view
    • --list-only yields multiple documents. One cannot easily determine which one is the main documentation file.

    In contrast, TeXlive has another syntax, e.g. texdoc --list -M xcolor (I'm not even sure if there is an equivalent to --print-only. Additionally the output format is different.

    To conclude --view does work independent of the distribution. Everything else would require a lot of case distinctions and we don't have the time to dig into this. You are welcome to investigate this in more detail. If you can come up with a general and not to complicated recipe how to get the command and/or the main documentation file from texdoc, we can implement it.

     
  • Tim Hoffmann

    Tim Hoffmann - 2015-05-17

    The original issue (incorrect error message) is fixed by not waiting for texdoc to return if MikTeX is used and a MIKTEX_VIEW_* environment variable is set: hg 5146 (259c5a68459c)

     
  • Tim Hoffmann

    Tim Hoffmann - 2015-05-17
    • status: open --> fixed
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB