14

Well, the question is pretty self-explanatory. (I'm writing a short tutorial on LaTeX, and wanted some trivia;)).

3
  • 5
    More than there are stars in the sky... – Stephan Lehmke Sep 19 '12 at 18:42
  • last year > 3100 packages/classes/... – user2478 Sep 19 '12 at 18:56
  • Today's count (2018-09-07): packages 4239, classes 473. – egreg Sep 7 '18 at 22:20
12

TeX Live

TeX Live 2012 (2012-09-19)

$ egrep -c '\.sty$' ls-R
3381
$ egrep -c '\.cls$' ls-R
448
$ egrep -c '\.(sty|cls)$' texmf-dist/ls-R
3829

Windows has findstr, but it has some limitations. For example, it cannot detect Unix line ends or the end of the last line, if the file does not end with a end-of-line marker.

The equivalent for wc -l is find /c /v "", see What is the Windows equivalent of “wc -l”?.

> findstr /c:.sty ls-R | find /c /v ""
> findstr /c:.cls ls-R | find /c /v ""
> findstr /c:.sty /c:.cls ls-R | find /c /v ""

Different method:

$ find texmf-dist/tex/latex \( -name \*.sty -or -name \*.cls \) | wc -l
3148
$ find texmf-dist/tex/generic \( -name \*.sty -or -name \*.cls \) | wc -l
191
$ find texmf-dist/tex \( -name \*.sty -or -name \*.cls \) | wc -l
3500

Windows:

> (cd texmf-dist\tex\latex && dir /s /b *.sty *.cls | find /c /v "")
> (cd texmf-dist\tex\generic && dir /s /b *.sty *.cls | find /c /v "")
> (cd texmf-dist\tex\tex && dir /s /b *.sty *.cls | find /c /v "")

But:

  • False positives: .sty/.cls files that are not LaTeX packages or classes.
  • There are packages that divide their work on smaller units (modules in tikz, …) that are formally LaTeX packages.
  • TeX Live only contains a subset of free packages and classes.

TeX Catalogue

2012-09-19

$ find catalogue/entries/ -exec grep -l '/macros/latex' {} \; | wc -l
2154

Windows:

> dir /s /b catalogue\entries | findstr /m /f:/ /c:/macros/latex | find /c /v ""

But:

  • Not all package in CTAN are in the Catalogue.
  • There are packages outside CTAN:macros/latex/ (e.g. pgf) or packages that can be used in different formats.
  • One Catalogue entry might contain several packages and classes.
  • False positives: Driver files and other stuff (e.g. pdftex-def).
2
  • Can you provide windows version of these commands with FINDSTR in cmd? – Qaher Sep 7 '18 at 21:01
  • 1
    @Qaher See updated answer. Because of the limitation of findstr, the strings .sty and .cls are also be found inside a file name. – Heiko Oberdiek Sep 7 '18 at 22:25
4

On a full MiKTeX installation:

$ find . | grep '\.sty' | wc -l
3498
$ find . | grep '\.cls' | wc -l
349

So about 3500 style files and about 350 class files.

2
  • That are a lot more style files than i thought, based on the number of packages. – Juri Robl Sep 19 '12 at 20:45
  • Why not just find . -name \*.sty | wc -l? (Or even find . -name \*.sty -print0 | xargs -0 -L1 basename | sort | uniq | wc -l, just in case;)?) Anyway, thanks; I didn't do this myself only because I do not have a full TeXlive installation (and I don't want/have time to). – mbork Sep 19 '12 at 21:10
3

At least the MiKTeX Package Manager has 2371 packages at the moment.

2
  • This is probably a good estimate, though obviously some of these either (a) provide more than one package/class or (b) provide no LaTeX packages/classes. – mbork Sep 19 '12 at 18:48
  • 1
    @mbork Or are obsolete. – Qrrbrbirlbel Sep 19 '12 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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