How to customize BibTeX export

Hi All
Im a very happy Zotero user with just one problem.
When I want to export a collection of sources to a LaTeX project I use the export feature that lets Zotero generate a .bib file. That is all well and good but one of the points for each source is annoying me.

E.g.:
@article{gross_methodology_2010,
title = {Methodology for Assessing Bodily Expression of Emotion},
volume = {34},
issn = {0191-5886, 1573-3653},
url = {http://link.springer.com/10.1007/s10919-010-0094-x},
doi = {10.1007/s10919-010-0094-x},
number = {4},
urldate = {2013-09-12},
journal = {Journal of Nonverbal Behavior},
author = {Gross, M. Melissa and Crane, Elizabeth A. and Fredrickson, Barbara L.},
month = jul,
year = {2010},
keywords = {{ABM} in {HHI}},
pages = {223--248},
file = {Expression of emotion and intention by robot body movement.pdf:C:\Users\***\AppData\Roaming\Zotero\Zotero\Profiles\u5jynbzo.default\zotero\storage\66IIMPDB\Expression of emotion and intention by robot body movement.pdf:application/pdf;Gross_Crane_Fredrickson_2010__Methodology of assessing bodily expressions of emotion.pdf:C:\Users\***\AppData\Roaming\Zotero\Zotero\Profiles\u5jynbzo.default\zotero\storage\QPK2FQI2\Gross_Crane_Fredrickson_2010__Methodology of assessing bodily expressions of emotion.pdf:application/pdf}
},

That whole 'file = {' tag in the end is taking a lot of space and is making a long bib file confused. Is there a way to prevent Zotero to include file information?
  • edited November 18, 2013
    You can comment out the line
    writeField("file", attachmentString.substr(1));
    in the bibtex export translator by putting to slashes in front of it
    //writeField("file", attachmentString.substr(1));

    The bibtex translator is a file called BibTeX.js in the "translator" directory of your Zotero data folder.
    http://www.zotero.org/support/zotero_data
    you can open and edit it with any text editor like Notepad.
    Make sure to update your translators (general tab of the Zotero preferences) before you do this, so your change won't be overwritten immediately.
    This will still happen occasionally on updates, but since this is such a quick edit I'd imagine you can live with that.

    edited for clarity.
  • Or just post-process the produced bib file each time you make it:awk '!/file =/'
  • Thanks for the replies.
    I edited the BibTeX.js file in \AppData\Roaming\Zotero but even after restarting my computer Zotero still outputs the file string.

    @noksagt
    What program do I need to perform the post-processing?
  • My example used the command line program 'awk' (that ships with OS X and Linux & can be installed on Windows as easily as LaTeX), but this functionality is also in many text editors & other programs.
  • I tested the patch I suggested, it definitely works, either you're patching the wrong file - though it should really exist only once in a normal set-up - or you're not commenting out the right line. Could you paste the code you changed together with the 2-3 lines before and after it here?
  • Ah problem found and solved.
    I included the parenthesis from your example. Omitting them gave me the desired output. Thank you very much :)
  • great. Edited my post above for clarity if anyone else comes across this.
Sign In or Register to comment.