6

I currently gathering some statistical information about my thesis for reporting purposes. One metric I want to determine is how many sources I have referenced. I have a BibTeX file with more than 150 sources, but I only use a subset in my thesis. Is there a way to count the used sources (the sources in the source-index, not the \cite commands). I don't use a number based short reference and I don't want to change my citation style.

Is there a count-macro or something else to count referenced sources in LaTeX?

  • 1
    The checkcites script does what you want. It's in TeX Live 2011. – egreg Jul 2 '12 at 10:07
  • 2
    How about grep '\\bibitem ' jobname.bbl | wc -l? – Jellby Jul 2 '12 at 10:13
6

If you have an uptodate TeX Live 2011, the checkcites script from the command line does what you want. If your main file is called myfile.tex, compile it as usual and run bibtex. Then

checkcites myfile.aux

will tell you how many entries you have explicitly called and how many have not been referenced (\nocite{*} will not count them).

  • 1
    is there an equivalent in miktex? – martin Jul 2 '12 at 10:34
  • 1
    @martin Sorry, no; I don't know why MiKTeX doesn't install it. However, you can download the script checkcites.lua and execute it with texlua checkcites.lua myfile.aux from a DOS shell. – egreg Jul 2 '12 at 10:38
  • @martin Adding anything executable is slightly more work than adding simple packages, so Christian Schenk (MiKTeX author) may take a little while to add it. You'd be best to ask him directly about this! – Joseph Wright Jul 2 '12 at 10:43
2

Just saw this new package in comp.text.tex: lastbib.

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.