Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Recently, when peeking over the shoulder of someone who has years of experience working with TeX, I saw him type something into the terminal that caused a pdf with the documentation for a LaTeX package we were working with to open. I asked if he had a central utility for finding the documentation for a package, his answer was: "Yes, it's called texdoc, look into it." We then kept doing our thing, and since his time for me is limited, I didn't further inquire and figured I'd find out on my own.

And so I tried, but can't seem to get the hang of it. I have a full working installation of TeX Live 2012 set up, and get this output:

$ texdoc
/usr/local/texlive/2012/bin/i386-linux/texdoc:7: module 'texdoc.main' not found:
no field package.preload['texdoc.main']
[kpse lua searcher] file not found: 'texdoc.main'
[kpse C searcher] file not found: 'texdoc.main'
[kpse All-in-one searcher] file not found: 'texdoc'

So apparently something is missing or not configured, as far as I can tell. I made sure that I had also installed the documentation, and tlmgr confirmed this. Considering this mentor of mine is already an older gentleman, is this software maybe outdated? Or (what seems more plausible) am I just doing it wrong?

Follow-up problem 1 [solved]

Thanks to David Carlisle's answer, I seem to have resolved the issue of texdoc not working properly. However, now all I get is the following:

~$ texdoc geometry
Sorry, no documentation found for geometry.
If you are unsure about the name, try searching CTAN's TeX catalogue at
http://ctan.org/search.html#byDescription.

EDIT/SOLVED: Since I had installed the medium scheme originally, there was no documentation for all the packages that were downloaded then. A reinstallation of TeXLive fixed that problem.

share|improve this question
    
For the heck of it, try texdoc geometry –  Sean Allred Jun 8 '13 at 13:28
    
I get the same error as described on the post above... –  MHaaZ Jun 8 '13 at 13:59
    
based on your update, it appears that at least some documentation has not been loaded. try this test that should list multiple possibilities for a name: texdoc -l amsmath (the -l is key). on the system i'm using, this returns 15 files, with full path, and asks the user to choose one (or not). amsmath is a "required" package, so if documentation has been installed, you should get a "sensible" response; if nothing is found, then it's very likely that the medium scheme did not install documentation. not sure whether it's possible to install only documentation files separately. –  barbara beeton Jun 8 '13 at 19:23
1  
i've taken a quick look at the on-line tex live installation documentaion amd it's not clear to me that it's possible to download just the package documentation; but you might look there yourself. (the installation i'm using is "complete", so i don't know the details of selective installation.) the main tex live tree has several branches. you can determine from a log file what the tex/latex branch is; there should be a parallel branch doc/latex, and package documentation should be there. if that branch is missing, no doc. (cont'd) –  barbara beeton Jun 9 '13 at 14:30
1  
(cont'd) i will ask the tex live maintenance group if it's possible to selectively download package documentation, whether that documentation is included in the "medium" download, and a few other relevant questions, and suggest including that information clearly in the documentation, if it's not there already. but it's too late for tex live 2013. –  barbara beeton Jun 9 '13 at 14:37
show 3 more comments

3 Answers

something is wrong with your installation:

texdoc longtable

is supposed to open the longtable package and

texdoc

on its own is supposed to echo some usage help that starts out like

$ texdoc
Usage: texdoc [OPTION]... NAME...
  or:  texdoc ACTION

Try to find appropriate TeX documentation for the specified NAME(s).
Alternatively, perform the given ACTION and exit.

Current settings: --view, --interact (default).

Options:
  -w, --view            Use view mode: start a viewer. (default)
  -m, --mixed           Use mixed mode (view or list).

However google suggests that error has been seen before.

This thread ends with a happy ending, perhaps your problem is similar:

http://tug.org/pipermail/texdoc/2011q3/000281.html

share|improve this answer
2  
Thanks a lot for that link. It solved my problem.Would it make sense to detail the steps into an answer of its own? (the policy on SE seems to be that although links are fine, local answers are better...) –  MHaaZ Jun 8 '13 at 14:45
    
@MHaaZ yes feel free to make and accept a self answer –  David Carlisle Jun 8 '13 at 14:48
    
Just wanted to make sure what the policy is - don't want you to think I'd rather accept my own answer. Although, you don't seem to be in need of the reputation, really :)) –  MHaaZ Jun 8 '13 at 16:29
    
After originally posting an answer like you suggested, I encountered a follow-up problem and thus deleted it until I can write a complete solution. –  MHaaZ Jun 8 '13 at 18:39
add comment
up vote 9 down vote accepted

I followed David Carlisle's advice and navigated to the link he provided. I am posting my solution as a separate answer to have it "on-site" and not only as a link.

It turns there were a couple of things wrong with my installation of TeX Live:

  • I hadn't installed the perl-tk package on my Unix-based system, which is apparently a good thing to have when you work with a manual TeX Live installation; most importantly it enables the GUI for the tlmgr or "TeX Live Manager". On Debian-derived systems (all *buntus), this is quickly fixed by running

    sudo apt-get install perl-tk
    

    in a terminal.

  • I still had an old preinstalled version of luatex roaming around in my system. This is relevant, since texdoc is a LUA script or uses a LUA script in some way (LUA is a programming language, refer to the link in David Carlisle's answer and read the complete email exchange to read more about this). Since my PATH variable was set up as

    PATH="...:/usr/bin/:....:/usr/local/texlive/2012/bin/i386-linux"
    

    when I executed texdoc my system first found the old version of luatex which wasn't finding the necessary files since it lived in another directory than my actual TeX Live installation. This was fixed by two easy steps:

    1. Removing all traces of the old TeX Live distribution preinstalled on my system (by running sudo apt-get remove texlive-* on Debian-based systems)
    2. Correcting the PATH environment variable so that my TeX Live installation directory precedes any other directory where there may be TeX-related binaries. This is done by changing either the file .pam_environment (for the current user session) or by editing `/etc/environment" with sudo privileges (for all users).

After completing these steps, everything worked as expected: texdoc tried to find the documentation for the package you tell it to... it just couldn't find anything. This was because I had originally installed the medium scheme and this included no documentation. A reinstall of TexLive, using the scheme complete, resolved this issue.

share|improve this answer
add comment

For what it's worth --- and for those who do not have a TeX Live installation --- there is also an online version developed and maintained by frequent contributors to this site. Like texdoc itself, a very useful resource that should not be overlooked.

The interface is so simple that it needs no explanation, but the basic principle is that the URL http://texdoc.net/pkg/<packagename> should link you to the package's (main) documentation. Thus,

http://texdoc.net/pkg/geometry

offers me the chance to download the geometry documentation. (I assume if you have your browser set up with a pdf plug-in, it will just display the PDF.)

share|improve this answer
    
Awesome when not working at one's own machine, thanks! –  MHaaZ Jun 26 '13 at 15:45
    
+1 a very useful resource for all :) –  cmhughes Jun 26 '13 at 16:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.