# Tag Info

13

You can probably go texdoc docstrip to get the documentation for it or there is a copy here http://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/base/docstrip.pdf It is a set of tex macros distributed as part of the core LaTeX which produces packages and class files .sty and .dtx by removing comments from documented versions (usually .dtx files. It ...

11

DocStrip is primarily method for removing comments from source files. While not such a big issue today, historically it was desirable to convert % Some comment about code % More comments about code \CodeIsHere % Followed by more description to just \CodeIsHere as TeX has fewer lines to process and so will read a file more quickly. DocStrip is able to ...

9

A 'classical' (~LaTeX2.09) .dtx file contained the source and documentation for (usually) a LaTeX package, but not the instructions to extract the package from the source or to typeset the documentation. As such, latex foo.dtx would not result in useful output. To allow extracting, an installation (.ins) file was needed, and to allow typesetting a driver ...

9

In the original plan of docstrip the documented source would be in the .dtx file and a separate LaTeX "driver" document, which could be .tex except that might clash with files that are being generated, would be used to input the doc package and produce the documentation, and a third .ins file would be used with docstrip to control the generation of the ...

9

If you look at the history of doc, then it is understandable why the current system works as it works. Initially the idea as to write a .sty file with the comments imbedded, but in a way that it would directly be processable by LaTeX. And that required putting every bit of documentation behind % signs. Only later docstrip appeared (to strip the comments ...

7

If ^ has its usual superscript meaning then ^^A is built-in primitive TeX syntax for the non-printing character control A (that is U+0001) 64 less than A. This is just an arbitrary character that Frank chose as being unlikely to be used elsewhere. The important thing about it in this context is that doc.sty does \catcode`\^^A=14 ...

5

you can use \generate{\nopreamble\nopostamble .... To stop docstrip adding anything to the file but the character table and \CheckSum is not generated text it is just copied from the source dtx file as literal %% comments. So if you don't put it in the source it won't be in the result. Or if you want it in some files but not others, use docstrip guards ...

5

In .dtx files the sequence ^^A replaces the standard % to introduce comments. .dtx files are usually processed through doc and docstrip which don't consider % a comment. In fact, when you run latex (or pdflatex) on a such structured .dtx file, it is actually evaluated twice. The first time, only a small piece of driver code is evaluated. The second time, ...

2

TeX Live sets up his options in the file texmf.cnf located in texlive/20XX/texmf/web2c/ However this file needn't to be edit. You should edit instead the file texmf.cnf in the directory texlive/20XX/. In the main file you will find the following hint: % Allow TeX \openin, \openout, or \input on filenames starting with `.' % (e.g., .rhosts) or outside the ...

1

Ok, so maybe it's not possible to do this elegantly using the 'standard' way of running the .dtx file through LaTeX to get the docs. But I have an alternative solution here which seems just as nice. With this setup, there is only one file (the '.ins file' is included). You run it through LaTeX and it generates package.sty and package.tex. To get the actual ...

1

Here is the skeleton of the dtx of a package I have written and which will appear in a few days on CTAN (the current version on CTAN does not yet have this structure of the dtx file) %<*none> % This skeleton PKG.dtx file is one way to not have everything commented % out in the documentation part. It produces the .sty file (and also an % .ins file) ...

1

AFAIK, most package documentation actuall has one section consisting of user interface documentation (options, user-level commands) and one section containing the implementation details of the package (with useful comments, documented side effects of internal macros, and so on). The documentation of e.g. amstext, fixmath or microtype illustrate this. Larger ...

Only top voted, non community-wiki answers of a minimum length are eligible