Right now, I am documenting a larger LaTeX package project by converting the files into DocStrip files. Therefore I am currently creating a lot of .ins and .dtx-files in Emacs.

Actually I am using AUCTeX, but its support for this tasks lacks a lot of the usual comfort.

For example: in the .ins-batchfiles, I very often need to insert constructs as


I can of course type C-cRET to insert the macro \file. But in that case, only \file{} is inserted. As you can see, \file originally uses two arguments, and I would like Emacs/AUCTeX to ask me for the file name to generate and---ideally---also to ask my from which sources and optionally guards to use, before inserting


as result in the current buffer.

Same applies to the \generate-macro.

I haven't found any clues on the internet. Are there any packages, which support this behaviour or do I need to code them myself?

  • 1
    AUCTeX does not have a style file for docstrip. To your question, I think you have to code it yourself. Ideally, that code will be part of AUCTeX then :-). Commented Mar 12, 2017 at 13:06
  • 1
    @ArashEsbati I began to work on it. Stay tuned.
    – Jan
    Commented Mar 12, 2017 at 20:51

1 Answer 1


AUCTeX doesn't have a style file for docstrip. If you're going to write it for your own purposes, please consider submitting it to AUCTeX as well.

You will have to assign the copyright to FSF. If you want to start the process, please follow the instructions described here.

  • Arash, I would be really glad, if my code would be accepted by AUCTeX, that would be a great honor. I have gained so much from free software, that my code will be frei either.
    – Jan
    Commented Mar 16, 2017 at 20:52
  • @Jan - If you have any questions, drop a line to [email protected]. Commented Mar 19, 2017 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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