I have three .bib files with the bibliography of my CV split into "journals", "conferences" and "thesis". I count the amount of entries for each .bib file following this method for the three types:



\defbibheading{journals}{International Journals}

... and thenn I print the result in a specific section as follows:


    \item Number of International Journals: \total{no_journals}\

For my long CV it works fine; however for the résumé, I only want to put the total amount of journals, conferences and thesis WITHOUT printing the full bibliography. For this purpose, I have the following command:


    \item International Journals: \total{no_journals}\, International Conferences: \total{no_conferences}\, Thesis Conducted: \total{no_thesis}\

As you can see in the command itself, if I do not invoke "\printbibliography" for each of the types (journals, conferences and thesis), the entries in the bibliography files are not counted.

  • Is there any way in which I can count them without invoking "\printbibliography"?
  • If there is no other chance than having to invoke "\printbibliography" mandatory, can I make it not print the bibliography? Like a "dry-run" method?
  • 2
    Without testing: \setbox0\vbox{\printbibliography} doesn't print anything and still evaluates \printbibliography. – Skillmon Dec 2 '17 at 23:00
  • 1
    Please make your code snippets compilable ... – Mensch Dec 2 '17 at 23:03
  • @Skillmon : that answer is correct, it works. Would you please post this as an answer, so that I can mark it right? – Ricardo Dec 2 '17 at 23:23

To execute some code without printing it you can execute it in a \setbox, this stores the result in the used box, so \setbox0 stores the results in box register 0 (which is a scratch register for temporary use). It also requires the type of box where we choose \vbox because this allows more stuff than \hbox to be its content. So to use \printbibliography without typesetting it, you can use:

| improve this answer | |

If the entries are \nocite'd or \cite'd you can use \AtDataInput instead of \AtEveryBibitem





journals: \arabic{no_journals}, theses: \arabic{no_thesis}

\AtDataInput is executed once per refsection for every entry in the .bbl when the .bbl file is read. \AtEveryBibitem is executed for every item printed in \printbibliography.

| improve this answer | |

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.