Is it possible to generate .bib file for only those entries which are used in a .tex file?

I have a very big zotero library with lots of entries. For writing a paper in .tex file, I am only using some of those entries for reference. Is it possible to somehow combine .tex file with zotero to prepare a .bib file that only has those entries inside it? I don't want to submit a paper with a very big .bib file with all sorts of unnecessary entries in it.
Thank you!
  • The way I do it: I make a collection with my paper’s references and export it.
  • I just figured out a way. I just compile my .tex file and it actually generates a .bbl file. This .bbl file only has those entries which I have cited in the paper.

    Now by changing
    \bibliography{references}
    to just
    \input{output_bbl.bbl}
    in the .tex file, I could get the same paper. Now, I can use this .bbl to send to others instead of showing my whole Zotero library in the .bib file.
  • BetterBibtex has a filter for this that's probably the most convenient approach
  • Thanks, Adam! Played around and figured out how to do it with BetterBibtex-
    1) Compile the tex project and that will generate a .aux file
    2) Right click on the Zotero library that has all the required references and select scan aux file
    3) A new library will be created in Zotero that only has those entries which are mentioned in the citations of .aux file
    4) Right click on this newly created library, and export collection in the format of your choice (I use better bibtex now)
Sign In or Register to comment.