Questions about dtx, LaTeX self-documenting code system

learn more… | top users | synonyms

26
votes
5answers
2k views

Side-by-side source and output when documenting a style file

When documenting a style file, it would be nice to be able to easily put side by side different examples of code, side-by-side with the output they produce. What recommendations to people have to do ...
24
votes
2answers
18k views

How do I install a .dtx file?

When I run: tex algorithms.dtx for example, I get this message. ! Undefined control sequence. l.34 \documentclass {ltxdoc} ? Help?
15
votes
2answers
1k views

Editor for DTX files

DTX files are based on LaTeX comments, which means that any editor that can highlight LaTeX code will print most of the DTX files - all the documentation - as a comment and thus not highlight the ...
15
votes
2answers
423 views

Multiple documents from a single dtx

The DTX format allows to generate both the package code (.sty file) and documentation (.pdf file) from a single dtx file. Is it possible to generate several PDFs (for example for different languages) ...
12
votes
3answers
410 views

What to put into the dtx file?

Many packages are written as a single dtx file from that everything that composes the package is extracted. Apart from documentation and package code (the sty or cls), the installation instructions ...
11
votes
3answers
237 views

What does the “driver” section do in a .dtx file?

I've read the docstrip documentation, but have yet to form an intuition about how package documentation is extracted when I simply run pdflatex package.dtx. Let's say I'm using the simple dtxtut ...
11
votes
3answers
416 views

(How) Can I write a .dtx file without having to comment out *everything*?

I have a reasonable understanding now of how .dtx files work. But it's a great pain having to put a % character before every line of documentation. Also, depending on which editor you're using, it ...
10
votes
2answers
343 views

How to add listings environment to DTX files

I am working on my first DTX file and want to add a code example, which shall be printed with listings. This works so far, but since the documentation is commented the listings code is using a full ...
9
votes
2answers
165 views

What is the ^^A in DTX sources?

After fleshing out (with my own project) Joseph Wright's lovely model, I've noticed that the explicit control character ^^A is used at the end of some lines. Its use appears similar to that of % to ...
9
votes
2answers
12k views

Where do I get the everyshi.sty file from?

I've downloaded and unzipped the ms folder which supposedly has the everyshi.sty file; however, to my dismay, the folder has every other file but that one! As a result, I'm failing to run TikZ, since ...
9
votes
1answer
254 views

How do I move the package implementation to the back of the documentation?

I'm trying to learn how to use .dtx files, docstrip etc to produce both package code and documentation from a single file. My primary source of information so far has been Joseph Wright's model dtx ...
8
votes
2answers
130 views

How to “\DoNotIndex \,” in a dtx file?

I'm using \EnableCrossrefs in a dtx file. In the index I now have \, indexed. I tried \DoNotIndex{{\,}} and \DoNotIndex{\thinspace} without success. Is there a way to prevent the inclusion of \, in ...
7
votes
2answers
540 views

dtx file: how to run it?

I want to clarify first that I am a beginner, and thus my question might be imprecise or inadequate. Anyway: I found this documentation file for the package microtype, can be easily found on ctan. It ...
7
votes
2answers
171 views

How to document a expl3 macro using dtx

I am writing the documentation to a package implemented in expl3 using ltxdoc, and the relevant part would look like % \begin{macro}{\conteq_args_once} % Some explanation % % \begin{macrocode} ...
7
votes
1answer
167 views

Conflict between verbatim.sty and ltxdoc.cls

I am writing a package which uses the verbatim package. \RequirePackage{verbatim} For the documentation I'm using the ltxdoc class. So I have to put an % character before every line of the ...
7
votes
1answer
185 views

How to get a correct README when using a dtx file

I use Joseph Wright's model dtx file. Unfortunately, when using it, the generated README.txt file contains parts of the package code, which is of course unwanted. The rather long minimal example is ...
7
votes
1answer
276 views

getfileinfo not working in Joseph Wright's model dtx file creating a class

I love Joseph Wright's model dtx file for style file creation, but would like to use it for classes, too. So I did some replacements in it (sty -> cls and the like) and got this democls.dtx: % ...
6
votes
2answers
160 views

dtx file and history

The \changes command of DTX file is used to record changes. The \PrintChanges command print the list of change, sorted by number ... except when a number is greater than 10. To see the problem, I ...
5
votes
2answers
748 views

How to use condensed typewriter with latin modern and doc

I'm documenting a class with (ltx)doc. The macro names are quite long so I get a lot of overfull hboxes. AFAIK latin modern has an additional typewriter font which is condensed. How do I switch the ...
5
votes
1answer
145 views

\inputencoding{latin1} cannot be used in the user documentation of a .dtx file if it is \DocInput

Third edit: (As pointed out by Ulrike, my problem in fact doesn't concern listingsutf8 but only inputenc, so I reflect this by giving to the question another title and another MWE.) The following MWE ...
5
votes
1answer
280 views

What exactly happens when LaTeX runs on a dtx file?

I am confused on how docstrip/ltxdoc really runs. It seems that LaTeX runs twice when called on such a simple dtx file. % \iffalse %<*installation> \expandafter\begingroup \input docstrip.tex ...
5
votes
1answer
289 views

disable index creation in dtx file

The following code is a minimal dtx code with ending .tex (only for the example). I try to understand when an index created and when not, how this is influenced by the loading of hyperref and fail to ...
5
votes
2answers
2k views

Can I convert a dtx file to tex file

I know dtx file is literate programming style file. I also know that I can compile it with pdflatex to generate pdf file. But I wonder could I just extract the tex code to a independent file? I think ...
5
votes
1answer
3k views

Manually install packages from dtx file on ubuntu [duplicate]

Possible Duplicate: How do I install an individual package on a Linux system? My TeXLive doesn't have the standalone package. I read part of the documentation, the PDF file from the ...
5
votes
1answer
39 views

Can I mark an internal function or variable as 'not documented' in l3doc?

There are several internal variables I use that I do not see a need to document in the user-interface section, but I want to explain in the implementation. I'd really like to remove the warnings ...
5
votes
1answer
68 views

.DTX won't load corresponding .STY

I'm preparing a documented source for a package file and I basically use the skeleton from the ltxdoc manual verbatim. For some reason, when I compile the .dtx to generate the documentation, it just ...
5
votes
1answer
106 views

DTX file generates empty file

I recently gave the documentation of my chscite package a facelift for inclusion in CTAN, and was assuming that doing so wouldn't break anything. Unfortunately, I just discovered that the package ...
5
votes
0answers
147 views

Makefile in packages with UNIX commands and latexmk?

What are the rules regarding writing Makefiles to be part of CTAN packages? I would like to include a Makefile in a package I wrote. The package is in .dtx format with its .ins file embedded. When I ...
4
votes
2answers
611 views

Download all dtx from CTAN

I've written some code to extract some help from dtx files (documented package), and I have tested it on a few packages for which I had the .dtx. It seems, however, that .dtx files are not shipped ...
4
votes
2answers
91 views

Why is it not possible to embed \if construction in docstrip

I would like to create a DTX files which could be compiled in two different ways depending of a user's choice. One way to get only the user documentation, and another to get user documentation and ...
4
votes
2answers
134 views

A dangerous \if@ in the dtx preamble

Why does the following .dtx not compile, while the equivalent .tex file does? (You must name the file error.dtx, that's what \DocInput includes.) DTX: % \iffalse meta-comment %<*driver> ...
4
votes
1answer
91 views

index completely messed up in dtx file

I fight with the strange and useless entries of the index in dtx files. It can reproduced with % \iffalse %<*driver> \ProvidesFile{dtxcode.tex} %</driver> % %<*driver> ...
4
votes
1answer
56 views

How to display the dates in the \PrintChanges' changes?

An information I'm often missing when I have a look at the "Change History" of a package/classe is the dates of the changes because, IMHO, just the version number is not informative enough: if I could ...
4
votes
1answer
187 views

What path provide in a .dtx file (located in source/ folder) to reach files located in doc/ folder?

For a class I want to upload on CTAN, I'd like the provided files to be organized as follows when installed by TeX distributions: 〈ROOT PATH〉/doc/latex/myclass/ myclass.pdf sample/sample.tex ...
4
votes
1answer
72 views

Tabular in dtx documentation

How to make table in .dtx documentation with vertical bars? % \begin{tabular}{c|c} % |sf| & \emph{mathsf}\\ % \end{tabular} fails, because |foo| is magic for verbatim.
4
votes
1answer
846 views

Is it possible to extract a .cls from a .dtx and avoid the Two \LoadClass commands error?

I have tried to adapt Joseph Wright's model dtx file for a class that I'm writing based on the article class (a reduced working example is below, which I have named democlass.dtx). But when I run ...
4
votes
1answer
202 views

how to organise common preamble of dtx files

I have some new packages (see latexthesistemplate/trunk/packages/template which all use a shared preamble file. I want all of them to have the same packages and commands available and the same ...
4
votes
1answer
98 views

\batchinput (docstrip) in a different directory

docstripprovides the macro \batchinput, which calls a separate ins file. This file can be in a different directory with, say: \batchinput{../contrib/xx.ins} and they are generated, but in the same ...
3
votes
1answer
169 views

Removing \CheckSum and \CharacterTable for some generated files

How can you prevent \CheckSum and \CharacterTable appearing in some of the generated files (examples include README, ChangeLog, LaTeX example files, ...)?
3
votes
1answer
242 views

Avoid: multicol Error: Error saving partial page

In my package I am using in the dtx file the ltxdoc class which uses multicol for the index. Currently I get this error: ! Package multicol Error: Error saving partial page. See the multicol ...
3
votes
1answer
29 views

SB@ in dtx and sty files

When reading several dtx files in order to write my own, I saw the command \SB@... in front of several other commands. What does it mean? I could not find reliable sources as explanation.
3
votes
1answer
24 views

Creating csv files from .dtx: blank line at top

I'm working on a .dtx project in which I might embed data in the .dtx to be written to a couple of .csv files. The problem I'm encountering is that a line feed character is inserted before the first ...
3
votes
1answer
43 views

use multiple .dtx file to make only .sty file

I would like to split the voluminous .dtx of eledmac in multiple .dtx file. 1) one for the user handbook 2) many other for the package code + handbook. So my objectives are: 1) have multiple .dtx ...
3
votes
0answers
21 views

Including compiled PDFs in documentation built by l3build

I am building a project with l3build. There are some examples I want to present in the documentation, showing their source code, annotated with DocStrip, as well as including the output they produce ...
2
votes
1answer
135 views

dtx: add code to sty file without printing it to pdf

I want to add comments to the sty file that should not be printed to the pdf, because the description is almost identical. Is it possible to configure the dtx file, such that not every code added to ...
2
votes
2answers
248 views

How can i pull an example out of a dtx file?

The central question is how can i convert a part of a dtx file to straight LaTeX. In learning more about a package, I want to play with an example from a dtx? The output shows up in the pdf. The ...
2
votes
1answer
53 views

Add something to the driver section inside the package code using \OnlyDescription

I would like to be able to add something to the documentation of a package in dtx format but using \OnlyDescription. I don't want the Implementation section, but somewhere on the package code I want ...
2
votes
1answer
3k views

When using Caption Package, I receive: “Undefined control sequence \captionsetup ”

I introduce a figure as follows: \begin{figure} \centering \includegraphics[scale=0.300]{Figure.eps} \caption{Caption for the figure} \label{a} \end{figure} In the preamble I have written: ...
2
votes
1answer
111 views

Resetting line count in dtx files

I'm writing a dtx file containing several source files. Is there a way to reset the line counter when commenting the code of a different file? My dtx file looks something like this: .... %\iffalse ...
2
votes
2answers
1k views

Undefined control sequence: \undefinedpagestyle at \end{macrocode}

The full source can be found here (static link), but here is the relevant bit: ... % \begin{macrocode} %<*package> % \end{macrocode} % \begin{macro}{\BCSet} % And stuff % ...