<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">you’ll need to write a command in your favorite scripting language (anything from php to Ruby) which takes the document as input, returns a tootip as output, and, in the actual script, does a grep for the section breaks, finds the cites in each, and returns the counts.<div><br></div><div>you can find code that does most of this in the latex bundle. I have some in markdown which also digs through a file looking for citations to return them as options in a cite drop down.</div><div><br></div><div>t</div><div><br></div><div><br><div><div>On 20 Jul 2014, at 13:31, Ross Ahmed <<a href="mailto:rossahmed@googlemail.com">rossahmed@googlemail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="font-size: 14px; font-family: Calibri, sans-serif;">Hi all</div><div style="font-size: 14px; font-family: Calibri, sans-serif;"><br></div><div style="font-size: 14px; font-family: Calibri, sans-serif;">I want to count the number of citations contained within a .Rnw file and show the result as a tool tip.</div><div style="font-size: 14px; font-family: Calibri, sans-serif;"><br></div><div style="font-size: 14px; font-family: Calibri, sans-serif;">My .Rnw file looks like this:</div><div style="font-size: 14px; font-family: Calibri, sans-serif;"><br></div><div style=""><div>\section{Methods}</div><div><br></div><div><<plot_mtcars>>=</div><div>plot(mtcars)</div><div>@</div><div><br></div><div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat \citet{Author2014, AuthorEtAl2014}. \citet{AuthorAuthor2013} duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div><div><br></div><div>\section{Results}</div><div><br></div><div><<plot_iris>>=</div><div>plot(iris)</div><div>@</div><div><br></div><div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \citet*{Author1998} ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum \citep*{Somebody2014}.</div></div><div style=""><font face="Consolas" style="font-size: 12px;"><br></font></div><div style=""><br></div><div style="">Note that citation keys will be in one of these 3 formats: <span style="font-family: Consolas; font-size: 12px;">Author2014, </span><span style="font-family: Consolas; font-size: 12px;">AuthorAuthor2014 </span>or<span style="font-family: Consolas; font-size: 12px;"> </span><span style="font-family: Consolas; font-size: 12px;">AuthorEtAl2014. </span></div><div style=""><span style="font-family: Consolas; font-size: 12px;"><br></span></div><div>I would like to count the total number of citations within the .Rnw file and the number in each section. In above example there are 3 citations in the Methods section and 2 citations in the Results section.</div><div><br></div><div>Is this possible?</div><div><br></div><div>Thanks</div><div>Ross</div><div style="font-size: 14px; font-family: Calibri, sans-serif;"><br></div><div style="font-size: 14px; font-family: Calibri, sans-serif;"><br></div></div>
<br>_______________________________________________<br>textmate mailing list<br><a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>http://lists.macromates.com/listinfo/textmate</blockquote></div><br></div></body></html>