JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.59k stars 2.53k forks source link

Unified LaTeX to NNN-converter #1198

Closed oscargus closed 8 years ago

oscargus commented 8 years ago

Refs #201 (final bullet):

One may write a single LaTeX to {HTML, Unicode, OOPreFormatter, XML, RTF}-converter, but it requires a bit of thinking. Still, quite a bit of the code is very similar (to the extent that code duplication tools detects it).

Rough approach:

The generic method needs a Map<String, String>, which contain mappings for the LaTeX symbols, see https://github.com/JabRef/jabref/blob/master/src/main/java/net/sf/jabref/logic/util/strings/RtfCharMap.java for an example (the HTML and Unicode ones are larger and automatically generated from https://github.com/JabRef/jabref/blob/master/src/main/java/net/sf/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java ) These maps are readily available, except for XML where the format of the first string must be modified a bit (similar to the generation of the HTML and Unicode maps).

Also, a method returning formatting commands, see getHTMLTag in https://github.com/JabRef/jabref/blob/master/src/main/java/net/sf/jabref/logic/layout/format/HTMLChars.java must be provided. Ideally, there should be a getFormattingStart method and a getFormattingEnd method to make it generic.

oscargus commented 8 years ago

Since this is more internal developer-related I move it to https://github.com/koppor/jabref/issues/145