aleix's blog

Easy acronyms generation

22 February 2007 5:01 pm (latex | python)

At work, we needed a way to easily generate a list of acronyms of our documents, so I wrote an script ( that parses the acronyms in a specified LaTeX file and tries to find a description (specified as a nomencl definition) in the files (*.tex) located in a directory. The script will create two files: one with acronyms and their descriptions and the other with conflicts, that is, acronyms with no or duplicate description.

The following example is a sample of an acronyms list file. Note that the LaTeX document must use the nomencl package, since the acronyms are defined using the nomencl syntax.

\\nomenclature{ANSI}{American National Standards Institute}
\\nomenclature{API}{Application Programming Interface}

It is also possible to provide a list of words to be excluded in the exclude_acronyms.txt file, that must be located in the data directory by default (a different file can be specified using -x). For example:


It is easy to find words to be excluded because they will be treated as errors (and written to the errors file) as no definition is available for them.

Finally, it is possible to parse the input files recursively passing the -r argument. This will parse all the files included with \input.

A possible program call could be: -r -d ~/acronyms -i article.tex -o acronyms.tex \
                -e acronyms.errors

where the acronyms found in the article.tex file (and its dependencies) will be matched against the acronyms found in ~/acronyms/*.tex. The matched acronyms will be written to acronyms.tex and the errors in acronyms.errors. Now, you just need to include acronyms.tex in your document.

Update 2010/10/22: Check script updates in the new article More on easy acronyms generation.

Update 2007/02/23: GlossTeX does the same (and much more) but à la TeX way.

17 responses

  1. Jim Hefferon says:

    Have you considered uploading it to CTAN?

  2. vincenzo says:

    This is ok for old documents,
    for the new ones, I suggest to use the acronym latex
    package while writing.

  3. Ed says:

    This also can be good for any of for using.homepage

  4. Coursework Homework Help says:

    Amazing article thanks or sharing..

  5. Project on Engineering says:

    This is great information for students. This article is very helpful i really like this blog thanks. I also have some information relevant for online dissertation help.

  6. Buy Harvard Business Case Studies Solutions says:

    Get the dissertation writing service students look for these days with the prime focus being creating a well researched and lively content on any topic.

  7. pożyczki przez internet says:

    You have really shared a informative and interesting blog post with people..

  8. john443s says:

    Do you have any answer for this?

  9. Custom Paper Writing Company | Toppaperservice says:

    it as of now influences people groups capacity to convey disconnected. im not going to sound misleading however, I utilize all that stuff as well, and what I say to my companions and what they say to me truly has neither rhyme nor reason once in a while, yet we comprehend what we mean.

  10. pexe jurer says:
  11. jack says:
  12. jack says:
  13. jack says:
  14. Reviews says:

    In today’s time students face the problem of stress in college. Whether it is because of social anxiety, or not being able to clear exam etc. Most of the times, students get stressed due to their piled up assignments. If it is with you also then you might look for Reviews.

  15. twitch says:

    Very good, I think I found the knowledge I needed. I will see and refer some information in your post. thank you

  16. Steven says:

    Oracle Exam Preparation Material
    Certification Coaching is a platform where certified professional participate in discussions and help people to successfully pass thier exams for certification.

  17. brain teaser games says:

    I appreciate the effort you put into this but the post is mostly nonsense and covers a very thin argument. I suggest you beef up your info bank first so you can come up with a more decent entry next time.

Leave a Reply