# Compiling documentation of a package

I have extracted the documentation of the longtable package and I want to compile it alone. By extracting the documentation I mean that I have copied the .dtx file from the \maketitle to the end and I've pasted it in a tex file, so I have something like:

\documentclass{ltxdoc}
\usepackage{longtable}
\begin{document}

\title{The \textsf{longtable}...
...
\end{document}


I have a minimal scheme tlmgr installation with the packages:

latex latex-bin koma-script tools amsmath babel carlisle ec geometry graphics hyperref lm marvosym oberdiek parskip pdftex-def url hyphen-spanish


Right know I'm getting the error:

! Undefined control sequence \fileversion


I want to know what to do to compile it without errors. The reason is I want to give just the source of the translated documentation attached to it.

• why? But anyway you must be doing something wrong and you haven't provided a usable log. longtable uses the doc package for documentation and that defines \fileversion – David Carlisle Feb 14 '15 at 23:56
• what do you mean by "extracted" longtable.dtx is distributed in that form, there is nothing to extract, just process it with pdflatex. (or in any modern tex distribution just use texdoc longtable and the documentation will be displayed) – David Carlisle Feb 14 '15 at 23:59
• Why aren't installing packages the sane way using tlmgr? – cfr Feb 15 '15 at 0:31
• Also, you have already installed longtable. It is included in the list of packages you posted in the question. (It is part of tools.) Unless you have set things up very non-standardly, you therefore already have a compiled copy of the documentation. – cfr Feb 15 '15 at 0:33
• In your edited question you have shown a file that isn't the longtable documentation. Just do pdflatex longtable.dtx – David Carlisle Feb 15 '15 at 11:22

ltxdoc is designed to be used as an extension of doc with source files in doc format written as comments on the source file. If used in that way, doc arranges for \fileversion to be defined based on the \ProvidesPackage argument in the documented sources.
In comments it is clear that the intention is to produce translated documentation. For that I think it is better to make a normal (say article class) document that translates/paraphrases the documentation as necessary and doesn't aim to look like a documented source and in particular is distributed without copying the original package.