Time and again I am in the need of figuring out the arguments/options of a package, and more often than not I get very frustrated with the results I get online. Even worse, sometimes I get confused because a command actually belongs to a package with a completely different name. Since I'm noticing this is a recurrent problem (which honestly I just have with LaTeX), I'd like to instead see the actual code in my installation and try to figure it out myself.

For instance, I am currently trying to figure out the options that \subfloat accepts, but googling \subfloat documentation lead me to some pdfs that are actually of little help. So I'd like to instead look at the source code of \subfloat. How can I do that? I am using Miktex and WinEdt.

Thanks, Jorge.

  • 6
    It's always best to start with the proper documentation before delving into code. So perhaps start here: How to find the documentation for a package? which shows you various ways to get the actual documentation for a package. – Alan Munn Feb 25 '18 at 15:26
  • 1
    You can show in the log-file (you normally get it with ctrl+l in winedt). There the pathes to all files are noted. To get documentation use texdoc (see "latex doc" in the help menu of winedt). – Ulrike Fischer Feb 25 '18 at 16:08
  • 1
    Have a look at Table 2 from the subfig documentation, there is a nice list which arguments/options are possible: i.stack.imgur.com/08ZNb.png – user36296 Feb 25 '18 at 16:10
  • 1
    It's a security issue. You need admin status to update Program Files. And I can never find the manual in Roaming. – John Kormylo Feb 25 '18 at 16:34
  • 1
    @dontpanic Concerning the question how to find out in which package a command is defined: Texstudio has a nice feature for this, right click on a command and you'll get a menu which tells you the name an the package and allows you to directly open the documentation i.stack.imgur.com/xaTQZ.png (works for many but not all packages) – user36296 Feb 25 '18 at 16:38

The standard way to display the manual of a package or class, say pkg.sty (or class.cls), is at the terminal (where > stands for your particular terminal prompt):

> texdoc pkg

Some package manuals show the package code. If that doesn't show the information you are after then, also at the terminal input:

> kpsewhich pkg.sty

which will tell you where the file pkg.sty is located on your system and you can then look at that in all its glory.

  • On a Mac, you can use open `kpsewhich pkg.sty` and it will open with your preferred editor for .sty files. On Linux you can use xdg-open instead of open. Perhaps a similar functionality exists in the Windows command line too. – Alan Munn Feb 25 '18 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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