[texhax] Frequency of Reference Citations

Uwe Lueck uwe.lueck at web.de
Mon Nov 29 07:22:21 CET 2010

> On 2010-11-28 21:15, Sam Albers wrote:
>> On Sun, Nov 28, 2010 at 10:46 AM, Sam Albers <tonightsthenight at gmail.com
>> <mailto:tonightsthenight at gmail.com>> wrote:
>>     For example, does anyone know of a tool that could output not only the
>>     references I've used but also how many times I cited each reference?
>>     Similarly, does any know of a tool (maybe the same one?) where I can
>>     get a word frequency list for a document organized like mine?

"Lars Madsen" <daleif at imf.au.dk>, answered on 28.11.2010 22:02:40:
> each reference will be in the aux files, so just write a tool in any 
> scripting language to retrieve the data and do analysis, should be easy 
> enough

Or, if you really love TeX, read the .aux with redefined macros
(most just gobbling), such that the first citation of ... 
(i) creates a macro by some \csname ... ...\endcsname expanding to 1 
(ii) appends some \par ...: and the macro to a list macro \listofcitations, 
next occurrences do

    \count@=\csname ... ...\endcsname \advance\count@\@ne 
    \expandafter\edef\csname ... ...\endcsname{\the\count@}

Use LaTeX's \@ifundefined{... ...} to test whether it's the first citation or 
another one. 

Finally write \listofcitations into a text file, then perhaps, ahm, 
by some "sort" tool, order the lines of that text file alphabetically ...

I have done a similar thing in summer, but I don't have the 
macros any more.

Happy TeXing, 


More information about the texhax mailing list