Opened 8 years ago

Closed 8 years ago

#1183 closed enhancement (fixed)

Patch for BibTeX: Preserve case, strip url and href on import, import deprecated '@conference', improved dashes

Reported by: karnesky Owned by: stakats
Priority: minor Milestone:
Component: translators Version: 1.5
Keywords: Cc:

Description

See http://forums.zotero.org/discussion/4331

Only case of words that have capital letters other than title case is preserved. This should handle some names, formulas, and acronyms (e.g. {McLean}, {arXiv}, {AlMgSc}, {DNA}). This seems like the best solution & can be addressed immediately, rather than waiting for #832.

This patch strips '\url' and '\href' from fields on import. This is desirable to keep clean records on import to Zoteor (at least until there is semantic markup); e.g. the 'extra' field will be usable by CSL styles without modifications. These strings are not converted back to urls on export, but they weren't properly exported in the first place. I don't know what the best solution is here (the proposed 'configuration option' seems like an extraneous knob). There might be other common LaTeX functions to eventually convert or strip.

@conference is an explicit BibTeX type, and is easy to map. Other types mentioned in the forums are not explicit types and are far less common in the wild.

I literally reversed the reversemappingTable so that can allow a many-to-one mapping as the regular mappingTable allows. This allows stripping of common sequences and allows conversion of multiple representations of em- and en-dashes from LaTeX to their UTF-8 equivalents. Performance does not seem to be too impaired & it was faster than a rewrite of the function that used regex replacements.

Attachments (1)

BibTeX.js.diff (66.6 KB) - added by karnesky 8 years ago.

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by karnesky

comment:1 Changed 8 years ago by dstillman

  • Resolution set to fixed
  • Status changed from new to closed

(In [3582]) Closes #1183, Patch for BibTeX: Preserve case, strip url and href on import, import deprecated '@conference', improved dashes

Not pushed to existing clients due to size and Fx2 DB issues, but available via Reset Translators and Styles in a dev build or 1.0.8 when it comes out

Note: See TracTickets for help on using tickets.