Export references used in LaTeX file to bib file

Is it possible to export the used references to bib file?
As I have hundreds of references, the bib file is too large ...
  • “Used” references in what sense? Can you be more specific? What is the workflow you are using, and what text editor are you using?
  • Like this in the .tex file:

    ```
    As trace gases stay for more than one week in the UT, they are distributed by the upper level winds around the globe \cite{Ridley.2004}.
    ```

    I'm using the Sublime Text.

    Here's the workflow:

    1. Export all references in Zotero to one bib file called references.bib
    2. Cite the bib file in the journal template (tex file):
    \bibliography{references}
    and cite it by typing \cite{} as I use better BibTeX.
    3. Compile the PDF file.

    I want to export only the references used in the tex file to the bib file.
    In this case, it is {Ridley.2004}.
    It could decrease the bib filesize a lot.
  • If you are using Zotero with TeX, you should install the BetterBibTeX plugin. It has much expanded Bib(La)TeX functionality, including the option to control the citekey pattern. It also has a tool to keep a bib file up to date with a collection, so you could add an item to the collection when you cite it, then have the bib file up to date at the end.
  • Thanks. The problem is that I have to create a new collection and copy references to that collection. Is it possible to inverse these used references in Zotero and save them into a new collection?
  • The statements seem ambiguous ...

    Let's assume I have 300 references in "My Library" and export all of them into one bib file.
    I cite 50 of them in the Tex file using BetterBib Tex successfully.
    But, I want the bib file only has the 50 reference information.
  • With BBT, you can use AUX files for creating Zotero collections that contain your cited entries:
    https://forums.zotero.org/discussion/77365/create-bib-file-only-from-papers-cited-in-a-tex-file
    https://retorque.re/zotero-better-bibtex/citing/aux-scanner/

    AUX files are generated when compiling LaTeX documents, see here. Your BibTeX tool might be able to use them for creating .bib files with your cited entries.

    If you have further questions specifically on LaTeX/BibTeX, consider asking for help here: https://tex.stackexchange.com/
  • You can keep asking here. Are all of the cited items currently in your Zotero library?
  • Thanks all!

    Finally, I use the aux scanner and follow the tutorial below to export the subcollection as bib file successfully ;)

    https://forums.zotero.org/discussion/28227/how-do-i-export-a-subset-of-my-library-to-bibtex
Sign In or Register to comment.