alandefreitas / citation_graph

Plots a graph with the relationship between bibtex citations
6 stars 4 forks source link

Fix issue with line break in citations field #6

Closed rgaiacs closed 4 years ago

rgaiacs commented 4 years ago

The following BibTeX entry, from Wikipedia, is valid:

@Book{abramowitz+stegun,
 author    = "Milton {Abramowitz} and Irene A. {Stegun}",
 title     = "Handbook of Mathematical Functions with
              Formulas, Graphs, and Mathematical Tables",
 publisher = "Dover",
 year      =  1964,
 address   = "New York City",
 edition   = "ninth Dover printing, tenth GPO printing"
}

Note that values for BibTeX fields can be in more than one line. This is supported by bibtexparser and \n is included to represent the line break. If you have

  citations =    {foo,
                  bar}

the Python script will look for BibTeX IDs foo and \nbar. It will find the first but not the second. This pull request fix this issue by removing n so that the Python script searchers for foo and bar as BibTeX IDs.