Re: copying from MS Word to LyX

2012-01-12 Thread Anders Host-Madsen

> My experience has been that word2tex is the only program that will work well
> with "lots of math equations".  But over the years, Word has handled math
> in a bunch of different ways, so I'd recommend getting an evaluation version
> first, and making sure it works for your particular word documents.
 

I agree. I also bought word2tex after trying all the free options. 
The problem with
OpenOffice, at least when I tried it, was that it tried to copy the exact 
style of
equations into latex, so the resulting latex was a terrible mess.

Word2tex has worked quite well to me. It is not completely automatic. 
I usually
do some hand editing of the latex code before finally converting 
it into LyX.



Re: copying from MS Word to LyX

2012-01-10 Thread David A Case
On Tue, Jan 10, 2012, Wilfried wrote:
> 
> Even at least one publisher of
> scientific journals (I don't remember who) requests authors NOT to use
> the new Word 2007 - 2010 equation editor but the old equation editor or
> MathType.

This is common in my field (chemistry): scientific journals ask for Word
documents as .doc files, and will *not* accept .docx, even though the
latter format has by now been around for some time.

I often encourage publishers to consider accepting LaTex, but to little avail.

...dave case



Re: copying from MS Word to LyX

2012-01-10 Thread Wilfried
Murat Yildizoglu  wrote:

> You could check rtftolatex, and openoffice (oolatex) based solutions too. I
> use word2tex from Chikrii Software (it is a commercial soft, with an
> interesting education price), it allows me to save in latex from Word. You
> can customize what you want to include in the translation (I keep only the
> essential elements, leaving the rest to Lyx).

Hi,

I want to point out that rtf2latex, OpenOffice and word2tex are only
able to convert equations created by Microsoft Equation Editor or
MathType. There are at least two other ways to write equations in Word:
Using EQ field functions (seldom used by Word users, but used as default
by the latex2rtf converter), and using the new Word 2007 - 2010 equation
editor (having a syntax similar to LaTeX). 
The latter two equation forms can neither be converted by rtf2latex, nor
by OpenOffice, nor by word2tex. Even at least one publisher of
scientific journals (I don't remember who) requests authors NOT to use
the new Word 2007 - 2010 equation editor but the old equation editor or
MathType.

This having said, the three ways all have their advantages and
disadvantages, apart from the fact that they all create LaTeX code which
is quite different from what a typical LaTeX user would write, and I
have no experience of how well this code imports into LyX.

Wilfried
 
> 2012/1/9 Leslaw Bieniasz 
> >
> > I am new to LaTeX and LyX. I have a document written in MS Word, containing
> > lots of math equations plus text, and I want to copy it into LyX. Is there
> > any
> > way to do it? I see that this issue was discussed in the past in this
> > forum,
> > and the suggestion was to write the doc file in the html format, and then
> > import the html file into LyX. However, I do not see any option in LyX, to
> > import or read html. So, how can I make the conversion?
> >
> > I want to use the Springer svmono class for the final document. I have
> > installed the class. Will that be possible?





Re: copying from MS Word to LyX

2012-01-09 Thread Murat Yildizoglu
You should be able to install the extension writer2latex that normally gives 
this filter for the save dialog. 

--
Murat Yildizoglu
yi...@u-bordeaux4.fr

Le 9 janv. 2012 à 20:48, Csikos Bela  a écrit :

> Richard Heck  írta:
>>> On 01/09/2012 07:11 AM, Leslaw Bieniasz wrote:>
>>> Hi,>
>>> 
>>> I am new to LaTeX and LyX. I have a document written in MS Word, 
>>> >>containing>
>>> lots of math equations plus text, and I want to copy it into LyX. Is there 
>>> >>any way to do it? I see that this issue was discussed in the past in this 
>>> >>forum, and the suggestion was to write the doc file in the html format, 
>>> >>and then import the html file into LyX. However, I do not see any option 
>>> >>in LyX, to import or read html. So, how can I make the conversion?>
> 
> Hello:
> 
> What I usually do is copy/paste from word/openoffice document into lyx.
> This makes sure that the special characters will be correct, do not have to 
> play with encoding, and fixing an imported document even may take more time 
> than copy/pasting. But unfortunately copy/paste from ooo/libreoffice into lyx 
> occasionally problematic in some desktop environmments.
> See: http://marc.info/?l=lyx-users&m=132207273229541&w=2
> 
> 
>>> 
>> You should at least try opening the file in Libre Office and then >
>> exporting to LaTeX, then opening the LaTeX file in LyX. It will be far >
>> from perfect, but it won't take that long to get it right.>
> 
> I can not find save as latex option neither in the save nor in the export 
> window. I have LibreOffice 3.4.4 OOO340m1 (Build:402).
> Ooo 3.1.1 doesn't not have such an option either.
> I have openSUSE 11.2.
> 
> bcsikos
> 
> 


Re: copying from MS Word to LyX

2012-01-09 Thread Csikos Bela
Richard Heck  írta:
>>On 01/09/2012 07:11 AM, Leslaw Bieniasz wrote:>
>> Hi,>
>>
>> I am new to LaTeX and LyX. I have a document written in MS Word, 
>> >>containing>
>> lots of math equations plus text, and I want to copy it into LyX. Is there 
>> >>any way to do it? I see that this issue was discussed in the past in this 
>> >>forum, and the suggestion was to write the doc file in the html format, 
>> >>and then import the html file into LyX. However, I do not see any option 
>> >>in LyX, to import or read html. So, how can I make the conversion?>

Hello:

What I usually do is copy/paste from word/openoffice document into lyx.
This makes sure that the special characters will be correct, do not have to 
play with encoding, and fixing an imported document even may take more time 
than copy/pasting. But unfortunately copy/paste from ooo/libreoffice into lyx 
occasionally problematic in some desktop environmments.
See: http://marc.info/?l=lyx-users&m=132207273229541&w=2


>>
>You should at least try opening the file in Libre Office and then >
>exporting to LaTeX, then opening the LaTeX file in LyX. It will be far >
>from perfect, but it won't take that long to get it right.>

I can not find save as latex option neither in the save nor in the export 
window. I have LibreOffice 3.4.4 OOO340m1 (Build:402).
Ooo 3.1.1 doesn't not have such an option either.
I have openSUSE 11.2.

bcsikos




Re: copying from MS Word to LyX

2012-01-09 Thread Murat Yildizoglu
Thanks Richard for the correction,
I have mixed these two-way packages... I was thinking about the
writer2latex filter that allows us to save in Latex format (I use it with
NeoOffice, under OSX).

2012/1/9 Richard Heck 

> On 01/09/2012 08:06 AM, Murat Yildizoglu wrote:
>
>> You could check rtftolatex, and openoffice (oolatex) based solutions too.
>>
>>  oolatex goes the other way. But Libre Office (the successor to Open
> Office) can export a file as LaTeX.
>
> Richard
>
>


-- 
Prof. Murat Yildizoglu

Université Montesquieu Bordeaux IV
GREThA (UMR CNRS 5113)
Avenue Léon Duguit
33608 Pessac cedex
France

yi...@u-bordeaux4.fr

h ttp://yildizoglu.info

http://www.twitter.com/yildizoglu


Re: copying from MS Word to LyX

2012-01-09 Thread Richard Heck

On 01/09/2012 08:06 AM, Murat Yildizoglu wrote:

You could check rtftolatex, and openoffice (oolatex) based solutions too.

oolatex goes the other way. But Libre Office (the successor to Open 
Office) can export a file as LaTeX.


Richard



Re: copying from MS Word to LyX

2012-01-09 Thread Richard Heck

On 01/09/2012 07:11 AM, Leslaw Bieniasz wrote:

Hi,

I am new to LaTeX and LyX. I have a document written in MS Word, containing
lots of math equations plus text, and I want to copy it into LyX. Is there any 
way to do it? I see that this issue was discussed in the past in this forum, 
and the suggestion was to write the doc file in the html format, and then 
import the html file into LyX. However, I do not see any option in LyX, to 
import or read html. So, how can I make the conversion?

You should at least try opening the file in Libre Office and then 
exporting to LaTeX, then opening the LaTeX file in LyX. It will be far 
from perfect, but it won't take that long to get it right.



I want to use the Springer svmono class for the final document. I have
installed the class. Will that be possible?
No reason it shouldn't be. You will probably have to change the class 
once you get it into LyX.


Richard



Re: copying from MS Word to LyX

2012-01-09 Thread David A Case
On Mon, Jan 09, 2012, Leslaw Bieniasz wrote:
> 
> I am new to LaTeX and LyX. I have a document written in MS Word, containing
> lots of math equations plus text, and I want to copy it into LyX.

My experience has been that word2tex is the only program that will work well
with "lots of math equations".  But over the years, Word has handled math
in a bunch of different ways, so I'd recommend getting an evaluation version
first, and making sure it works for your particular word documents.

...dave case



Re: copying from MS Word to LyX

2012-01-09 Thread Murat Yildizoglu
You could check rtftolatex, and openoffice (oolatex) based solutions too. I
use word2tex from Chikrii Software (it is a commercial soft, with an
interesting education price), it allows me to save in latex from Word. You
can customize what you want to include in the translation (I keep only the
essential elements, leaving the rest to Lyx).

2012/1/9 Leslaw Bieniasz 

>
>
> Hi,
>
> I am new to LaTeX and LyX. I have a document written in MS Word, containing
> lots of math equations plus text, and I want to copy it into LyX. Is there
> any
> way to do it? I see that this issue was discussed in the past in this
> forum,
> and the suggestion was to write the doc file in the html format, and then
> import the html file into LyX. However, I do not see any option in LyX, to
> import or read html. So, how can I make the conversion?
>
> I want to use the Springer svmono class for the final document. I have
> installed the class. Will that be possible?
>
> Leslaw
>
>


-- 
Prof. Murat Yildizoglu

Université Montesquieu Bordeaux IV
GREThA (UMR CNRS 5113)
Avenue Léon Duguit
33608 Pessac cedex
France

Bureau : F-331

yi...@u-bordeaux4.fr

http://yildizoglu.info

http://www.twitter.com/yildizoglu


copying from MS Word to LyX

2012-01-09 Thread Leslaw Bieniasz


Hi,

I am new to LaTeX and LyX. I have a document written in MS Word, containing
lots of math equations plus text, and I want to copy it into LyX. Is there any 
way to do it? I see that this issue was discussed in the past in this forum,
and the suggestion was to write the doc file in the html format, and then 
import the html file into LyX. However, I do not see any option in LyX, to 
import or read html. So, how can I make the conversion?

I want to use the Springer svmono class for the final document. I have 
installed the class. Will that be possible?

Leslaw



Re: MS Word to LyX

2009-01-29 Thread David A. Case
On Wed, Jan 28, 2009, Anders Host-Madsen wrote:

> So, it seems the only solution is word2tex -- it appears to
> do the conversion better than GrindEQ. But it is hard
> to judge from the trial version, and the real version is
> quite expensive (and risky, since it seems support is
> non-existent).
> 

I've used word2tex for several of projects.  Things still often need
tweaking on the Latex side, but (for me) it was much better than any
other tool I tried.  I mainly used it for a book project with many
hundreds of equations.

I don't have any experience with Chikrii's support.  And it is
expensive, although I qualified for the academic discount.

...hope this helpsdave case


Re: MS Word to LyX

2009-01-28 Thread rgheck

Anders Host-Madsen wrote:

Richard Heck  writes:


  
There's also the free wvLatex program that you can try. I don't know if 
it runs on Windows. See here:

http://wvware.sourceforge.net/
But if it doesn't, that's a good reason to dual boot Linux. 




I looked vwLatex. They refer to AbiWord, 
But I couldn't make AbiWord convert equations at all. 
So, it seems the only solution is word2tex -- it appears to

do the conversion better than GrindEQ. But it is hard
to judge from the trial version, and the real version is
quite expensive (and risky, since it seems support is
non-existent).

  
If you could send me a short Word document illustrating what you want to 
do, I'll try running wvLatex on it here, and then you can see what you 
get. I think someone else mentioned that writer2latex is very 
configurable, so if the DOC to OOo conversion is reasonable, you might 
have some luck there.


rh



Re: MS Word to LyX

2009-01-28 Thread Anders Host-Madsen
Richard Heck  writes:


> There's also the free wvLatex program that you can try. I don't know if 
> it runs on Windows. See here:
> http://wvware.sourceforge.net/
> But if it doesn't, that's a good reason to dual boot Linux. 


I looked vwLatex. They refer to AbiWord, 
But I couldn't make AbiWord convert equations at all. 
So, it seems the only solution is word2tex -- it appears to
do the conversion better than GrindEQ. But it is hard
to judge from the trial version, and the real version is
quite expensive (and risky, since it seems support is
non-existent).






Re: MS Word to LyX

2009-01-26 Thread cmiramon
Anders Host-Madsen wrote:

> I tried to install open office (neo office). It does convert to LaTeX.
> But the issue is that it seems the philosophy in the OO converter is to
> make the typeset
> LaTeX document look like the OO document, rather than conveying the
> meaning/contents
> of the document -- WYSIWYG rather than WYSIWYM. The results is terrible,
> terrible
> LaTeX code. Maybe there is some option to set so that it's converted to
> nice latex code,
> that does not try to reproduce the formatting of the OO document?
> At least the
> commercial programs produce LaTeX code that reproduce the meaning of the
> original document fairly.

To get all the power of the openoffice -> latex converter you have to use it
from the command line and tweak configuration files. Google for
writer2latex.

Nevertheless, I doubt that writer2latex converts very well equations in
MsWord. Maybe you could try to export your equations to MathML and then
convert the MathML to LaTeX. I do not know if MsWord can export to MathML.

Cheers,
Charles



Re: MS Word to LyX

2009-01-26 Thread Anders Host-Madsen
Richard Heck  writes:

> >   
> OpenOffice will export LaTeX. You should be able to load your Word docs 
> there, and then export. Might be no worse. You WILL have to do hand 
> editing, one way or the other. There's just no way around it.

I tried to install open office (neo office). It does convert to LaTeX. 
But the issue is that it seems the philosophy in the OO converter is to make 
the 
typeset 
LaTeX document look like the OO document, rather than conveying the 
meaning/contents 
of the document -- WYSIWYG rather than WYSIWYM. The results is terrible, 
terrible 
LaTeX code. Maybe there is some option to set so that it's converted to nice 
latex code, 
that does not try to reproduce the formatting of the OO document? 
At least the 
commercial programs produce LaTeX code that reproduce the meaning of the 
original document fairly.







Re: MS Word to LyX

2009-01-26 Thread Richard Heck

Anders Host-Madsen wrote:
LyX is really a great way to write math. Therefore I would like to 
convert my old MS Word documents -- 
with a lot of equation in Equation Editor -- to 
LyX (these are documents I continually revise). Any advise 
about this? I found two commercial packages for conversion 
to LaTeX: Grind EQ and Word2Tex. They are 
expensive, and the results are so-so. Definitely requires a
 lot of hand editing of the LaTeX code. Any 
experiences with these programs? It appears to me the 
results from Word2Tex is a little more faithful to 
the source, but it's hard to evaluate from the trial version.
  
OpenOffice will export LaTeX. You should be able to load your Word docs 
there, and then export. Might be no worse. You WILL have to do hand 
editing, one way or the other. There's just no way around it.


There's also the free wvLatex program that you can try. I don't know if 
it runs on Windows. See here:

http://wvware.sourceforge.net/
But if it doesn't, that's a good reason to dual boot Linux. ;-)

rh



MS Word to LyX

2009-01-26 Thread Anders Host-Madsen
LyX is really a great way to write math. Therefore I would like to 
convert my old MS Word documents -- 
with a lot of equation in Equation Editor -- to 
LyX (these are documents I continually revise). Any advise 
about this? I found two commercial packages for conversion 
to LaTeX: Grind EQ and Word2Tex. They are 
expensive, and the results are so-so. Definitely requires a
 lot of hand editing of the LaTeX code. Any 
experiences with these programs? It appears to me the 
results from Word2Tex is a little more faithful to 
the source, but it's hard to evaluate from the trial version.



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-31 Thread Abdelrazak Younes

Michael Wojcik wrote:

I don't expect the
switch to XML to cause me any problems, and to be honest I'm a bit
puzzled by all the worrying.


/me too :-)

Abdel.



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-31 Thread Michael Wojcik

Steve Litt wrote:


Trouble is, replacing \begin..\end with <>... is a hack. LyX developers 
have defined LyX native format as \begin always is the first character on a 
line. There's no such requirement in XML, and if we require it, that's a 
hack. If we don't require it, LyX-XML parsing becomes a whole new level of 
difficulty.


It's not hard at all, with an XML parser. Actually, putting all XML 
elements on their own lines, with or without leading whitespace, can 
be done with a DFA (or anything equivalent, such as a regular 
expression); you don't even need a full-strength parser. If you want 
elements all on their own lines, pre-processing with a quick sed 
script would do that for you.


I'm a toolsmith myself, and I write lots of tools, in lots of 
languages, for pre- and post-processing various file formats. I don't 
expect the switch to XML to cause me any problems, and to be honest 
I'm a bit puzzled by all the worrying.


--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-31 Thread Michael Wojcik

Manveru wrote:

Have you ever merge XML? I tried - it is horrible work.


It depends entirely on how the XML document is formatted. There's 
nothing that prevents XML with sensible line breaks, for example.


I keep lots of XHTML documents in CVS. They're well-formatted, so 
merging works just fine.


--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-28 Thread Abdelrazak Younes

John McCabe-Dansted wrote:

On Fri, Jul 25, 2008 at 4:43 PM, Manveru<[EMAIL PROTECTED]>  wrote:

To the discussion about data format preference:

I am reading all your comments about XML, YAML and other suggested data
formats. And this discussion reminds me something about XML what almost
nobody is remeber about. How many LyX user are working in large team
projects? How often they have to merge text files from different branches?
Have you ever merge XML? I tried - it is horrible work.


I don't see why it would be harder if we "just replace \begin...\end
with<>...".


I think LyX cannot exist with XML data format without build-in document
merge functionality.


This would be nice in any case.


Shameless plug:

http://www.lyx.org/Donate#sponsorship

Abdel.



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-28 Thread Abdelrazak Younes

G. Milde wrote:

On 28.07.08, Steve Litt wrote:

On Monday 28 July 2008 01:10, John McCabe-Dansted wrote:

On Fri, Jul 25, 2008 at 4:43 PM, Manveru<[EMAIL PROTECTED]>  wrote:

To the discussion about data format preference:

... Have you ever merged XML? I tried - it is horrible work.

I don't see why it would be harder if we "just replace \begin...\end
with<>...".



Trouble is, replacing \begin..\end with<>...  is a hack.

...

There's no such requirement in XML, and if we require it, that's a
hack.


I'd call it a layout convention.

IMO it is perfectly legal to define the lyx file format as

... uses XML ...
... is laid out in a manner to facilitate processing by tools that
operate on a line basis (grep, merge, sed, awk, ...)
...


Right, but LyX should not depend on this human friendly format. IOW LyX 
will be able to parse non nicely formatted .lyx file but will always 
output nicely formatted .lyx file.


We could add an option to lyx2lyx so that badly formatted LyX files 
generated by some external tool would be transformed into a nicely 
formatted .lyx file. See? I don't forecast any parsing problem :-)


Abdel.



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-28 Thread G. Milde
On 28.07.08, Steve Litt wrote:
> On Monday 28 July 2008 01:10, John McCabe-Dansted wrote:
> > On Fri, Jul 25, 2008 at 4:43 PM, Manveru <[EMAIL PROTECTED]> wrote:
> > > To the discussion about data format preference:
> > >
> > > ... Have you ever merged XML? I tried - it is horrible work.
> >
> > I don't see why it would be harder if we "just replace \begin...\end
> > with <>...".

> Trouble is, replacing \begin..\end with <>... is a hack. 
...
> There's no such requirement in XML, and if we require it, that's a 
> hack. 

I'd call it a layout convention.

IMO it is perfectly legal to define the lyx file format as

... uses XML ...
... is laid out in a manner to facilitate processing by tools that
operate on a line basis (grep, merge, sed, awk, ...) 
...

Günter




Re: Progress on the MS Word to LyX conversion (xml)

2008-07-28 Thread Steve Litt
On Monday 28 July 2008 01:10, John McCabe-Dansted wrote:
> On Fri, Jul 25, 2008 at 4:43 PM, Manveru <[EMAIL PROTECTED]> wrote:
> > To the discussion about data format preference:
> >
> > I am reading all your comments about XML, YAML and other suggested data
> > formats. And this discussion reminds me something about XML what almost
> > nobody is remeber about. How many LyX user are working in large team
> > projects? How often they have to merge text files from different
> > branches? Have you ever merge XML? I tried - it is horrible work.
>
> I don't see why it would be harder if we "just replace \begin...\end
> with <>...".

Trouble is, replacing \begin..\end with <>... is a hack. LyX developers 
have defined LyX native format as \begin always is the first character on a 
line. There's no such requirement in XML, and if we require it, that's a 
hack. If we don't require it, LyX-XML parsing becomes a whole new level of 
difficulty.

Like I said, nothing that XML->YAML and YAML->XML can't solve, but those would 
be required. Incidentally, I just heard there are already standalone programs 
that do those conversions, so before writing code myself, I'll investigate.

SteveT
 
Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-27 Thread John McCabe-Dansted
On Fri, Jul 25, 2008 at 4:43 PM, Manveru <[EMAIL PROTECTED]> wrote:
> To the discussion about data format preference:
>
> I am reading all your comments about XML, YAML and other suggested data
> formats. And this discussion reminds me something about XML what almost
> nobody is remeber about. How many LyX user are working in large team
> projects? How often they have to merge text files from different branches?
> Have you ever merge XML? I tried - it is horrible work.

I don't see why it would be harder if we "just replace \begin...\end
with <>...".

> I think LyX cannot exist with XML data format without build-in document
> merge functionality.

This would be nice in any case.

-- 
John C. McCabe-Dansted
PhD Student
University of Western Australia


My MS Word to LyX conversion is more or less finished

2008-07-27 Thread Steve Litt
Hi all,

A couple days ago it took the entire day to change all the tables from markers 
to real tables. It was a tough job.

Today I put in the 10 images into the book. What made it hard was that the old 
images were object embbedded Micrografx Windows Draw images. MGX Windows Draw 
was a wonderful program, probably better than Inkscape, but it's an orphan 
running only on Windows, and my only Windows machine is a Pentium II300 with 
128 MB of RAM.

Therefore, I had to reconstruct many of the images (they were diagrams) using 
the dia program, running a conversion program to convert the dia to .png, 
using Inkscape as the conversion mechanism.

One distressing effect was that the LyX book ballooned out to 370 pages from 
the 309 in MS Word, even though I set the LyX margins about the same as the 
(wide and tall) MS Word margins. In both books the font was 12point -- I 
insist on all my books being 12point so that people with poor vision can read 
them. I think the problem is LyX puts more space after headings than I like. 
If that's a significant part of the problem, I can narrow that out in the 
layout file.

Anyway, the mainmatter of the LyX book is essentially the same as the 
mainmatter of the MS Word book, so as soon as I do a few final checks, I'll 
begin making my 2008 revision of the book.

Thanks for all of your help.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-27 Thread Manveru
To the discussion about data format preference:

I am reading all your comments about XML, YAML and other suggested data
formats. And this discussion reminds me something about XML what almost
nobody is remeber about. How many LyX user are working in large team
projects? How often they have to merge text files from different branches?
Have you ever merge XML? I tried - it is horrible work.

I think LyX cannot exist with XML data format without build-in document
merge functionality. If any one is thinking about proffesional usage of LyX.
I saw some discussions about it, but I do not know whether it is in LyX or
not. I do not need this feature yet.

YAML is interesting idea, I saw use of it in one of Python frameworks (I
don't remeber which one). But it stays in nische. I don't see libraries for
YAML under active development right now.

-- 
Manveru
jabber: [EMAIL PROTECTED]
gg: 1624001
http://www.manveru.pl


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-27 Thread Pavel Sanda
> On Thursday 24 July 2008 13:07:19 Pavel Sanda wrote:
> > frankly - these are nice dreams, but there is not manpower to do it.
> > my feeling is that the xml-branch commit activity pefectly shows what will
> > happen after the worst bugs will be repaired in xml merged trunk.
> >
> > or you have some particular developer in mind? :))
> 
> Last time that I remember lyx2lyx was also a nice dream. :-)

you wanted to say docbook ? :))

> > pavel


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-27 Thread José Matos
On Thursday 24 July 2008 13:07:19 Pavel Sanda wrote:
> frankly - these are nice dreams, but there is not manpower to do it.
> my feeling is that the xml-branch commit activity pefectly shows what will
> happen after the worst bugs will be repaired in xml merged trunk.
>
> or you have some particular developer in mind? :))

Last time that I remember lyx2lyx was also a nice dream. :-)

> pavel

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion

2008-07-24 Thread Manveru
I understand DTD simplicity... but it is no longer fresh these days. Schema
allows better understanding and can be processed by XSLT.

2008/7/23 John <[EMAIL PROTECTED]>:

> On Wednesday 23 July 2008 08:04:59 am Steve Litt wrote:
> > On Tuesday 22 July 2008 11:32, rgheck wrote:
> > > Steve Litt wrote:
> > > > I don't know how it will be after LyX goes XML, but right now at
> 1.5.3,
> > > > converting my LyX code to something else by parsing the LyX native
> code
> > > > would be trivial.
> This is probably teaching Grandma to suck eggs - but
> There is a very good set of XML utilities available in Linux which alloy
> you
> easily parse and transform .xml files into almost anything you want (using
> xslt, sax, and friends. In openSUSE it is called xmlstarlet and comes with
> the installation CDs or DVD.
> These should make it easy to translate to and from LyX (when it finally
> goes
> fully XML).
>
> John O'Gorman
> > >
> > > My understanding is that, whatever happens with the LyX file format, we
> > > want it to remain possible to do the sort of simple scripting we all
> > > like to be able to do. The XML business is really just a matter of
> > > replacing things like this:
> > >
> > > \begin_layout Standard
> > > this.
> > > \end_layout
> > >
> > > \begin_layout Standard
> > > \begin_inset CommandInset bibtex
> > > LatexCommand bibtex
> > > bibfiles "/tmp/bib"
> > > options "plain"
> > >
> > > \end_inset
> > >
> > >
> > > \end_layout
> > >
> > > with things like this:
> > >
> > > 
> > > this.
> > > 
> > >
> > > 
> > >  options="plain"
> > > /> 
> > >
> > > Just as easy to parse, I hope. Maybe even easier.
> > >
> > > That's not anything actually agreed or implemented
> >
> > It's not as easy to parse, but it's reasonable. If that's the extent of
> the
> > XMLization of LyX, it should still be somewhat tweakable with Vim, Perl,
> > etc.
> >
> > The real problems come in when they do things in XML that would be
> > denormalization in a database. Store the paragraphs one place, and then
> > store the *number of paragraphs* somewhere else, so if you add a
> paragraph
> > and forget to increment the number, your doc no longer opens.
> >
> > Or treating the XML file like a relational database, where you have a
> list
> > of styles with numbered IDs one place, and then have those numbers
> applied
> > to paragraphs somewhere else. This is an excellent programming technique,
> > but for the guy just trying to casually go in and tweak something, or
> > casually trying to programmatically generate LyX data, it can be daunting
> > indeed. Personally, I love having my style defs in the layout file and
> > using the style names as their identifiers.
> >
> > Then there's this habit of people like OpenOffice, where the native
> format
> > is a Zip file unzipping to different directories, each containing XML
> files
> > and other types of files. Yeah, I just dare anyone to generate OpenOffice
> > on the fly.
> >
> > I suggest that whatever you decide, you document the XML structure. I
> don't
> > mean document as in "it's open source, read the code". I mean document as
> > in "Here is the data hierarchy, here is the high level data design, here
> > are our reasons for doing it this way, here are the data
> interdependencies,
> > here are some tips for building LyX files programmatically and tweaking
> > them either programmatically or with an editor. And here is a tutorial on
> > building and tweaking LyX files without the LyX front end.
> >
> > I'm busy these days, but if you keep me in the loop I'll do at least a
> good
> > chunk of that documentation.
> >
> > One more thing -- if you're going XML and don't want to reinvent the
> wheel,
> > you'll be using someone else's XML parser. Please, please, PLEASE, don't
> > make it some parser with tons of dependency so that the guy with a 2 year
> > old distro can't compile LyX because of the XML parser. We already have
> > enough problems with Qt dependencies.
> >
> > Thanks
> >
> > SteveT
> >
> > Steve Litt
> > Recession Relief Package
> > http://www.recession-relief.US
>
>
>


-- 
Manveru
jabber: [EMAIL PROTECTED]
gg: 1624001
http://www.manveru.pl


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-24 Thread Pavel Sanda
> what I claim is that we need better 
> script tools to handle lyx documents. Those tools should be stable across lyx 
> versions and should not depend of any particular file format.

frankly - these are nice dreams, but there is not manpower to do it.
my feeling is that the xml-branch commit activity pefectly shows what will
happen after the worst bugs will be repaired in xml merged trunk.

or you have some particular developer in mind? :))

pavel


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-24 Thread Christian Ridderström

On Wed, 23 Jul 2008, Steve Litt wrote:


As a sed/awk/perl/ruby parser, I appreciate that very much.

The more I think about it, the more I think I should make the XML->YAML 
and YAML->XML converters. That way, if future generations of LyX project 
programmers forget why it's important to space their XML "just so", it 
won't matter. Also, I have a feeling that YAML will be much easier to 
parse than either 1.5.x or XML.


At first I'll do them in Ruby because Ruby has all that stuff built in 
and easy to do.


Did you see José's post about how the lyx2lyx stuff is really inside a 
Python lib (module)?  You'd probably only need a different kind of wrapper 
that calls this module, instead of reinventing everything in Ruby.


/Christian

--
Christian Ridderström, +46-8-768 39 44http://www.md.kth.se/~chr

Re: Progress on the MS Word to LyX conversion (xml)

2008-07-24 Thread José Matos
On Wednesday 23 July 2008 19:24:16 Pavel Sanda wrote:
> this depends on what you master. i'm used on the bunch of small unix
> utilities so i gave that sed example. if you know python you will do in
> python. my point was not propose the best tools but to groan and moan about
> xml :)

FWIW this chunk is from one of my shell scripts:

echo $1
for i in {8..40}
do
echo -n '.'
w=`printf "%.2d0" $i`
f="dfa-$1-$w.dat"
./dfa -s -w $w < $1.dat | ./join-lag.py -l $w -r $1.dates > $f
cut -f1,2 $f | join -a1 dfa.dat - > tmp.dat
mv tmp.dat dfa.dat
done

So as you can see I know more than python. :-)
And yes I know this only works with bash, and that is OK with me. :-)

My point is that it is alright to use the small tools of the trade but we can 
do better because lyx documents are richer than just pure text.

I am not saying that your usage is wrong what I claim is that we need better 
script tools to handle lyx documents. Those tools should be stable across lyx 
versions and should not depend of any particular file format.

> pavel

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Richard heck

Steve Litt wrote:
At first I'll do them in Ruby because Ruby has all that stuff built in and 
easy to do. Later, depending on performance and the percent of people who 
have Ruby installed, I can convert them to C. There's a C implementation of 
the same YAML parser/emitter that Ruby uses -- Syck. I'm pretty sure there 
are also C or C++ implementations of XML Parsers, although I don't know how 
well they do things like DTD/schema.


  
At present, it's LyX policy that included things should be in Python, 
since we require it anyway.


rh



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Richard heck

José Matos wrote:
That is also the reason why lyx2lyx is nowadays mostly a python library 
(LyX.py) and the script lyx2lyx is just a wrapper around the library.


  
And let me add that anyone who wants to process LyX files on a regular 
basis using external scripts would be well served to learn the basics of 
this library. The interface is really very simple once you get the hang 
of it.


rh



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Richard heck

Steve Litt wrote:
Perhaps our best hope of continuing tweakability of native LyX is to create 
1.5.x to XML and XML to 1.5.x converters. Then all the parsing/tweaking can 
continue to be done in the 1.5.x format.


  
As always, LyX will have such converters, so old formats can be 
imported/exported.


rh



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Richard heck

Steve Litt wrote:

On Wednesday 23 July 2008 07:00, José Matos wrote:
  

XML will not change the current status.

grep '

Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Andre Poenitz
On Wed, Jul 23, 2008 at 10:33:16AM -0400, Steve Litt wrote:
> On Wednesday 23 July 2008 07:00, José Matos wrote:
> 
> > XML will not change the current status.
> >
> > grep '

Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Pavel Sanda
> The next question is why do we need to manipulate lyx files with awk and 
> friends? Is not there something that can should be done by lyx?

search and replace is one of the weak lyx parts and even if we get Tommaso
one day to put his stuff in there are so many place where its of no help.
just look on the things like notes-mutate or graphics settings synchronization
other nonimplemented things come to my mind.

> I have generated lyx files with scripts that have been used in my PhD thesis 
> (almost 40 pages were generated like this) so I can recognize advantages in 
> manipulating lyx files with scripts, but in that case there are better tools 
> than awk and sed.

this depends on what you master. i'm used on the bunch of small unix utilities
so i gave that sed example. if you know python you will do in python. my point
was not propose the best tools but to groan and moan about xml :)

pavel


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Pavel Sanda
> Perhaps our best hope of continuing tweakability of native LyX is to create 
> 1.5.x to XML and XML to 1.5.x converters. Then all the parsing/tweaking can 
> continue to be done in the 1.5.x format.

as have written others 1.6 is still ok. for lyx files assembly you can still
make what you want in 1.6 format and lyx2lyx will convert for you to 1.7 etc.

next possibility is to stick with 1.6 as long as possible :)

> The only thing you and I would have to do is the XML to 1.5.x converter. I'm 

this will be part of the the fileformat transition in lyx itself. moreover xml 
is not my religion, so i will try to keep myself as far as possible from any
xml related coding :D

pavel


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Steve Litt
On Wednesday 23 July 2008 11:05, José Matos wrote:
> On Wednesday 23 July 2008 15:33:16 Steve Litt wrote:
> > The trouble is, XML tags can be anywhere -- spacing and linefeeds are
> > immaterial. That means you can no longer parse based on position, such
> > as:
> >
> > /^begin_layout/
> >
> > because technically the whole XML file could be in a single line. Or a
> > single tag could be split between lines.
>
> Since we control the format I am (almost) sure that we will choose a reader
> friendly output. There is no reason to do otherwise. In terms of size a
> blank or a newline are equivalent, so... :-)
>
> That is why it will be business as usual. :-)
> Not much will change in this regard.

Thanks José,

As a sed/awk/perl/ruby parser, I appreciate that very much.

The more I think about it, the more I think I should make the XML->YAML and 
YAML->XML converters. That way, if future generations of LyX project 
programmers forget why it's important to space their XML "just so", it won't 
matter. Also, I have a feeling that YAML will be much easier to parse than 
either 1.5.x or XML.

The way I envision it, these two converters will be simple standalone commands 
implemented as filters (convert stdin to stdout), very few dependencies. They 
will comply with the Unix Philosophy (little apps that do one thing and do it 
well). Trivial to install. They will be simple enough to be maintained by one 
person. 

They will be encapsulated. They won't need to know about LyX other than its 
XML format, and LyX won't need to know about them. They can be included in 
the LyX distribution, or not.

At first I'll do them in Ruby because Ruby has all that stuff built in and 
easy to do. Later, depending on performance and the percent of people who 
have Ruby installed, I can convert them to C. There's a C implementation of 
the same YAML parser/emitter that Ruby uses -- Syck. I'm pretty sure there 
are also C or C++ implementations of XML Parsers, although I don't know how 
well they do things like DTD/schema.

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Steve Litt
On Wednesday 23 July 2008 11:21, José Matos wrote:

> > There may be things wrong with awking, seding and perling data into
> > submission, but the age of these tools is not one of them.
>
> If you add there the coreutils, like tail, cut, paste, merge and so on we
> can do things that spreadsheet programs can only dream of like processing
> Gigs of data with thousands of lines and columns. :-)

:-)  :-)  :-)

Check this out:

http://www.troubleshooters.cxm/lpm/200801/200801.htm

http://www.troubleshooters.cxm/lpm/200802/200802.htm


But seriously -- it's obvious that for the LyX application itself, XML is by 
far the best way to go, and I would never suggest rewriting LyX in awk :-). 
My interest is in quick writes/tweaks of LyX native format files in order to 
do things that LyX isn't equipped to do, like my VimOutliner to LyX script.

STeveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread José Matos
On Wednesday 23 July 2008 14:49:12 Manveru wrote:
> Guys,
>
> Have you even looked at TinyXML?

Thanks for the link. :-)
-- 
José Abílio


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread José Matos
On Wednesday 23 July 2008 15:58:56 Steve Litt wrote:
> Hi Pavel,
>
> Perhaps our best hope of continuing tweakability of native LyX is to create
> 1.5.x to XML and XML to 1.5.x converters. Then all the parsing/tweaking can
> continue to be done in the 1.5.x format.

I will advise against such practice. I hope to explain why in the paragraphs 
below.

> I'm presuming that the LyX developers will create the 1.5.x to XML
> converter so users can upgrade their old docs, and hopefully they would
> keep that converter updated for each new LyX version, so that you and I
> wouldn't need to worry about coding the 1.5.x to XML.

Note that the convertion to xml will only happen after 1.6. I know that your 
argument remains unchanged with this shift and just correct this before 
continuing.

With this said lyx2lyx will be able to convert from pre-xml to xml and vice-
versa.

Our previous experience suggest however that while the forward translation is 
complete the backwards translation results sometimes in the truncation or lots 
of ERT added to preserve the same structure.

For several reasons a transformation from X to X+1 and back again is not 
guaranteed to give the same document bit by bit. Note also that this is not an 
easy task in any way.

The next question is why do we need to manipulate lyx files with awk and 
friends? Is not there something that can should be done by lyx?

I have generated lyx files with scripts that have been used in my PhD thesis 
(almost 40 pages were generated like this) so I can recognize advantages in 
manipulating lyx files with scripts, but in that case there are better tools 
than awk and sed.

That is also the reason why lyx2lyx is nowadays mostly a python library 
(LyX.py) and the script lyx2lyx is just a wrapper around the library.

> The only thing you and I would have to do is the XML to 1.5.x converter.
> I'm pretty darned good with C, and if necessary I can do C++ (but with a C
> accent). If we pick an XML parser with full schema/dtd capability, that
> doesn't have many dependencies, then if you know how to write 1.5.x, I can
> feed you whatever data is needed to write the 1.5.x.
>
> There's another possibility that I think might be better. Using Ruby with
> REXML, I could convert the XML to YAML (http://en.wikipedia.org/wiki/Yaml)
> if you could help me just a little bit with the return trip (YAML to XML).
> I think this would be EVEN BETTER than 1.5.x, because YAML was made for
> exactly what you and I want to do -- parsing with awk/sed/perl/grep/cut. It
> would also remove our responsibility to support 1.5.x syntax in the 22nd
> century.
>
> Using YAML for tweaking, I think there may come a time when you and I would
> say "remember when we had to parse that nasty 1.5.x?"
>
> I can begin this project as soon as the developers give me an XML def and
> an XML file. That way, once they actually specify what they're going to do,
> we'll have the technology for the XML->YAML->XML round trip, and only the
> details will require coding.
>
> What do you think?
>
> StevET

You are welcome both to tell us your requirements around the future xml file 
format and to help us so that in the end we all have a better lyx. Really, all 
help is welcome.

> Steve Litt
> Recession Relief Package
> http://www.recession-relief.US

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread José Matos
On Wednesday 23 July 2008 15:20:59 Steve Litt wrote:
> When the discussion reverts to "your thingamabob is from another
> decade/century so it must not be good by today's standards", you know that
> thingamabob is pretty darn good, or else there would have been a more
> powerful argument against it.

Pavel is a developer just as I am. In this thread we been teasing each other 
over this issue. In such cases this is an acceptable argument (IMO). ;-)

> First of all, I understand *exactly* why an XML native format is an
> improvement for the LyX application. I'm limiting my point to the concept
> that something old has to be something bad.

That is fair. :-)

> Modern things are usually improvements, but often are not improvements in
> quality or usefulness. They can be improvements to profit margin (e.g. most
> MS Windows "improvements"), or marketing improvements (all the silly little
> expensive features thrown into basic family cars today), or improvements in
> restricting use (DRM), or improvements in price (crummy bicycles from
> Walmart). Sometimes older stuff has more quality or usefulness.

All that is true but in this case the lyx file format and indirectly the lyx 
parser have not been changed in a long time until 2002 not because they were 
perfect but because most developers were afraid to touch and break it. The 
format had been evolving over time and it was a mess with places where 
whitespaces were significant and others were they were for no good reason.

> In 1969 and the early 1970's, Ken Thompson and the gang made Unix with the
> philosophy of little executables that do one thing and do it right. Stdin,
> stdout and pipes were the glue language with which these little executables
> could be cascaded to produce a substantial result. This enabled
> logical-thinking non-developers, and also developers, to produce those
> substantial results in an hour, with perhaps the greatest encapsulation
> that's ever been achieved in the computer world. Each little executable has
> one input and one output, each being a measurable test point. For batch
> processes this "programming" technique is every bit as productive as it was
> 39 years ago.

lyx2lyx that lyx uses to convert between the different file formats works 
using this principle, it acts as a filter receiving from stdin and writing the 
transformation in stdout.

Yet until now there is not a good way to have an external program (script) 
other than lyx to check the validity of a lyx file. For me, at least, this is 
a strong shortcoming of our file format.

> There may be things wrong with awking, seding and perling data into
> submission, but the age of these tools is not one of them.

If you add there the coreutils, like tail, cut, paste, merge and so on we can 
do things that spreadsheet programs can only dream of like processing Gigs of 
data with thousands of lines and columns. :-)

> SteveT

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread José Matos
On Wednesday 23 July 2008 15:33:16 Steve Litt wrote:
> The trouble is, XML tags can be anywhere -- spacing and linefeeds are
> immaterial. That means you can no longer parse based on position, such as:
>
> /^begin_layout/
>
> because technically the whole XML file could be in a single line. Or a
> single tag could be split between lines.

Since we control the format I am (almost) sure that we will choose a reader 
friendly output. There is no reason to do otherwise. In terms of size a blank 
or a newline are equivalent, so... :-)

That is why it will be business as usual. :-)
Not much will change in this regard.

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Abdelrazak Younes

Steve Litt wrote:

Perhaps our best hope of continuing tweakability of native LyX is to create
1.5.x to XML and XML to 1.5.x converters. Then all the parsing/tweaking can
continue to be done in the 1.5.x format.

I'm presuming that the LyX developers will create the 1.5.x to XML converter
so users can upgrade their old docs, and hopefully they would keep that
converter updated for each new LyX version, so that you and I wouldn't need
to worry about coding the 1.5.x to XML.


Yes, switching to XML doesn't mean abandoning lyx2lyx. The difference is 
that we will be able to use simpler XSL templates for the conversion. 
The advantage being that the XSL templates will be available to all, not 
being specificy to python or lyx2lyx.


By the way, the switch to XML is not going to happen with 1.6 but with 
1.7, that is at least one year from now ;-)




The only thing you and I would have to do is the XML to 1.5.x converter.


This will be provided by lyx2lyx too. 1.7-XML will export to all 1.x 
formats with x <= 6.



I'm
pretty darned good with C, and if necessary I can do C++ (but with a C
accent). If we pick an XML parser with full schema/dtd capability, that
doesn't have many dependencies, then if you know how to write 1.5.x, I can
feed you whatever data is needed to write the 1.5.x.


As I said above, this 1.7 to 1.6 will be supported via a simple XSL 
stylesheet. It's really the other direction 1.6 to 1.7 that will be 
difficult to implement.
But hey, all help is welcome, the development of 1.7 is going to begin 
in a couple of months so if you want to have a say in the new XML 
format, come along on the devel list ;-)


Abdel.



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Steve Litt
On Tuesday 22 July 2008 19:24, Pavel Sanda wrote:
> > Pavel Sanda wrote:
> > Moreover, if you're editing by hand, you can use
> > something that recognizes XML.
>
> of course it will work, but it will take x-times more time.
> quite difference to write sed one-liner or start doing some
> xslt templating.
>
> pavel

Hi Pavel,

Perhaps our best hope of continuing tweakability of native LyX is to create 
1.5.x to XML and XML to 1.5.x converters. Then all the parsing/tweaking can 
continue to be done in the 1.5.x format.

I'm presuming that the LyX developers will create the 1.5.x to XML converter 
so users can upgrade their old docs, and hopefully they would keep that 
converter updated for each new LyX version, so that you and I wouldn't need 
to worry about coding the 1.5.x to XML.

The only thing you and I would have to do is the XML to 1.5.x converter. I'm 
pretty darned good with C, and if necessary I can do C++ (but with a C 
accent). If we pick an XML parser with full schema/dtd capability, that 
doesn't have many dependencies, then if you know how to write 1.5.x, I can 
feed you whatever data is needed to write the 1.5.x.

There's another possibility that I think might be better. Using Ruby with 
REXML, I could convert the XML to YAML (http://en.wikipedia.org/wiki/Yaml) if 
you could help me just a little bit with the return trip (YAML to XML). I 
think this would be EVEN BETTER than 1.5.x, because YAML was made for exactly 
what you and I want to do -- parsing with awk/sed/perl/grep/cut. It would 
also remove our responsibility to support 1.5.x syntax in the 22nd century.

Using YAML for tweaking, I think there may come a time when you and I would 
say "remember when we had to parse that nasty 1.5.x?"

I can begin this project as soon as the developers give me an XML def and an 
XML file. That way, once they actually specify what they're going to do, 
we'll have the technology for the XML->YAML->XML round trip, and only the 
details will require coding.

What do you think?

StevET

Steve Litt
Recession Relief Package
http://www.recession-relief.US


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Steve Litt
On Wednesday 23 July 2008 07:00, José Matos wrote:

> XML will not change the current status.
>
> grep '

Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Steve Litt
On Tuesday 22 July 2008 18:21, José Matos wrote:

> Clearly you did not had to deal with the lyx file format like I did. :-)
> If your idea of a parser is a set of regexp's that is so 80's. ;-)
[clip]
> It is funny to see all this nostalgia around something that is/was a
> nightmare. If the syntax was so clear you would not have the problem of
> crashing lyx with a bad formed file (a file modified by scripts).

When the discussion reverts to "your thingamabob is from another 
decade/century so it must not be good by today's standards", you know that 
thingamabob is pretty darn good, or else there would have been a more 
powerful argument against it.

First of all, I understand *exactly* why an XML native format is an 
improvement for the LyX application. I'm limiting my point to the concept 
that something old has to be something bad.

Modern things are usually improvements, but often are not improvements in 
quality or usefulness. They can be improvements to profit margin (e.g. most 
MS Windows "improvements"), or marketing improvements (all the silly little 
expensive features thrown into basic family cars today), or improvements in 
restricting use (DRM), or improvements in price (crummy bicycles from 
Walmart). Sometimes older stuff has more quality or usefulness.

In 1969 and the early 1970's, Ken Thompson and the gang made Unix with the 
philosophy of little executables that do one thing and do it right. Stdin, 
stdout and pipes were the glue language with which these little executables 
could be cascaded to produce a substantial result. This enabled 
logical-thinking non-developers, and also developers, to produce those 
substantial results in an hour, with perhaps the greatest encapsulation 
that's ever been achieved in the computer world. Each little executable has 
one input and one output, each being a measurable test point. For batch 
processes this "programming" technique is every bit as productive as it was 
39 years ago.

There may be things wrong with awking, seding and perling data into 
submission, but the age of these tools is not one of them.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Manveru
Guys,

Have you even looked at TinyXML?

I have a project once where we use XML as a message passing protocol and we
were using XSLT as C++ code generator for classes handling XML and
converting them to data structures handling all data we need. This freed us
from portability problems (Litte Endian, Big Endian) which is not case here.
For the application like LyX binary structure may be better to handle -
certainly much work to do. We in our project hadn't found any known DOM
useful for our purpose.

Cheers!
M.

2008/7/23 José Matos <[EMAIL PROTECTED]>:

> On Wednesday 23 July 2008 12:19:16 Pavel Sanda wrote:
> > i've done incorrect file, it's my fault if lyx crashes. i take my
> > responsibility, no problem.
> > trial method is the fastest if you want something quickly.
>
> If LyX crashes that is a bug. LyX should not ever crash, it can refused to
> load a file because it is invalid, or to truncate it but it should not ever
> crash.
>
> In the whole picture our parser is one of our weak links so we should do
> something about it. Replace it in this case.
>
> > > First make it correct and then make it fast.
> >
> > i have exactly oposite view as far as the tweaking i was talking about
> > is concerned; i just need quickly output of something, may be i will
> throw
> > it away after few days.
> >
> > or take Steve's example - if he takes your 'First make it correct and
> then
> > make it fast' it would take some two weaks to invent some beast to be
> > correct in your sense. but then the whole point is lost, since after this
> > time he could do it manually.
> >
> > i guess we can't agree on this, since i'm not talking about lyx
> internals,
> > while your job is to make lyx format conversions on lyx level... but this
> > is users list, not the the devel one, so i feel free to speak this way :)
>
> Yes, I know but I can pretend otherwise. ;-)
>
> > pavel
>
> --
> José Abílio
>



-- 
Manveru
jabber: [EMAIL PROTECTED]
gg: 1624001
http://www.manveru.pl


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread José Matos
On Wednesday 23 July 2008 12:19:16 Pavel Sanda wrote:
> i've done incorrect file, it's my fault if lyx crashes. i take my
> responsibility, no problem.
> trial method is the fastest if you want something quickly.

If LyX crashes that is a bug. LyX should not ever crash, it can refused to 
load a file because it is invalid, or to truncate it but it should not ever 
crash.

In the whole picture our parser is one of our weak links so we should do 
something about it. Replace it in this case.

> > First make it correct and then make it fast.
>
> i have exactly oposite view as far as the tweaking i was talking about
> is concerned; i just need quickly output of something, may be i will throw
> it away after few days.
>
> or take Steve's example - if he takes your 'First make it correct and then
> make it fast' it would take some two weaks to invent some beast to be
> correct in your sense. but then the whole point is lost, since after this
> time he could do it manually.
>
> i guess we can't agree on this, since i'm not talking about lyx internals,
> while your job is to make lyx format conversions on lyx level... but this
> is users list, not the the devel one, so i feel free to speak this way :)

Yes, I know but I can pretend otherwise. ;-)

> pavel

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread Pavel Sanda
> On Wednesday 23 July 2008 00:19:09 Pavel Sanda wrote:
> > while you are right that xml could be better technology for internal
> > lyx parsing (and i can understand your viewpoint as lyx2lyx fan:)
> > this was not my mail about.
> >
> > > It is funny to see all this nostalgia around something that is/was a
> > > nightmare.
> >
> > it has nothing to do with nostalgia, but speed of hacking around.
> 
> Not when the resulting file crashes lyx, something that should not ever 
> happen 
> but that it does now.

i've done incorrect file, it's my fault if lyx crashes. i take my 
responsibility,
no problem.
trial method is the fastest if you want something quickly.

> First make it correct and then make it fast.

i have exactly oposite view as far as the tweaking i was talking about
is concerned; i just need quickly output of something, may be i will throw
it away after few days.

or take Steve's example - if he takes your 'First make it correct and then
make it fast' it would take some two weaks to invent some beast to be 
correct in your sense. but then the whole point is lost, since after this
time he could do it manually.

i guess we can't agree on this, since i'm not talking about lyx internals,
while your job is to make lyx format conversions on lyx level... but this
is users list, not the the devel one, so i feel free to speak this way :)

pavel


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-23 Thread José Matos
On Wednesday 23 July 2008 00:19:09 Pavel Sanda wrote:
> by 'outside' i mean tweakings which i regularly do and watching users list
> power users do that too _and_ are happy about the current simplicity of
> format.
>
> tweaks like assembling of the whole file for various datasets, global
> changes of things (cf notes-mutate lfun i introduced lately), conversions
> and so on.

This works well for simple things but breaks badly when you try something a 
bit more complex.

> while you are right that xml could be better technology for internal
> lyx parsing (and i can understand your viewpoint as lyx2lyx fan:)
> this was not my mail about.
>
> > It is funny to see all this nostalgia around something that is/was a
> > nightmare.
>
> it has nothing to do with nostalgia, but speed of hacking around.

Not when the resulting file crashes lyx, something that should not ever happen 
but that it does now. First make it correct and then make it fast.

XML will not change the current status.

grep '

Re: Progress on the MS Word to LyX conversion (xml)

2008-07-22 Thread Steve Litt
On Tuesday 22 July 2008 19:24, Pavel Sanda wrote:
> > Pavel Sanda wrote:
> > Moreover, if you're editing by hand, you can use
> > something that recognizes XML.
>
> of course it will work, but it will take x-times more time.
> quite difference to write sed one-liner or start doing some
> xslt templating.
>
> pavel

Yeah, I think this was the point I was trying to get across. With the current 
format, you can do a lot with Vim. Or you can run through a series of small 
filters that do just one thing.

XML's a different animal. Without a parser, it's almost impossible to handle. 
With a parser, you're forced to work only within the language of that parser, 
and you're forced to make a monolithic solution that can't take advantage of 
Unix pipes and small executables that do one thing and do it well. You also 
forgo the ability to have a series of intermediate files, each serving as a 
test point to make sure things are still going well.

Also, an XML parser, especially a DOM one, makes READING XML very easy, but it 
does nothing for WRITING.

Pavel -- you and I and others like us need to start identifying parsing tools 
to at least partially compensate for the loss of our Unix based pipes with 
small filter executables. Theoretically, if one could read the XML into a DOM 
tree, tweak it in memory, and then write it back out, that would be at least 
somewhat doable, though nothing like the Awk and Perl techniques I'm used to.

And once again, we need COMPLETE documentation on the XML dialect, and Like I 
said I'm willing to help with that documentation.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-22 Thread Pavel Sanda
> Pavel Sanda wrote:
> Moreover, if you're editing by hand, you can use 
> something that recognizes XML.

of course it will work, but it will take x-times more time.
quite difference to write sed one-liner or start doing some
xslt templating.

pavel


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-22 Thread Pavel Sanda
> On Tuesday 22 July 2008 22:54:14 Pavel Sanda wrote:
> >
> > now you are joking right? :) i just see all the bugs just because '>' is
> > redirection. and imho manually generate \begin_layout Standard is more
> > simpler
> > then typing .
> 
> You are welcome to reimplement lyx in shell, good luck. :-)
> 
> > now imagine those regexps where you need to escape all those \"
> >
> > in conclusion xml will be pain for people trying to use .lyx files
> > directly with scripts etc.
> 
> Clearly you did not had to deal with the lyx file format like I did. :-) 
> If your idea of a parser is a set of regexp's that is so 80's. ;-)

clearly you haven't understand my point. i was not talking at all about lyx
internal parsing, but about 'outside' usage.

by 'outside' i mean tweakings which i regularly do and watching users list
power users do that too _and_ are happy about the current simplicity of format.

tweaks like assembling of the whole file for various datasets, global changes
of things (cf notes-mutate lfun i introduced lately), conversions and so on.

while you are right that xml could be better technology for internal
lyx parsing (and i can understand your viewpoint as lyx2lyx fan:)
this was not my mail about.

> It is funny to see all this nostalgia around something that is/was a 
> nightmare.

it has nothing to do with nostalgia, but speed of hacking around.

pavel


Re: Progress on the MS Word to LyX conversion

2008-07-22 Thread John
On Wednesday 23 July 2008 08:04:59 am Steve Litt wrote:
> On Tuesday 22 July 2008 11:32, rgheck wrote:
> > Steve Litt wrote:
> > > I don't know how it will be after LyX goes XML, but right now at 1.5.3,
> > > converting my LyX code to something else by parsing the LyX native code
> > > would be trivial.
This is probably teaching Grandma to suck eggs - but 
There is a very good set of XML utilities available in Linux which alloy you 
easily parse and transform .xml files into almost anything you want (using 
xslt, sax, and friends. In openSUSE it is called xmlstarlet and comes with 
the installation CDs or DVD.
These should make it easy to translate to and from LyX (when it finally goes 
fully XML). 

John O'Gorman
> >
> > My understanding is that, whatever happens with the LyX file format, we
> > want it to remain possible to do the sort of simple scripting we all
> > like to be able to do. The XML business is really just a matter of
> > replacing things like this:
> >
> > \begin_layout Standard
> > this.
> > \end_layout
> >
> > \begin_layout Standard
> > \begin_inset CommandInset bibtex
> > LatexCommand bibtex
> > bibfiles "/tmp/bib"
> > options "plain"
> >
> > \end_inset
> >
> >
> > \end_layout
> >
> > with things like this:
> >
> > 
> > this.
> > 
> >
> > 
> >  > /> 
> >
> > Just as easy to parse, I hope. Maybe even easier.
> >
> > That's not anything actually agreed or implemented
>
> It's not as easy to parse, but it's reasonable. If that's the extent of the
> XMLization of LyX, it should still be somewhat tweakable with Vim, Perl,
> etc.
>
> The real problems come in when they do things in XML that would be
> denormalization in a database. Store the paragraphs one place, and then
> store the *number of paragraphs* somewhere else, so if you add a paragraph
> and forget to increment the number, your doc no longer opens.
>
> Or treating the XML file like a relational database, where you have a list
> of styles with numbered IDs one place, and then have those numbers applied
> to paragraphs somewhere else. This is an excellent programming technique,
> but for the guy just trying to casually go in and tweak something, or
> casually trying to programmatically generate LyX data, it can be daunting
> indeed. Personally, I love having my style defs in the layout file and
> using the style names as their identifiers.
>
> Then there's this habit of people like OpenOffice, where the native format
> is a Zip file unzipping to different directories, each containing XML files
> and other types of files. Yeah, I just dare anyone to generate OpenOffice
> on the fly.
>
> I suggest that whatever you decide, you document the XML structure. I don't
> mean document as in "it's open source, read the code". I mean document as
> in "Here is the data hierarchy, here is the high level data design, here
> are our reasons for doing it this way, here are the data interdependencies,
> here are some tips for building LyX files programmatically and tweaking
> them either programmatically or with an editor. And here is a tutorial on
> building and tweaking LyX files without the LyX front end.
>
> I'm busy these days, but if you keep me in the loop I'll do at least a good
> chunk of that documentation.
>
> One more thing -- if you're going XML and don't want to reinvent the wheel,
> you'll be using someone else's XML parser. Please, please, PLEASE, don't
> make it some parser with tons of dependency so that the guy with a 2 year
> old distro can't compile LyX because of the XML parser. We already have
> enough problems with Qt dependencies.
>
> Thanks
>
> SteveT
>
> Steve Litt
> Recession Relief Package
> http://www.recession-relief.US




Re: Progress on the MS Word to LyX conversion (xml)

2008-07-22 Thread rgheck

José Matos wrote:

now imagine those regexps where you need to escape all those \"

in conclusion xml will be pain for people trying to use .lyx files
directly with scripts etc.



Clearly you did not had to deal with the lyx file format like I did. :-) 
If your idea of a parser is a set of regexp's that is so 80's. ;-)


  
In fairness, I think he was talking about little hacked scripts to do 
the kind of search-and-replace that isn't possible yet in LyX itself. So 
you don't really have a parser in that case. Just a very long string. ;-)


This seems to me like the debate between strong and bold. I want to parse the 
lyx file on a content based stream, not just a set of lines.


After the change to xml the regularity will still be there with the added 
bonus that finally it will be consistent. We took 6 years to clean the lyx 
format to a reasonable state and we are still not there yet.


  
So, Jose, are we ever actually going to do this? If so, then it seems to 
me we ought to decide to do it, halt other development for the few weeks 
it would take, and do it. I don't think it would really be that hard to 
have it working. The existing parser could be tweaked for the short 
term. It's already capable of dealing with tabulars, and those are 
written as XML already. Longer term, we'd prefer libxml2 or 
something---SAX, I assume, rather than DOM---, but that could be done 
after the format had stabilized.


Yeah, I know, wrong list.

rh



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-22 Thread rgheck

Pavel Sanda wrote:

Steve Litt wrote:

this.






Just as easy to parse, I hope. Maybe even easier.



now you are joking right? :) i just see all the bugs just because '>' is 
redirection.

  

Only in the shell, right?


now imagine those regexps where you need to escape all those \"

  
There's lots of that in LyX now. But it's easy to deal with in Python, 
at least, via the r'' quoter. And in Perl, you have qr//. So the quotes 
aren't really a problem. Moreover, if you're editing by hand, you can 
use something that recognizes XML.


But, well, XML isn't exactly around the corner, anyway, so far as I can 
tell.


rh



Re: Progress on the MS Word to LyX conversion (xml)

2008-07-22 Thread José Matos
On Tuesday 22 July 2008 22:54:14 Pavel Sanda wrote:
>
> now you are joking right? :) i just see all the bugs just because '>' is
> redirection. and imho manually generate \begin_layout Standard is more
> simpler
> then typing .

You are welcome to reimplement lyx in shell, good luck. :-)

> now imagine those regexps where you need to escape all those \"
>
> in conclusion xml will be pain for people trying to use .lyx files
> directly with scripts etc.

Clearly you did not had to deal with the lyx file format like I did. :-) 
If your idea of a parser is a set of regexp's that is so 80's. ;-)

This seems to me like the debate between strong and bold. I want to parse the 
lyx file on a content based stream, not just a set of lines.

After the change to xml the regularity will still be there with the added 
bonus that finally it will be consistent. We took 6 years to clean the lyx 
format to a reasonable state and we are still not there yet.

It is funny to see all this nostalgia around something that is/was a 
nightmare. If the syntax was so clear you would not have the problem of 
crashing lyx with a bad formed file (a file modified by scripts).

> pavel

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion

2008-07-22 Thread José Matos
On Tuesday 22 July 2008 21:04:59 Steve Litt wrote:
> One more thing -- if you're going XML and don't want to reinvent the wheel,
> you'll be using someone else's XML parser. Please, please, PLEASE, don't
> make it some parser with tons of dependency so that the guy with a 2 year
> old distro can't compile LyX because of the XML parser. We already have
> enough problems with Qt dependencies.

The idea is to have a DTD to describe the XML and to use a standard parser 
like libxml2. This should meet both criteria. :-)

> Thanks
>
> SteveT

-- 
José Abílio


Re: Progress on the MS Word to LyX conversion (xml)

2008-07-22 Thread Pavel Sanda
> Steve Litt wrote:
> 
> this.
> 
>
> 
> 
> 
>
> Just as easy to parse, I hope. Maybe even easier.

now you are joking right? :) i just see all the bugs just because '>' is 
redirection.
and imho manually generate \begin_layout Standard is more simpler
then typing . 

now imagine those regexps where you need to escape all those \"

in conclusion xml will be pain for people trying to use .lyx files
directly with scripts etc.
pavel


Re: Progress on the MS Word to LyX conversion

2008-07-22 Thread Steve Litt
On Tuesday 22 July 2008 11:32, rgheck wrote:
> Steve Litt wrote:
> > I don't know how it will be after LyX goes XML, but right now at 1.5.3,
> > converting my LyX code to something else by parsing the LyX native code
> > would be trivial.
>
> My understanding is that, whatever happens with the LyX file format, we
> want it to remain possible to do the sort of simple scripting we all
> like to be able to do. The XML business is really just a matter of
> replacing things like this:
>
> \begin_layout Standard
> this.
> \end_layout
>
> \begin_layout Standard
> \begin_inset CommandInset bibtex
> LatexCommand bibtex
> bibfiles "/tmp/bib"
> options "plain"
>
> \end_inset
>
>
> \end_layout
>
> with things like this:
>
> 
> this.
> 
>
> 
> 
> 
>
> Just as easy to parse, I hope. Maybe even easier.
>
> That's not anything actually agreed or implemented

It's not as easy to parse, but it's reasonable. If that's the extent of the 
XMLization of LyX, it should still be somewhat tweakable with Vim, Perl, etc.

The real problems come in when they do things in XML that would be 
denormalization in a database. Store the paragraphs one place, and then store 
the *number of paragraphs* somewhere else, so if you add a paragraph and 
forget to increment the number, your doc no longer opens.

Or treating the XML file like a relational database, where you have a list of 
styles with numbered IDs one place, and then have those numbers applied to 
paragraphs somewhere else. This is an excellent programming technique, but 
for the guy just trying to casually go in and tweak something, or casually 
trying to programmatically generate LyX data, it can be daunting indeed. 
Personally, I love having my style defs in the layout file and using the 
style names as their identifiers.

Then there's this habit of people like OpenOffice, where the native format is 
a Zip file unzipping to different directories, each containing XML files and 
other types of files. Yeah, I just dare anyone to generate OpenOffice on the 
fly.

I suggest that whatever you decide, you document the XML structure. I don't 
mean document as in "it's open source, read the code". I mean document as 
in "Here is the data hierarchy, here is the high level data design, here are 
our reasons for doing it this way, here are the data interdependencies, here 
are some tips for building LyX files programmatically and tweaking them 
either programmatically or with an editor. And here is a tutorial on building 
and tweaking LyX files without the LyX front end.

I'm busy these days, but if you keep me in the loop I'll do at least a good 
chunk of that documentation.

One more thing -- if you're going XML and don't want to reinvent the wheel, 
you'll be using someone else's XML parser. Please, please, PLEASE, don't make 
it some parser with tons of dependency so that the guy with a 2 year old 
distro can't compile LyX because of the XML parser. We already have enough 
problems with Qt dependencies.

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion

2008-07-22 Thread rgheck

Steve Litt wrote:
I don't know how it will be after LyX goes XML, but right now at 1.5.3, 
converting my LyX code to something else by parsing the LyX native code would 
be trivial.


  
My understanding is that, whatever happens with the LyX file format, we 
want it to remain possible to do the sort of simple scripting we all 
like to be able to do. The XML business is really just a matter of 
replacing things like this:


\begin_layout Standard
this.
\end_layout

\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "/tmp/bib"
options "plain"

\end_inset


\end_layout

with things like this:


this.






Just as easy to parse, I hope. Maybe even easier.

That's not anything actually agreed or implemented

rh



Re: Progress on the MS Word to LyX conversion

2008-07-22 Thread Steve Litt
On Tuesday 22 July 2008 06:32, Christian Ridderström wrote:
> On Mon, 21 Jul 2008, Steve Litt wrote:
> > This morning I got an acceptably tagged text file out of MS Word. From
> > that moment on, things got much easier.
>
> Congratulations!
>
> I put a reference to your post on a wiki page, giving others that need to
> do this a starting point. (If you want to summarize how you did it and
> post the relevant scripts on the wiki, I can help you with it). Here's the
> page:
>   http://wiki.lyx.org/Tools/Word2LyXConversionProcess
>
> While doing this, I found this page:


Thanks Christian!

One use for the new page is showing people how to convert word to LyX while 
preserving all styles. Perhaps an even greater use for this page is showing 
people the mess they'll get themselves into by using MS Word to write a book.

I don't know how it will be after LyX goes XML, but right now at 1.5.3, 
converting my LyX code to something else by parsing the LyX native code would 
be trivial.

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Progress on the MS Word to LyX conversion

2008-07-22 Thread Christian Ridderström

On Mon, 21 Jul 2008, Steve Litt wrote:


This morning I got an acceptably tagged text file out of MS Word. From that
moment on, things got much easier.


Congratulations!

I put a reference to your post on a wiki page, giving others that need to 
do this a starting point. (If you want to summarize how you did it and 
post the relevant scripts on the wiki, I can help you with it). Here's the 
page:

http://wiki.lyx.org/Tools/Word2LyXConversionProcess

While doing this, I found this page:

http://wiki.lyx.org/Tools/Word2LyXMacro

Maybe it can help you with the tables if nothing else?

/Christian

--
Christian Ridderström, +46-8-768 39 44http://www.md.kth.se/~chr

Progress on the MS Word to LyX conversion

2008-07-21 Thread Steve Litt
This morning I got an acceptably tagged text file out of MS Word. From that 
moment on, things got much easier.

I made a perl script to remove end tags, and instead put start tags on all 
lines between a start and end. It also made sure there were no interlinking 
tag sets. It also put all the start tags in the same format and easily 
parsable. I hadn't thought to do that when converting out of MS Word -- I had 
bigger fish to fry at the time.

I hadn't marked Normal paragraphs, so my program had to deduce which lines 
weren't marked already, and put a b_pstyle_normal::: start tag on them.

Armed with proper start tags on every line (which is actually a paragraph), it 
was pretty easy to pipe that through something that added the \begin_layout 
Whatever and \end_layout commands. At this point I have NOT removed the start 
or end tags -- I want some redundancy for checking. I also added a little C 
program to get rid of the '\015' characters that DOS put in.

I made a layout with dummy styles for each style I used (sort -u came in very 
handy for this).

Anyway, my program can make the body of a LyX file, and all the 
Part/Chapter/Section etc works perfectly, and it seems like all the other 
paragraph styles are working. It's basically a pipeline of little filters 
creating a LyX file from the text file, and I can do it over and over to my 
heart's content. 

I imagine tomorrow I'll add the code to handle character styles, and start 
making my layout file create effects that look how they're supposed to. That 
will help in looking at the produced PDF (it already produces a PDF, so the 
basic code is correct).

Bottom line, I now have a text file with tags representing all my document's 
original style, and I've created perl, awk, sed and C code to convert it to a 
LyX document with my styles preserved.

Anyway, thanks for all the help.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: MS Word to LyX?

2007-09-04 Thread Jeremy C. Reed
On Tue, 4 Sep 2007, Steve Litt wrote:

> I don't spoze there's an rtf to LaTeX converter that doesn't require Word 
> or .Net?

ftp://ftp.dante.de/pub/tex/support/rtf2latex/

Or export to HTML and then run "tidy" for it. And then HTML to LaTeX with:

http://html2latex.sourceforge.net/

Then import into LyX.

(I see that LyX has an File -> Import -> HTML but I don't use it.)

I have used these a lot. But it still takes a lot to clean up. (And I 
haven't used the styles yet.)

I often just use vi to search and replace in the new LyX file and then 
reload in LyX when ready to start working on it.

  Jeremy C. Reed


Re: MS Word to LyX?

2007-09-04 Thread William Adams

On Sep 4, 2007, at 2:07 PM, Steve Litt wrote:

I have another idea. I could write a series of Word macros to find  
styles and
write their names as tags within the text. Then export as text,  
write a Ruby
parser, and convert to LyX. Only thing is, I don't know if I can  
write the
word macros to do that. Any of you know of online documentation on  
writing

fairly complex word macros? I've got MS Word 97 IIRC.


Actually, it's fairly simple.

Here's a bit of WordBASIC which I found very useful when doing  
something similar:


http://groups.google.com/group/adobe.scripting.indesign/msg/ 
4da089d8e1739be1'


If you handle special characters and character styles by search- 
replacing them first, then apply the above code suitably adapted to  
your needs I believe you'll be all set.


William

--
William Adams
senior graphic designer
Fry Communications




Re: MS Word to LyX?

2007-09-04 Thread Georg Baum
Steve Litt wrote:

> Is there a way to transfer an MS Word document to LyX, preserving the
> paragraph and character styles in the document? I don't care how messed up
> it looks after transfer -- I can tweak the layout file to suit my needs,
> but I'd prefer not to lose styles.
> 
> Anyone know how to do that?

Translate it to .sxw with OOo and then use
http://www.hj-gym.dk/~hj/writer2latex/ in clean mode. It works pretty well
on structured documents, and you can even define your own mappings for
different styles.
This procedure probably requires some tweaking of writer2latex, but should
give pretty good results.
After that import the .tex file in LyX (might need some tweaking of the
syntax.default file as well).


Georg



Re: MS Word to LyX?

2007-09-04 Thread Richard Heck


On Tuesday 04 September 2007 13:34, Steve Litt wrote:
  

> On Tuesday 04 September 2007 12:45, John Kane wrote:


> > Word-to-LaTex will give you a LaTeX file that you
> > might then able to import to LyX
> > http://kebrt.webz.cz/programs/word-to-latex/index.html
> > . I suspect the results will be VERY ugly.
  

>
> This looks like what I need. 

Oops, maybe not. I just read the specifications -- it's a Windows based 
program requiring Word 2002 (I have Word 97 on Windows 98) and .Net 1.1 
or .Net 2.0 (I have neither, and don't want to take the time to install them 
because I no longer use Windows).


I don't spoze there's an rtf to LaTeX converter that doesn't require Word 
or .Net?
  
But somebody here might be able to do the conversion for you, and send 
you the result.
I have another idea. I could write a series of Word macros to find styles and 
write their names as tags within the text. Then export as text, write a Ruby 
parser, and convert to LyX. Only thing is, I don't know if I can write the 
word macros to do that. Any of you know of online documentation on writing 
fairly complex word macros? I've got MS Word 97 IIRC.
  
What if you export the Word document to HTML? Do you get some CSS with 
it? Those may encode your styles, and then you can write your simple 
script. Or some HTML->LaTeX converter might do it for you.


Richard



Re: MS Word to LyX?

2007-09-04 Thread Steve Litt
On Tuesday 04 September 2007 13:35, you wrote:
> On Tuesday 04 September 2007, Steve Litt wrote:
> > Hi all,
> >
> > My 1999 classic, "Rapid Learning: Secret Weapon of the Successful
> > Technologist" was written in MS Word. It was a styles based document. Now
> > I want to make a second edition.
> >
> > I tried to work on it in OpenOffice, but OpenOffice is terrible.
> >
> > Is there a way to transfer an MS Word document to LyX, preserving the
> > paragraph and character styles in the document? I don't care how messed
> > up it looks after transfer -- I can tweak the layout file to suit my
> > needs, but I'd prefer not to lose styles.
> >
> > Anyone know how to do that?
>
> Steve,
>
> I've struggled with this kind of conversion -- both ways -- for years. Here
> are a few possibilities, none of them pleasant:
>
> 1. Use the MS Word import in Lyx, which uses wvCleanLatex.
>This sometimes works -- but does not seem to retain styles, 

That's a showstopper

>and loads 
>the preamble with a whole lot of junk which make it hard to get the
>format to what you want.

That's no big deal, but the dropping of styles is a showstopper.
>
> 2. Export from OpenOffice to LaTeX 2e, then import into Lyx.
>I've often had to do quite a bit of editing the LaTeX  before Lyx will
>load the file, and the result in Lyx is often horrible, and sometimes
>unusable.  I get things like whole paragraphs of text changed to Math
> mode, with no spaces between words.  But with some documents it works well.

I have no math mode stuff in this document, so no problem. However, my 
experience with MS Word to OO Writer is it drops the styles. Anyone else know 
anything about this? If I *can* preserve the styles, this would probably be 
what I want. I can blow off any junk placed in it.
>
> 3. Copy blocks of text in OpenOffice and Paste External Selection in Lyx.
>This sometimes works quite well, but I'd hate to do it for a large
>document.

It's about 90,000 words :-)

>
> 4. Export from OpenOffice as text, then import it as paragraphs into Lyx.
>You'll have to go through the exported file with a text editor to make
>sure you have an empty line between paragraphs, and have to go through
>the Lyx document to assign a style to each paragraph -- but at least you
>have a clean preamble and nothing totally messed up.  This is the way
>I usually end up making the conversion.

Ug!

I have another idea. I could write a series of Word macros to find styles and 
write their names as tags within the text. Then export as text, write a Ruby 
parser, and convert to LyX. Only thing is, I don't know if I can write the 
word macros to do that. Any of you know of online documentation on writing 
fairly complex word macros? I've got MS Word 97 IIRC.

Thanks

SteveT

Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/



Re: MS Word to LyX?

2007-09-04 Thread Bob Lounsbury
On 9/4/07, Steve Litt <[EMAIL PROTECTED]> wrote:
 > I don't spoze there's an rtf to LaTeX converter that doesn't require Word
> or .Net?

There is latex2rtf and rtf2latex. Don't know if it preserves any
styles. It's available on Linux.

Bob


Re: MS Word to LyX?

2007-09-04 Thread Oisin Feeley
On 9/4/07, Steve Litt <[EMAIL PROTECTED]> wrote:
> On Tuesday 04 September 2007 13:34, Steve Litt wrote:
> > On Tuesday 04 September 2007 12:45, John Kane wrote:
> > > Word-to-LaTex will give you a LaTeX file that you
> > > might then able to import to LyX
> > > http://kebrt.webz.cz/programs/word-to-latex/index.html
> > > . I suspect the results will be VERY ugly.
> >
> > This looks like what I need.
>
> Oops, maybe not. I just read the specifications -- it's a Windows based
> program requiring Word 2002 (I have Word 97 on Windows 98) and .Net 1.1
> or .Net 2.0 (I have neither, and don't want to take the time to install them
> because I no longer use Windows).
>
> I don't spoze there's an rtf to LaTeX converter that doesn't require Word
> or .Net?

There are more suggestions in the FAQ section of the wiki which may be useful:

http://wiki.lyx.org/FAQ/Compatibility

Best wishes,
Oisin Feeley


Re: MS Word to LyX?

2007-09-04 Thread Steve Litt
On Tuesday 04 September 2007 13:34, Steve Litt wrote:
> On Tuesday 04 September 2007 12:45, John Kane wrote:
> > Word-to-LaTex will give you a LaTeX file that you
> > might then able to import to LyX
> > http://kebrt.webz.cz/programs/word-to-latex/index.html
> > . I suspect the results will be VERY ugly.
>
> This looks like what I need. 

Oops, maybe not. I just read the specifications -- it's a Windows based 
program requiring Word 2002 (I have Word 97 on Windows 98) and .Net 1.1 
or .Net 2.0 (I have neither, and don't want to take the time to install them 
because I no longer use Windows).

I don't spoze there's an rtf to LaTeX converter that doesn't require Word 
or .Net?

Thanks

SteveT

Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/



Re: MS Word to LyX?

2007-09-04 Thread Steve Litt
On Tuesday 04 September 2007 12:45, John Kane wrote:
> Word-to-LaTex will give you a LaTeX file that you
> might then able to import to LyX
> http://kebrt.webz.cz/programs/word-to-latex/index.html
> . I suspect the results will be VERY ugly.

This looks like what I need. No matter how ugly the output, I can massage it 
back into health. If it doesn't convert from LaTeX to LyX, I can convert word 
to XML instead, parse the XML and convert it to LyX. The documentation says 
it preserves both paragraph and character styles, and allows you to specify 
placeholder names for equivalent environments, which I can later code.

>
> Actually OOo is usually fine.  It's Word's practice of
> mangling styles that seems to mess it up.  :)

Even on brand new OO files, styles are extremely problematic. If OO were the 
last content authoring system on earth, I'd be tempted to go back to pen and 
paper.

So thank you all for creating LyX!

SteveT


Re: MS Word to LyX?

2007-09-04 Thread John Kane
Word-to-LaTex will give you a LaTeX file that you
might then able to import to LyX
http://kebrt.webz.cz/programs/word-to-latex/index.html
. I suspect the results will be VERY ugly.

Actually OOo is usually fine.  It's Word's practice of
mangling styles that seems to mess it up.  :)

--- Steve Litt <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> My 1999 classic, "Rapid Learning: Secret Weapon of
> the Successful 
> Technologist" was written in MS Word. It was a
> styles based document. Now I 
> want to make a second edition.
> 
> I tried to work on it in OpenOffice, but OpenOffice
> is terrible.
> 
> Is there a way to transfer an MS Word document to
> LyX, preserving the 
> paragraph and character styles in the document? I
> don't care how messed up it 
> looks after transfer -- I can tweak the layout file
> to suit my needs, but I'd 
> prefer not to lose styles.
> 
> Anyone know how to do that?
> 
> Thanks
> 
> SteveT
> 
> Steve Litt
> Author: Universal Troubleshooting Process books and
> courseware
> http://www.troubleshooters.com/
> 



  Get news delivered with the All new Yahoo! Mail.  Enjoy RSS feeds right 
on your Mail page. Start today at http://mrd.mail.yahoo.com/try_beta?.intl=ca


MS Word to LyX?

2007-09-04 Thread Steve Litt
Hi all,

My 1999 classic, "Rapid Learning: Secret Weapon of the Successful 
Technologist" was written in MS Word. It was a styles based document. Now I 
want to make a second edition.

I tried to work on it in OpenOffice, but OpenOffice is terrible.

Is there a way to transfer an MS Word document to LyX, preserving the 
paragraph and character styles in the document? I don't care how messed up it 
looks after transfer -- I can tweak the layout file to suit my needs, but I'd 
prefer not to lose styles.

Anyone know how to do that?

Thanks

SteveT

Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/


Re: MS Word to LyX : Losing special characters

2007-02-13 Thread John Kane

--- Daniel Lohmann
<[EMAIL PROTECTED]> wrote:

> John Kane schrieb:
> 
> > 
> > No I'm not using Word(well not if I can help it. I
> > normally use OOo as a WP, with "smart quotes" off,
> but
> > I get some very badly formatted  Word documents
> for
> > internal use.  Occasionally it is easier to put
> them
> > into LyX than it is to try to reformat them into
> > something readable in Word.
> > 
> > Normally I would just open a Word file in OOo but
> some
> > people have so few clews about formatting that
> > cleaning up a Word document is more trouble than
> it's
> > worth for internal use.  LyX handles a lot of the
> > problems very quickly and invisibly. 
> 
> 
> Sounds as if it might even be worth it to record all
> the necessary 
> Search&Replace actions and save them as Word or OO
> macro :-)
> 
> Daniel

Good idea indeed. 

Last time I wrote a macro was in Lotus 123 about 16-18
years ago but if I keep moving Word junk to LyX I may
have to do one again.  It probably would not take long
since it seems to be only 5-6 items consistantly.

Thanks

 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: MS Word to LyX : Losing special characters

2007-02-13 Thread Daniel Lohmann

John Kane schrieb:



No I'm not using Word(well not if I can help it. I
normally use OOo as a WP, with "smart quotes" off, but
I get some very badly formatted  Word documents for
internal use.  Occasionally it is easier to put them
into LyX than it is to try to reformat them into
something readable in Word.

Normally I would just open a Word file in OOo but some
people have so few clews about formatting that
cleaning up a Word document is more trouble than it's
worth for internal use.  LyX handles a lot of the
problems very quickly and invisibly. 



Sounds as if it might even be worth it to record all the necessary 
Search&Replace actions and save them as Word or OO macro :-)


Daniel


Re: MS Word to LyX : Losing special characters

2007-02-13 Thread John Kane

--- Daniel Watkins <[EMAIL PROTECTED]> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> John Kane wrote:
> >> Oh of course.  I cannot turn it off since I
> didn't
> >> produce the document but a search and replace is
> easy
> >> enough.  
> I'm assuming that you're using Word. If you don't
> disable the Smart
> Quote option within Word, it may well just replace
> anything you change,
> because it's being 'smart'.

No I'm not using Word(well not if I can help it. I
normally use OOo as a WP, with "smart quotes" off, but
I get some very badly formatted  Word documents for
internal use.  Occasionally it is easier to put them
into LyX than it is to try to reformat them into
something readable in Word.

Normally I would just open a Word file in OOo but some
people have so few clews about formatting that
cleaning up a Word document is more trouble than it's
worth for internal use.  LyX handles a lot of the
problems very quickly and invisibly. 

Thanks

Thanks though
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.3 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -
> http://enigmail.mozdev.org
> 
>
iD8DBQFF0Z3e3arasOikFPYRAh+EAJ949PZEz2yhdnsyRwmCDQUBQTjnqQCfcs3l
> GVDGkk7XuSsvMcPXsV+wc1M=
> =qYBe
> -END PGP SIGNATURE-
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: MS Word to LyX : Losing special characters

2007-02-13 Thread Daniel Watkins
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

John Kane wrote:
>> Oh of course.  I cannot turn it off since I didn't
>> produce the document but a search and replace is easy
>> enough.  
I'm assuming that you're using Word. If you don't disable the Smart
Quote option within Word, it may well just replace anything you change,
because it's being 'smart'.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF0Z3e3arasOikFPYRAh+EAJ949PZEz2yhdnsyRwmCDQUBQTjnqQCfcs3l
GVDGkk7XuSsvMcPXsV+wc1M=
=qYBe
-END PGP SIGNATURE-



Re: MS Word to LyX : Losing special characters

2007-02-13 Thread John Kane

--- Daniel Watkins <[EMAIL PROTECTED]> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> John Kane wrote:
> > My problem is that I  am getting  a ? for " (curly
> > quotes)
> LaTeX uses `` and '' for opening and closing quotes,
> so you should be
> able to search and replace, in Word, for that
> (though there is a Smart
> Quote option or somesuch that you have to turn off).
Oh of course.  I cannot turn it off since I didn't
produce the document but a search and replace is easy
enough.  

> 
> > and for some other things like an em-dash or
> > the Greek letter pi.
> Again, I presume this is because LaTeX uses
> something different for
> these as well. If you search for these and replace
> them with another
> string of characters, which will not be replicated
> anywhere else, in
> Word then you can then search for that string of
> characters and replace
> it, in LyX, with the correct representation.


Yes of course.  Thanks again.

> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.3 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -
> http://enigmail.mozdev.org
> 
>
iD8DBQFF0Yru3arasOikFPYRAuUlAJ94QsVocZdnD01MMm/RHJS9oTRaXgCeIHqn
> jFKmbkQ0fqFUomQoG1T8l8o=
> =pMs3
> -END PGP SIGNATURE-
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: MS Word to LyX : Losing special characters

2007-02-13 Thread Daniel Watkins
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

John Kane wrote:
> My problem is that I  am getting  a ? for " (curly
> quotes)
LaTeX uses `` and '' for opening and closing quotes, so you should be
able to search and replace, in Word, for that (though there is a Smart
Quote option or somesuch that you have to turn off).

> and for some other things like an em-dash or
> the Greek letter pi.
Again, I presume this is because LaTeX uses something different for
these as well. If you search for these and replace them with another
string of characters, which will not be replicated anywhere else, in
Word then you can then search for that string of characters and replace
it, in LyX, with the correct representation.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF0Yru3arasOikFPYRAuUlAJ94QsVocZdnD01MMm/RHJS9oTRaXgCeIHqn
jFKmbkQ0fqFUomQoG1T8l8o=
=pMs3
-END PGP SIGNATURE-



MS Word to LyX : Losing special characters

2007-02-12 Thread John Kane
What is the current approach to importing Word
documents to LyX?

I don't want to do anything fancy. I have some very
poorly formatted Word docs (working docs not for
publication) and I have found that simply cutting and
pasting the text into LyX and doing a bit of
formatting can save me a lot of frustration trying to
read poorly laid out pages.

My problem is that I  am getting  a ? for " (curly
quotes) and for some other things like an em-dash  or
the Greek letter pi. .  It looks like an encoding
problem but I don't see how to approach it since I
don't see how to check what encoding  LyX is using,
nor Word's encoding.

I also seem to be getting an occasional empty box for
a subscript in an equation but I can live with that
since  it is better to re- enter the few equations
with Lyx for better formatting anyway.

Other things like headings etc I can easily redo in a
few minutes but finding and replacing the ?' is a
pain.

Any suggestions? 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com