wiki:WikiStart

Dit is de Wiki van het DJANGO project

De projectgegevens van dit project zijn:

Project identifierIST:QI:DJANGO
Korte beschrijvingDjango scripts
Subversion URLhttps://svn.tnw.tudelft.nl/IST-QI/DJANGO/
Trac URLhttps://svn/trac/IST-QI/DJANGO/
ViewVC URLhttps://svn.tnw.tudelft.nl/viewvc/IST-QI-DJANGO/

Howto: import BibTeX file

BibTeX files (.bib) can be imported using the parsebib.py script which is available in django/mysite/papers/. This script makes heavy use of the parse_file and parse_string from zs.bibtex.parser.

  • prepare the bibfile for importing
    • make sure only ASCII characters are used: recode -d u8..latex < in.bib > out.bib
      • Note: make sure the in.bib file only contains utf-8 without BOM (header?). This can be done in Notepad++
    • every \ must be replaced by \\\ (note: three back slashes)
    • remove all empty lines at the end of the file.
  • check if all filenames match the citekeys in the bibfile (be aware of Capitals): > LANG=C; ls
  • also make sure all files have .pdf as extension and not .PDF: > ls | grep -v pdf
  • copy all pdf files that must be attached to the /var/www/media/papers/ directory.

After that check the bibfile in python with the parse_file routine:

$ python
>>> from zs.bibtex.parser import parse_file
>>> a = parse_file("bladiebla.bib")
>>> a.__len__()

If no errors are reported you can use the parsebib.py script:

$ python manage.py shell
>>> from papers import parsebib
>>> parsebib.parse("bladiebla.bib")

In case of duplicate citekeys this will be reported. Also the number of new entries are given.

Last modified 15 years ago Last modified on 09/27/10 17:17:09