Prannoy Pilligundla <prannoy.b...@gmail.com> writes: > I have been following the discussion going on in this thread and have been > exploring Lyx at the same time.I understood how to integrate python scripts > into the editor and all but i have a some queries regarding the round trip > conversion > > Since we have something like eLyxer which parses the Lyx format,can we > modify the eLyxer program and use this python-docx library( > https://github.com/python-openxml/python-docx) or anyother library which > helps in creating .docx files?In this way maybe we can also inject metadata > which MS Word ignores.Since we already have the .docx--->.lyx converter > written by Rob(http://blog.oak-tree.us/index.php/2012/03/08/word2lyx01-2) > we can modify it to read the metadata also.
I have my reservations of sticking to close to the docx file format in the implementation, as my initial idea was that the conversion process is modular, and other backends can be plugged in easily, while re-using basic metadata extraction and format specification mechanisms. So effectively, the initial idea (from my side) to 1) read supported round-trip feature list from config file 1) extract metadata, i.e. features which are not supported by round-trip, into file 2) convert remaining round-trip-suitable data into new format 3) possibly merge metadata into file, or leave in sidecar file - file goes away - do something in other format (edits, ...) - file returns 4) extract metadata, i.e. features which are not supported by round-trip, from file / sidecar file 5) convert remaining round-trip-suitable data into lyx format 6) merge metadata back into lyx file So existing converters might be a starting point for (2) and (5), but they should be optimized for semantic conversion of the supported round-trip-features and not trying to convert formats. The basic reasoning is here, that only 1) the definition of supported features 2) converter definitions (2) and (3) and 3) how to merge metadata into second format (3) need to be changed to support other formats (e.g. markdown come to mind). Or am I aiming to high here? > I feel we should be able to do a > roundtrip conversion this way but i am not sure of the math part.I mean i > should read more how can we convert mathematical expressions from .lyx to > .docx. Can someone please brief me on what's the crucial information that > is absent in Lyx but produced by Latex? Information which is missing in the LyX document but generated by LaTeX is 1) bibliography information and format 2) Text in cross references and citation format 3) similar to (2) figure, table, ... caption labels 4) constructs in ERT blocks, like tikz graphs et al Out of the head, I can't think of anything else, at the moment > > I also had a look at pandoc and tex4ht but as they are converters from > Latex,i feel we should only consider them as secondary options. I thought about pandoc as well, but the problem is the back conversion, as it does not accept docx as input format. And I think a chain of converters (as used for pictures and graphs in LyX) introduces to many potential instabilities in such an important feature. > > I am new to the Lyx community so please forgive me if you find any of my > suggestions too lame because i may not have complete overview and insight > into things. No problem at all - go ahead with asking. Cheers, Rainer > Also it would be great if someone could provide me links to > understand the .lyx format.I wrote a simple .lyx file and opened it in a > text editor and found a lot of stuff,i think i should be able to understand > this properly if i want to parse a .lyx file and convert it to something > else > > Thanks and Regards > Prannoy Pilligundla > ᐧ -- Rainer M. Krug email: RMKrug<at>gmail<dot>com
pgpmkMmvfpG3P.pgp
Description: PGP signature