Some time ago I started to create my own class and these moments my purpose is to create the documentation. I would like to know if to create the documentation of my class I should be guided by this link or simply create a document using LaTeX and explaining the code.

I also found the following documentation How to Package Your LaTeX Package that has been very useful for me, but still I do not understand how from my class myclass.cls I can generate the documentation using dtx. I also tried to use the skeleton A.4 mentioned in the previous link but I get the error !LaTeX Error: File myclass.dtx not found.

Thank you all for your suggestions and answers.

closed as primarily opinion-based by Werner, Raaja, user156344, Stefan Pinnow, Dox Mar 22 at 19:06

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    I'd choose the second way. I love the simple. But this is opinion-based. You can choose whatever you want. – user156344 Mar 22 at 16:18
  • 1
    The advantage of dtx is it is a common format that everyone understands, and encourages you to have your comments alongside your code. The disadvantage is that you have to understand the two or three different outputs that a dtx file can have. – Teepeemm Mar 22 at 16:36
  • I really would like to learn about dtx, could you tell me some source of information, examples, etc. Thanks in advance. – Joan Mar 22 at 16:58
  • 1
    texdev.net/2009/10/05/the-dtx-format and texdev.net/2009/10/06/a-model-dtx-file are two great posts to get you started. My feeling is that .dtx is extremely useful if you want to document your code/implementation. For user-level documentation .dtx is not always that advantageous (depending on your project), because the order and explanations of the implementation may not follow the 'natural flow' you would want your usage documentation to have. In that case the .dtx is still a nice way to pack up everything in one file, though (if you like that sort of thing). – moewe Mar 22 at 18:45

I know that this is opinion based but I like the doc (aka dtx) (> texdoc doc) system for specifying and documenting LaTeX class and package code. In one document you can have the code, explanations of the code, a user manual, and other related things. If you ever have to update something then it can all be done in one file.

As an aside, in the past, I have used extensions to the doc system for documenting MetaPost, C, Java, and EXPRESS code.

Not the answer you're looking for? Browse other questions tagged or ask your own question.