# How to run latex doc.dtx?

I am learning LaTeX from lshort. Page 12, Table 1.3: Some of the Packages Distributed with LaTeX, contains the following.

doc Allows the documentation of L A TEX programs.

Described in doc.dtxa and in The L A TEX Companion

The footnote for doc.dtx says this,

a This file should be installed on your system, and you should be able to get a dvi file by typing latex doc.dtx in any directory where you have write permission. The same is true for all the other files mentioned in this table.

I am using texlive on Debian 8.3.

When I run the `latex doc.dtx` command, I get the following error.

``````\$ latex doc.dtx
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
! I can't find file `doc.dtx'.
<*> doc.dtx

(Press Enter to retry, or Control-D to exit)
Please type another input file name:
! Emergency stop.
<*> doc.dtx

No pages of output.
Transcript written on texput.log.
``````

What am I missing? How can I run this command successfully?

``````\$ dpkg -l | grep texlive
ii  texlive                               2014.20141024-2                      all          TeX Live: A decent selection of the TeX Live packages
ii  texlive-base                          2014.20141024-2                      all          TeX Live: Essential programs and files
ii  texlive-binaries                      2014.20140926.35254-6                amd64        Binaries for TeX Live
ii  texlive-extra-utils                   2014.20141024-1                      all          TeX Live: TeX auxiliary programs
ii  texlive-font-utils                    2014.20141024-1                      all          TeX Live: Graphics and font utilities
ii  texlive-fonts-recommended             2014.20141024-2                      all          TeX Live: Recommended fonts
ii  texlive-fonts-recommended-doc         2014.20141024-2                      all          TeX Live: Documentation files for texlive-fonts-recommended
ii  texlive-generic-recommended           2014.20141024-2                      all          TeX Live: Generic recommended packages
ii  texlive-latex-base                    2014.20141024-2                      all          TeX Live: LaTeX fundamental packages
ii  texlive-latex-base-doc                2014.20141024-2                      all          TeX Live: Documentation files for texlive-latex-base
ii  texlive-latex-recommended             2014.20141024-2                      all          TeX Live: LaTeX recommended packages
ii  texlive-latex-recommended-doc         2014.20141024-2                      all          TeX Live: Documentation files for texlive-latex-recommended
ii  texlive-pictures                      2014.20141024-2                      all          TeX Live: Graphics, pictures, diagrams
ii  texlive-pictures-doc                  2014.20141024-2                      all          TeX Live: Documentation files for texlive-pictures
ii  texlive-pstricks                      2014.20141024-1                      all          TeX Live: PSTricks
ii  texlive-pstricks-doc                  2014.20141024-1                      all          TeX Live: Documentation files for texlive-pstricks
``````
• Do you want to actually typeset it yourself or simply read it? If the latter, `texdoc doc`. – Joseph Wright Jun 16 '16 at 16:02
• I'd recommend you copy the source to your working directory, e.g. on *nix `cp `kpsewhich doc.dtx` .` – Joseph Wright Jun 16 '16 at 16:03
• @JosephWright `texdoc doc` worked. But `cp `kpsewhich doc.dtx` .` failed with this error: `cp: missing destination file operand after ‘.’`. In fact, `kpsewhich doc.dtx` outputs nothing. – Lone Learner Jun 18 '16 at 4:14
• In that case you've not installed whichever Debian bundle has `doc` in it. Like many people here, I use TeX Live directly from TUG and install 'everything', so I'm not sure which part you need (it will be in one of the `sources` I guess). – Joseph Wright Jun 18 '16 at 6:38