Last active
February 22, 2024 06:45
-
-
Save ahmed-shariff/ac19a0e328d33bd0e93bb0bc1a781844 to your computer and use it in GitHub Desktop.
Generate bib file from master file locally, use local bib on overleaf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Close to the end of main tex file, have this: | |
| % from https://tex.stackexchange.com/questions/596258/automatic-detection-of-overleaf-for-fallback-images/598669#598669 | |
| \ifnum\pdfstrcmp{\jobname}{output}=0 | |
| \bibliography{bibliography.bib} | |
| \else | |
| % wherever the master bib file is | |
| \bibliography{\string~/Documents/org/bibliography/references.bib} | |
| \fi | |
| % If using reftex-create-bibtex-file, use the following. | |
| % It doesn't know how to handle the `\string` | |
| % \bibliography{~/Documents/org/bibliography/references.bib} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This should be in the .git/hooks/pre-commit file | |
| echo "generating bibliography.bib from master bib file" | |
| # Asuming main.tex is the main file & bibliography.bib is the project bib file | |
| bibexport -o bibliography.bib main.aux | |
| git add bibliography.bib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment