How do I install a .dtx file?

Depending on how the .dtx is constructed, it may not work at all with TeX: you have to use (pdf)latex. To unpack the file you may well need an .ins file.


I was having difficulty to understand the accepted answer. It's not the fault of the answer, just that the accepted answer was not targeted to novice (like me). So here is what I figured that I need to run to get the sty file from a dtx:

tex algorithms.dtx

I ran this for pullquote, and got the following response (and the required .sty file):

This is TeX, Version 3.14159265 (TeX Live 2018) (preloaded format=tex)
(./pullquote.dtx
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/docstrip.tex
Utility: `docstrip' 2.5e <2014/09/29>
English documentation    <2017/03/13>

**********************************************************
* This program converts documented macro-files into fast *
* loadable files by stripping off (nearly) all comments! *
**********************************************************

********************************************************
* No Configuration file found, using default settings. *
********************************************************

)

Generating file(s) pullquote.sty

Processing file pullquote.dtx (package) -> pullquote.sty
File pullquote.dtx ended by \endinput.
Lines  processed: 2209
Comments removed: 1500
Comments  passed: 0
Codelines passed: 692


Generating file(s) pullquote.ins

Processing file pullquote.dtx (install) -> pullquote.ins
File pullquote.dtx ended by \endinput.
Lines  processed: 2209
Comments removed: 1500
Comments  passed: 0
Codelines passed: 692


Generating file(s) README.txt

Processing file pullquote.dtx (readme) -> README.txt
File pullquote.dtx ended by \endinput.
Lines  processed: 2209
Comments removed: 1500
Comments  passed: 0
Codelines passed: 692

Overall statistics:
Files  processed: 3
Lines  processed: 6627
Comments removed: 4500
Comments  passed: 0
Codelines passed: 2076
 )
No pages of output.
Transcript written on pullquote.log.

(This should really be a comment, but I don't have enough reputation for that)


Joseph Wright says "run latex on the .ins"; however, if you have LaTeX, you also have ltxdoc.cls, etc., so that unpacking the .dtx doesn't help.

Processing the .dtx file with (pdf)latex gives all you need -- a file of documentation.

Tags:

Installing

Dtx