/get-bibs.sed

https://code.google.com/p/latex-makefile/ · sed · 23 lines · 7 code · 8 blank · 8 comment · 0 complexity · 2c088b4e2a49ce5fffa2c3d4a1422e6d MD5 · raw file

  1. #(##defaults(target_files="TARGET_FILES")##)
  2. # Parses a .aux file to find bibdata information
  3. /^\\bibdata/!d
  4. # Remove the \bibdata{} from around the pertinent information
  5. s/\\bibdata{\([^}]*\)}/\1,/
  6. # Ignore -blx files - they change frequently without affecting the build.
  7. s/[^,]\{1,\}-blx//
  8. # Collapse comma sequences
  9. s/,\{2,\}/,/g
  10. # Escape spaces in file names
  11. s/[[:space:]]/\\&/g
  12. # Change to a space-delimited list of .bib names
  13. s/,/.bib /g
  14. # Remove all trailing spaces
  15. s/ \{1,\}$//