Re: Google Docs to LaTeX

2008-05-02 Thread nodje

Hi everyone,

sorry for the late reply, I wasn't receiving alerts for the thread.

Actually Charles' first reply was the only one I saw before today but was
useful enough.
I would give me a fairly straight forward GoogleDoc - LaTeX process. I
started working my way from that point on.

I'm right now not fully understanding the detailed content of all the
replies, but as I have to write my doc in French, I understand the filtering
need :)

And finally, Luis' advice is the just great. I'll go for this. That really
seems to be the way to go.

But all in all, the weird thing is that I learn a lot about LaTeX in trying
to find out a good publishing solution for my GoogleDocs, and I don't feel I
really need LyX anymore.

It seems better to me to master html2latex and LaTeX itself. I use GoogleDoc
as a visual tool anyway :-/

-nodje

Luis Rivera-3 wrote:
 
 Michael Thompson [EMAIL PROTECTED] writes:
 
 
 Dear Charles, 
 It is very cool grasping how to use sed in however a primitive way.  But
 on
 further investigation it seems one needs it for a LyX friendly use of
 ``writer2latex'' only if the document has tables, math, images ... or
 French. 
 With a fairly wide but unscientifically chosen variety of English
 documents, I
 found that the desiderata of: 
 (a) retaining crucial formatting that an English language Word or
 OpenOffice or
 docs.google user would likely employ 
 and: 
 (b) avoiding a demoralizing film of ERT 
 by messing with the preferences in writer2latex.xml.  
 
 
 Indeed, the script is not necessary if you edit the writer2latex.xml file
 in
 your system, as you've done already. All you need to do is to select the
 appropriate encoding (latin9 is the most popular, after utf8 for latin
 writing
 systems, as you've found out).
 
 Personally, I prefer to avoid loading a full Office Suite to make the
 conversion, so I bypass them by not saving my googledocs papers into word,
 rtf,
 or odf. Try saving your GoogleDocs documents as HTML, and then convert
 them with
 html2tex. Check
 
 http://www.iwriteiam.nl/html2tex.html
 
 All you need is a friendly gcc compiler (or a friend to give it to you),
 and it
 makes the whole work for you with a simple call to the converter.
 
 Perhaps you may have to call html-tidy to cleanup the HTML source a bit,
 but a
 simple bash script (or in windows, a bat file) will work.
 
 Small is beautiful,
 
 Luis.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Google-Docs-to-LaTeX-tp16790653p17009494.html
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: Google Docs to LaTeX

2008-05-02 Thread nodje

Hi everyone,

sorry for the late reply, I wasn't receiving alerts for the thread.

Actually Charles' first reply was the only one I saw before today but was
useful enough.
I would give me a fairly straight forward GoogleDoc - LaTeX process. I
started working my way from that point on.

I'm right now not fully understanding the detailed content of all the
replies, but as I have to write my doc in French, I understand the filtering
need :)

And finally, Luis' advice is the just great. I'll go for this. That really
seems to be the way to go.

But all in all, the weird thing is that I learn a lot about LaTeX in trying
to find out a good publishing solution for my GoogleDocs, and I don't feel I
really need LyX anymore.

It seems better to me to master html2latex and LaTeX itself. I use GoogleDoc
as a visual tool anyway :-/

-nodje

Luis Rivera-3 wrote:
 
 Michael Thompson [EMAIL PROTECTED] writes:
 
 
 Dear Charles, 
 It is very cool grasping how to use sed in however a primitive way.  But
 on
 further investigation it seems one needs it for a LyX friendly use of
 ``writer2latex'' only if the document has tables, math, images ... or
 French. 
 With a fairly wide but unscientifically chosen variety of English
 documents, I
 found that the desiderata of: 
 (a) retaining crucial formatting that an English language Word or
 OpenOffice or
 docs.google user would likely employ 
 and: 
 (b) avoiding a demoralizing film of ERT 
 by messing with the preferences in writer2latex.xml.  
 
 
 Indeed, the script is not necessary if you edit the writer2latex.xml file
 in
 your system, as you've done already. All you need to do is to select the
 appropriate encoding (latin9 is the most popular, after utf8 for latin
 writing
 systems, as you've found out).
 
 Personally, I prefer to avoid loading a full Office Suite to make the
 conversion, so I bypass them by not saving my googledocs papers into word,
 rtf,
 or odf. Try saving your GoogleDocs documents as HTML, and then convert
 them with
 html2tex. Check
 
 http://www.iwriteiam.nl/html2tex.html
 
 All you need is a friendly gcc compiler (or a friend to give it to you),
 and it
 makes the whole work for you with a simple call to the converter.
 
 Perhaps you may have to call html-tidy to cleanup the HTML source a bit,
 but a
 simple bash script (or in windows, a bat file) will work.
 
 Small is beautiful,
 
 Luis.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Google-Docs-to-LaTeX-tp16790653p17009494.html
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: Google Docs to LaTeX

2008-05-02 Thread nodje

Hi everyone,

sorry for the late reply, I wasn't receiving alerts for the thread.

Actually Charles' first reply was the only one I saw before today but was
useful enough.
I would give me a fairly straight forward GoogleDoc -> LaTeX process. I
started working my way from that point on.

I'm right now not fully understanding the detailed content of all the
replies, but as I have to write my doc in French, I understand the filtering
need :)

And finally, Luis' advice is the just great. I'll go for this. That really
seems to be the way to go.

But all in all, the weird thing is that I learn a lot about LaTeX in trying
to find out a good publishing solution for my GoogleDocs, and I don't feel I
really need LyX anymore.

It seems better to me to master html2latex and LaTeX itself. I use GoogleDoc
as a visual tool anyway :-/

-nodje

Luis Rivera-3 wrote:
> 
> Michael Thompson <[EMAIL PROTECTED]> writes:
> 
>> 
>> Dear Charles, 
>> It is very cool grasping how to use sed in however a primitive way.  But
>> on
>> further investigation it seems one needs it for a LyX friendly use of
>> ``writer2latex'' only if the document has tables, math, images ... or
>> French. 
>> With a fairly wide but unscientifically chosen variety of English
>> documents, I
>> found that the desiderata of: 
>> (a) retaining crucial formatting that an English language Word or
>> OpenOffice or
>> docs.google user would likely employ 
>> and: 
>> (b) avoiding a demoralizing film of ERT 
>> by messing with the preferences in writer2latex.xml.  
>> 
> 
> Indeed, the script is not necessary if you edit the writer2latex.xml file
> in
> your system, as you've done already. All you need to do is to select the
> appropriate encoding (latin9 is the most popular, after utf8 for latin
> writing
> systems, as you've found out).
> 
> Personally, I prefer to avoid loading a full Office Suite to make the
> conversion, so I bypass them by not saving my googledocs papers into word,
> rtf,
> or odf. Try saving your GoogleDocs documents as HTML, and then convert
> them with
> html2tex. Check
> 
> http://www.iwriteiam.nl/html2tex.html
> 
> All you need is a friendly gcc compiler (or a friend to give it to you),
> and it
> makes the whole work for you with a simple call to the converter.
> 
> Perhaps you may have to call html-tidy to cleanup the HTML source a bit,
> but a
> simple bash script (or in windows, a bat file) will work.
> 
> Small is beautiful,
> 
> Luis.
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Google-Docs-to-LaTeX-tp16790653p17009494.html
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: Google Docs to LaTeX

2008-04-22 Thread Michael Thompson
Dear Charles, 
It is very cool grasping how to use sed in however a primitive way.  But on
further investigation it seems one needs it for a LyX friendly use of
``writer2latex'' only if the document has tables, math, images ... or French. 
With a fairly wide but unscientifically chosen variety of English documents, I
found that the desiderata of: 
(a) retaining crucial formatting that an English language Word or OpenOffice or
docs.google user would likely employ 
and: 
(b) avoiding a demoralizing film of ERT 
by messing with the preferences in writer2latex.xml.  

The accursed red {}- is what remains, though the obvious expedient of a find and
replace in the latex file before importing into LyX is clearly the way to go if
that's all there is.  I think it has to do with the ucs.sty that is used in
connection with the choice of utf8 among the 'inputencoding' options. But this
is way over my head. 

I don't know how far this depends on how various things are adjusted on the (mac
)computer I was using - doc-odt-latex-lyx involves a lot of adjustments - but
for the heck of it I will list the alterations from the defaults that seemed to
maximize what is preserved subject to the principle of ERT avoidance:

option name=inputencoding value=utf8 /
option name=multilingual value=false /
in place  of 
option name=inputencoding value=ascii /
option name=multilingual value=true /


option name=formatting value=ignore_most /
option name=page_formatting value=ignore_all /
option name=ignore_hard_page_breaks value=true /
option name=ignore_hard_line_breaks value=true /
option name=ignore_empty_paragraphs value=true /
option name=ignore_double_spaces value=true /
in place of
option name=formatting value=convert_basic /
option name=page_formatting value=convert_all /
option name=ignore_hard_page_breaks value=false /
option name=ignore_hard_line_breaks value=false /
option name=ignore_empty_paragraphs value=false /
option name=ignore_double_spaces value=false /

These choices keep the amount of junk in the preamble to a minimum too.  The
more I fiddle with it the sounder writer2latex seems to be; I wouldn't have
thought it was possible.  Again, this is all over my head, though now primitive
text-altering script-composition isn't, to my amazement - so,
or rather, {}- so, 
thanks, 
Michael 



Re: Google Docs to LaTeX

2008-04-22 Thread Luis Rivera
Michael Thompson [EMAIL PROTECTED] writes:

 
 Dear Charles, 
 It is very cool grasping how to use sed in however a primitive way.  But on
 further investigation it seems one needs it for a LyX friendly use of
 ``writer2latex'' only if the document has tables, math, images ... or French. 
 With a fairly wide but unscientifically chosen variety of English documents, I
 found that the desiderata of: 
 (a) retaining crucial formatting that an English language Word or OpenOffice 
 or
 docs.google user would likely employ 
 and: 
 (b) avoiding a demoralizing film of ERT 
 by messing with the preferences in writer2latex.xml.  
 

Indeed, the script is not necessary if you edit the writer2latex.xml file in
your system, as you've done already. All you need to do is to select the
appropriate encoding (latin9 is the most popular, after utf8 for latin writing
systems, as you've found out).

Personally, I prefer to avoid loading a full Office Suite to make the
conversion, so I bypass them by not saving my googledocs papers into word, rtf,
or odf. Try saving your GoogleDocs documents as HTML, and then convert them with
html2tex. Check

http://www.iwriteiam.nl/html2tex.html

All you need is a friendly gcc compiler (or a friend to give it to you), and it
makes the whole work for you with a simple call to the converter.

Perhaps you may have to call html-tidy to cleanup the HTML source a bit, but a
simple bash script (or in windows, a bat file) will work.

Small is beautiful,

Luis.




Re: Google Docs to LaTeX

2008-04-22 Thread Michael Thompson
Dear Charles, 
It is very cool grasping how to use sed in however a primitive way.  But on
further investigation it seems one needs it for a LyX friendly use of
``writer2latex'' only if the document has tables, math, images ... or French. 
With a fairly wide but unscientifically chosen variety of English documents, I
found that the desiderata of: 
(a) retaining crucial formatting that an English language Word or OpenOffice or
docs.google user would likely employ 
and: 
(b) avoiding a demoralizing film of ERT 
by messing with the preferences in writer2latex.xml.  

The accursed red {}- is what remains, though the obvious expedient of a find and
replace in the latex file before importing into LyX is clearly the way to go if
that's all there is.  I think it has to do with the ucs.sty that is used in
connection with the choice of utf8 among the 'inputencoding' options. But this
is way over my head. 

I don't know how far this depends on how various things are adjusted on the (mac
)computer I was using - doc-odt-latex-lyx involves a lot of adjustments - but
for the heck of it I will list the alterations from the defaults that seemed to
maximize what is preserved subject to the principle of ERT avoidance:

option name=inputencoding value=utf8 /
option name=multilingual value=false /
in place  of 
option name=inputencoding value=ascii /
option name=multilingual value=true /


option name=formatting value=ignore_most /
option name=page_formatting value=ignore_all /
option name=ignore_hard_page_breaks value=true /
option name=ignore_hard_line_breaks value=true /
option name=ignore_empty_paragraphs value=true /
option name=ignore_double_spaces value=true /
in place of
option name=formatting value=convert_basic /
option name=page_formatting value=convert_all /
option name=ignore_hard_page_breaks value=false /
option name=ignore_hard_line_breaks value=false /
option name=ignore_empty_paragraphs value=false /
option name=ignore_double_spaces value=false /

These choices keep the amount of junk in the preamble to a minimum too.  The
more I fiddle with it the sounder writer2latex seems to be; I wouldn't have
thought it was possible.  Again, this is all over my head, though now primitive
text-altering script-composition isn't, to my amazement - so,
or rather, {}- so, 
thanks, 
Michael 



Re: Google Docs to LaTeX

2008-04-22 Thread Luis Rivera
Michael Thompson [EMAIL PROTECTED] writes:

 
 Dear Charles, 
 It is very cool grasping how to use sed in however a primitive way.  But on
 further investigation it seems one needs it for a LyX friendly use of
 ``writer2latex'' only if the document has tables, math, images ... or French. 
 With a fairly wide but unscientifically chosen variety of English documents, I
 found that the desiderata of: 
 (a) retaining crucial formatting that an English language Word or OpenOffice 
 or
 docs.google user would likely employ 
 and: 
 (b) avoiding a demoralizing film of ERT 
 by messing with the preferences in writer2latex.xml.  
 

Indeed, the script is not necessary if you edit the writer2latex.xml file in
your system, as you've done already. All you need to do is to select the
appropriate encoding (latin9 is the most popular, after utf8 for latin writing
systems, as you've found out).

Personally, I prefer to avoid loading a full Office Suite to make the
conversion, so I bypass them by not saving my googledocs papers into word, rtf,
or odf. Try saving your GoogleDocs documents as HTML, and then convert them with
html2tex. Check

http://www.iwriteiam.nl/html2tex.html

All you need is a friendly gcc compiler (or a friend to give it to you), and it
makes the whole work for you with a simple call to the converter.

Perhaps you may have to call html-tidy to cleanup the HTML source a bit, but a
simple bash script (or in windows, a bat file) will work.

Small is beautiful,

Luis.




Re: Google Docs to LaTeX

2008-04-22 Thread Michael Thompson
Dear Charles, 
It is very cool grasping how to use sed in however a primitive way.  But on
further investigation it seems one needs it for a LyX friendly use of
``writer2latex'' only if the document has tables, math, images ... or French. 
With a fairly wide but unscientifically chosen variety of English documents, I
found that the desiderata of: 
(a) retaining crucial formatting that an English language Word or OpenOffice or
docs.google user would likely employ 
and: 
(b) avoiding a demoralizing film of ERT 
by messing with the preferences in writer2latex.xml.  

The accursed red {}- is what remains, though the obvious expedient of a find and
replace in the latex file before importing into LyX is clearly the way to go if
that's all there is.  I think it has to do with the ucs.sty that is used in
connection with the choice of utf8 among the 'inputencoding' options. But this
is way over my head. 

I don't know how far this depends on how various things are adjusted on the (mac
)computer I was using - doc->odt->latex->lyx involves a lot of adjustments - but
for the heck of it I will list the alterations from the defaults that seemed to
maximize what is preserved subject to the principle of ERT avoidance:



in place  of 










in place of







These choices keep the amount of junk in the preamble to a minimum too.  The
more I fiddle with it the sounder writer2latex seems to be; I wouldn't have
thought it was possible.  Again, this is all over my head, though now primitive
text-altering script-composition isn't, to my amazement - so,
or rather, {}- so, 
thanks, 
Michael 



Re: Google Docs to LaTeX

2008-04-22 Thread Luis Rivera
Michael Thompson <[EMAIL PROTECTED]> writes:

> 
> Dear Charles, 
> It is very cool grasping how to use sed in however a primitive way.  But on
> further investigation it seems one needs it for a LyX friendly use of
> ``writer2latex'' only if the document has tables, math, images ... or French. 
> With a fairly wide but unscientifically chosen variety of English documents, I
> found that the desiderata of: 
> (a) retaining crucial formatting that an English language Word or OpenOffice 
> or
> docs.google user would likely employ 
> and: 
> (b) avoiding a demoralizing film of ERT 
> by messing with the preferences in writer2latex.xml.  
> 

Indeed, the script is not necessary if you edit the writer2latex.xml file in
your system, as you've done already. All you need to do is to select the
appropriate encoding (latin9 is the most popular, after utf8 for latin writing
systems, as you've found out).

Personally, I prefer to avoid loading a full Office Suite to make the
conversion, so I bypass them by not saving my googledocs papers into word, rtf,
or odf. Try saving your GoogleDocs documents as HTML, and then convert them with
html2tex. Check

http://www.iwriteiam.nl/html2tex.html

All you need is a friendly gcc compiler (or a friend to give it to you), and it
makes the whole work for you with a simple call to the converter.

Perhaps you may have to call html-tidy to cleanup the HTML source a bit, but a
simple bash script (or in windows, a bat file) will work.

Small is beautiful,

Luis.




Re: Google Docs to LaTeX

2008-04-21 Thread Charles de Miramon
Michael Thompson wrote:


 are too kind to what Charles calls the 'wysiwyg cruft'.  If you find a
 solution to the problem with em-dashes that doesn't involve a
 find-and-replace in the .tex file, tell me.

I paste my w2lclean script that I run on files converted by writer2latex
before importing them into LyX. It is geared for French but can easily be
adapted. It uses sed (a command line searchreplace that is standard on
Unix). I guess it will work on Mac OS/X. 

sh w2lclean Myconvertedfile.tex will create a temp-Myconvertedfile.tex that
you can then import into LyX.

For en-dash problem, you have to create a rule to convert space-space to
space--space

Cheers,
Charles

---w2lclean
#! /bin/sh
TEMP=temp-$1
cp $1 $TEMP
sed '
s/\\par/ /g;
s/\\bigskip//g;
s/\\fontsize{.*}{.*}\\selectfont//g;
s/\\usepackage\[ascii\]{inputenc}/\\usepackage\[latin1\]{inputenc}/g;
s/\\textsuperscript{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textstyleFootnoteSymbol{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textstyleAppelnotedebasdep{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textit/\\emph/g;
s/~/ /g;


s/{\\textquotedbl}/«/g;
s/{\\textquoteright}/'\''/g;
s/{\\textquotesingle}/'\''/g;
s/'\'''\''/»/g;
s/{\\guillemotleft}/«/g;
s/{\\guillemotright}/»/g;
s/{\\ /{ /g;

s/{}-/-/g;

s/\\e/ë/g;
s/\\i/ï/g;
s/\\u/ü/g;
s/\\^i/î/g;
s/\\^e/ê/g;
s/\\'\''e/é/g;
s/\\`a/à/g;
s/\\`e/è/g;
s/\\^a/â/g;
s/\\^o/ô/g;
s/\\^u/û/g;
s/\\`u/ù/g;
s/\\^I/Î/g;
s/\\^E/Ê/g;
s/\\^O/Ô/g;
s/\\^U/Û/g;
s/\\`A/À/g;
s/\\selectlanguage{french}/ /g;
s/\\foreignlanguage{french}{/ /g;
s/}\\foreignlanguage{french}{/ /g;
s/\\foreignlanguage{dutch}{/ /g;
s/}\\foreignlanguage{dutch}{/ /g;
' $TEMP  temp-out
mv temp-out $TEMP
 
-- 
http://www.kde-france.org



Re: Google Docs to LaTeX

2008-04-21 Thread Michael Thompson
Charles de Miramon [EMAIL PROTECTED] writes:
It uses sed (a command line searchreplace that is standard on
 Unix). I guess it will work on Mac OS/X. 
 sh w2lclean Myconvertedfile.tex will create a temp-Myconvertedfile.tex that
 you can then import into LyX.

Dear Charles your naive confidence that anyone can do this has emboldened me to
study script composition. There is indeed sed in os x and it seems to follow the
rules you are using, as I could verify easily with the simplest uses of it, the
ones that simply print the modified text to the screen.  And cp and the use of
obnoxiously so-called variables seems to be the same: the framing you use to
capture the modified text (which I don't quite understand yet) does make a
quasi-copy of zeta.tex called temp-zeta.tex. Things go well as long as the
find-and-replace-like actions I put into your framing are like s/me/you/g or
s/Athens/Jerusalem/g . But the use of / and \ and ' in tex and in the scripting
language, if that's what you call it - each wanting to use them both as its own
proper symbols and as 'escaped' or however you put it - inevitably leads to an
impenetrable salad of slashes, and the solution that works for you seems to lead
to misunderstanding here. I sort of follow the difficulty as long as I am
thinking of latex only.

So I am studying, but must give up for the night. This is hard! I will get back
to you if I fall into despair.  It's exam week, so I will have ample raw
materials when the .doc term papers hit my electronic mailbox late Friday
afternoon. Perhaps by then I will be able, with the application of a few
skillfully executed keystrokes, to convert the whole directory-full of them into
a handsomely decorated volume in the Memoir class, each as a subordinate
chapter. yours ever Michael







Re: Google Docs to LaTeX

2008-04-21 Thread Charles de Miramon
Michael Thompson wrote:


 are too kind to what Charles calls the 'wysiwyg cruft'.  If you find a
 solution to the problem with em-dashes that doesn't involve a
 find-and-replace in the .tex file, tell me.

I paste my w2lclean script that I run on files converted by writer2latex
before importing them into LyX. It is geared for French but can easily be
adapted. It uses sed (a command line searchreplace that is standard on
Unix). I guess it will work on Mac OS/X. 

sh w2lclean Myconvertedfile.tex will create a temp-Myconvertedfile.tex that
you can then import into LyX.

For en-dash problem, you have to create a rule to convert space-space to
space--space

Cheers,
Charles

---w2lclean
#! /bin/sh
TEMP=temp-$1
cp $1 $TEMP
sed '
s/\\par/ /g;
s/\\bigskip//g;
s/\\fontsize{.*}{.*}\\selectfont//g;
s/\\usepackage\[ascii\]{inputenc}/\\usepackage\[latin1\]{inputenc}/g;
s/\\textsuperscript{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textstyleFootnoteSymbol{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textstyleAppelnotedebasdep{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textit/\\emph/g;
s/~/ /g;


s/{\\textquotedbl}/«/g;
s/{\\textquoteright}/'\''/g;
s/{\\textquotesingle}/'\''/g;
s/'\'''\''/»/g;
s/{\\guillemotleft}/«/g;
s/{\\guillemotright}/»/g;
s/{\\ /{ /g;

s/{}-/-/g;

s/\\e/ë/g;
s/\\i/ï/g;
s/\\u/ü/g;
s/\\^i/î/g;
s/\\^e/ê/g;
s/\\'\''e/é/g;
s/\\`a/à/g;
s/\\`e/è/g;
s/\\^a/â/g;
s/\\^o/ô/g;
s/\\^u/û/g;
s/\\`u/ù/g;
s/\\^I/Î/g;
s/\\^E/Ê/g;
s/\\^O/Ô/g;
s/\\^U/Û/g;
s/\\`A/À/g;
s/\\selectlanguage{french}/ /g;
s/\\foreignlanguage{french}{/ /g;
s/}\\foreignlanguage{french}{/ /g;
s/\\foreignlanguage{dutch}{/ /g;
s/}\\foreignlanguage{dutch}{/ /g;
' $TEMP  temp-out
mv temp-out $TEMP
 
-- 
http://www.kde-france.org



Re: Google Docs to LaTeX

2008-04-21 Thread Michael Thompson
Charles de Miramon [EMAIL PROTECTED] writes:
It uses sed (a command line searchreplace that is standard on
 Unix). I guess it will work on Mac OS/X. 
 sh w2lclean Myconvertedfile.tex will create a temp-Myconvertedfile.tex that
 you can then import into LyX.

Dear Charles your naive confidence that anyone can do this has emboldened me to
study script composition. There is indeed sed in os x and it seems to follow the
rules you are using, as I could verify easily with the simplest uses of it, the
ones that simply print the modified text to the screen.  And cp and the use of
obnoxiously so-called variables seems to be the same: the framing you use to
capture the modified text (which I don't quite understand yet) does make a
quasi-copy of zeta.tex called temp-zeta.tex. Things go well as long as the
find-and-replace-like actions I put into your framing are like s/me/you/g or
s/Athens/Jerusalem/g . But the use of / and \ and ' in tex and in the scripting
language, if that's what you call it - each wanting to use them both as its own
proper symbols and as 'escaped' or however you put it - inevitably leads to an
impenetrable salad of slashes, and the solution that works for you seems to lead
to misunderstanding here. I sort of follow the difficulty as long as I am
thinking of latex only.

So I am studying, but must give up for the night. This is hard! I will get back
to you if I fall into despair.  It's exam week, so I will have ample raw
materials when the .doc term papers hit my electronic mailbox late Friday
afternoon. Perhaps by then I will be able, with the application of a few
skillfully executed keystrokes, to convert the whole directory-full of them into
a handsomely decorated volume in the Memoir class, each as a subordinate
chapter. yours ever Michael







Re: Google Docs to LaTeX

2008-04-21 Thread Charles de Miramon
Michael Thompson wrote:


> are too kind to what Charles calls the 'wysiwyg cruft'.  If you find a
> solution to the problem with em-dashes that doesn't involve a
> find-and-replace in the .tex file, tell me.

I paste my w2lclean script that I run on files converted by writer2latex
before importing them into LyX. It is geared for French but can easily be
adapted. It uses sed (a command line search that is standard on
Unix). I guess it will work on Mac OS/X. 

sh w2lclean Myconvertedfile.tex will create a temp-Myconvertedfile.tex that
you can then import into LyX.

For en-dash problem, you have to create a rule to convert space-space to
space--space

Cheers,
Charles

---w2lclean
#! /bin/sh
TEMP=temp-$1
cp $1 $TEMP
sed '
s/\\par/ /g;
s/\\bigskip//g;
s/\\fontsize{.*}{.*}\\selectfont//g;
s/\\usepackage\[ascii\]{inputenc}/\\usepackage\[latin1\]{inputenc}/g;
s/\\textsuperscript{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textstyleFootnoteSymbol{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textstyleAppelnotedebasdep{\\footnotemark{}}\\footnotetext/\\footnote/g;
s/\\textit/\\emph/g;
s/~/ /g;


s/{\\textquotedbl}/«/g;
s/{\\textquoteright}/'\''/g;
s/{\\textquotesingle}/'\''/g;
s/'\'''\''/»/g;
s/{\\guillemotleft}/«/g;
s/{\\guillemotright}/»/g;
s/{\\ /{ /g;

s/{}-/-/g;

s/\\"e/ë/g;
s/\\"i/ï/g;
s/\\"u/ü/g;
s/\\^i/î/g;
s/\\^e/ê/g;
s/\\'\''e/é/g;
s/\\`a/à/g;
s/\\`e/è/g;
s/\\^a/â/g;
s/\\^o/ô/g;
s/\\^u/û/g;
s/\\`u/ù/g;
s/\\^I/Î/g;
s/\\^E/Ê/g;
s/\\^O/Ô/g;
s/\\^U/Û/g;
s/\\`A/À/g;
s/\\selectlanguage{french}/ /g;
s/\\foreignlanguage{french}{/ /g;
s/}\\foreignlanguage{french}{/ /g;
s/\\foreignlanguage{dutch}{/ /g;
s/}\\foreignlanguage{dutch}{/ /g;
' $TEMP > temp-out
mv temp-out $TEMP
 
-- 
http://www.kde-france.org



Re: Google Docs to LaTeX

2008-04-21 Thread Michael Thompson
Charles de Miramon <[EMAIL PROTECTED]> writes:
>It uses sed (a command line search that is standard on
> Unix). I guess it will work on Mac OS/X. 
> sh w2lclean Myconvertedfile.tex will create a temp-Myconvertedfile.tex that
> you can then import into LyX.

Dear Charles your naive confidence that anyone can do this has emboldened me to
study script composition. There is indeed sed in os x and it seems to follow the
rules you are using, as I could verify easily with the simplest uses of it, the
ones that simply print the modified text to the screen.  And cp and the use of
obnoxiously so-called variables seems to be the same: the framing you use to
capture the modified text (which I don't quite understand yet) does make a
quasi-copy of zeta.tex called temp-zeta.tex. Things go well as long as the
"find-and-replace"-like actions I put into your framing are like s/me/you/g or
s/Athens/Jerusalem/g . But the use of / and \ and ' in tex and in the scripting
language, if that's what you call it - each wanting to use them both as its own
proper symbols and as 'escaped' or however you put it - inevitably leads to an
impenetrable salad of slashes, and the solution that works for you seems to lead
to misunderstanding here. I sort of follow the difficulty as long as I am
thinking of latex only.

So I am studying, but must give up for the night. This is hard! I will get back
to you if I fall into despair.  It's exam week, so I will have ample raw
materials when the .doc term papers hit my electronic mailbox late Friday
afternoon. Perhaps by then I will be able, with the application of a few
skillfully executed keystrokes, to convert the whole directory-full of them into
a handsomely decorated volume in the Memoir class, each as a subordinate
chapter. yours ever Michael







Re: Google Docs to LaTeX

2008-04-20 Thread cmiramon
nodje wrote:


 
 I'm trying to use other converters by defining them through Preferences,
 but it wouldn't let me add one.
 How come? It sounds that I could have an HTML - LaTeX converter.
 
 What's your experience? What works best in terms of converting?
 

I would try to export to ODF and then use writer2latex to convert it to
LaTeX. You clean the LaTeX with a script to take away all the Wysiwyg cruft
and then convert it to LyX.

Cheers,
Charles



Re: Google Docs to LaTeX

2008-04-20 Thread Michael Thompson
 [EMAIL PROTECTED] writes:

 I would try to export to ODF and then use writer2latex to convert it to
 LaTeX. You clean the LaTeX with a script to take away all the Wysiwyg cruft
 and then convert it to LyX.

I can't tell from the note whether you are a skillful composer of scripts, as
Charles is kindly thinking you must be.  If you are not, but have NeoOffice
installed, notice that writer2latex is already installed under File -- Export
-- FileFormat. I take it this is true of all versions of OpenOffice.  
The default preferences may not be ideal; they are in writer2latex.xml, which is
easy to find and fairly humanly readable - even if it is a script - and can be
adjusted according to the principles in the user's manual 
http://www.hj-gym.dk/~hj/writer2latex/index7.html
Since you are writing in google docs, you will have control over how much of a
hash the result is.  I use NeoOffice to open Word documents, and if I have to
print a long student term paper, the temptation to export is overwhelming, of
course, if only to save paper and ink. If you delete all of the garbage that
appears in the preamble under Document -- Settings, the results are not too
bad. (Once someone figures out how to have a handsome Powered by LyX figure
printed at the bottom of the last page, or maybe every page, which might be
mentioned in the preamble, I'd be bold enough to return the text to the student
that way.)  It is surprising how rapid the steps are; it was much more
complicated when I was first using LyX and LaTeX a year or so ago, and thus
converting lots of stuff. 
If you have to study and alter a document, and thus stare at paragraphs in the
LyX user interface, there may be some ugly ERT, especially if the preferences
are too kind to what Charles calls the 'wysiwyg cruft'.  If you find a solution
to the problem with em-dashes that doesn't involve a find-and-replace in the
.tex file, tell me.  







Re: Google Docs to LaTeX

2008-04-20 Thread cmiramon
nodje wrote:


 
 I'm trying to use other converters by defining them through Preferences,
 but it wouldn't let me add one.
 How come? It sounds that I could have an HTML - LaTeX converter.
 
 What's your experience? What works best in terms of converting?
 

I would try to export to ODF and then use writer2latex to convert it to
LaTeX. You clean the LaTeX with a script to take away all the Wysiwyg cruft
and then convert it to LyX.

Cheers,
Charles



Re: Google Docs to LaTeX

2008-04-20 Thread Michael Thompson
 [EMAIL PROTECTED] writes:

 I would try to export to ODF and then use writer2latex to convert it to
 LaTeX. You clean the LaTeX with a script to take away all the Wysiwyg cruft
 and then convert it to LyX.

I can't tell from the note whether you are a skillful composer of scripts, as
Charles is kindly thinking you must be.  If you are not, but have NeoOffice
installed, notice that writer2latex is already installed under File -- Export
-- FileFormat. I take it this is true of all versions of OpenOffice.  
The default preferences may not be ideal; they are in writer2latex.xml, which is
easy to find and fairly humanly readable - even if it is a script - and can be
adjusted according to the principles in the user's manual 
http://www.hj-gym.dk/~hj/writer2latex/index7.html
Since you are writing in google docs, you will have control over how much of a
hash the result is.  I use NeoOffice to open Word documents, and if I have to
print a long student term paper, the temptation to export is overwhelming, of
course, if only to save paper and ink. If you delete all of the garbage that
appears in the preamble under Document -- Settings, the results are not too
bad. (Once someone figures out how to have a handsome Powered by LyX figure
printed at the bottom of the last page, or maybe every page, which might be
mentioned in the preamble, I'd be bold enough to return the text to the student
that way.)  It is surprising how rapid the steps are; it was much more
complicated when I was first using LyX and LaTeX a year or so ago, and thus
converting lots of stuff. 
If you have to study and alter a document, and thus stare at paragraphs in the
LyX user interface, there may be some ugly ERT, especially if the preferences
are too kind to what Charles calls the 'wysiwyg cruft'.  If you find a solution
to the problem with em-dashes that doesn't involve a find-and-replace in the
.tex file, tell me.  







Re: Google Docs to LaTeX

2008-04-20 Thread cmiramon
nodje wrote:


> 
> I'm trying to use other converters by defining them through Preferences,
> but it wouldn't let me add one.
> How come? It sounds that I could have an HTML -> LaTeX converter.
> 
> What's your experience? What works best in terms of converting?
> 

I would try to export to ODF and then use writer2latex to convert it to
LaTeX. You clean the LaTeX with a script to take away all the Wysiwyg cruft
and then convert it to LyX.

Cheers,
Charles



Re: Google Docs to LaTeX

2008-04-20 Thread Michael Thompson
 <[EMAIL PROTECTED]> writes:

> I would try to export to ODF and then use writer2latex to convert it to
> LaTeX. You clean the LaTeX with a script to take away all the Wysiwyg cruft
> and then convert it to LyX.

I can't tell from the note whether you are a skillful composer of scripts, as
Charles is kindly thinking you must be.  If you are not, but have NeoOffice
installed, notice that writer2latex is already installed under File --> Export
--> FileFormat. I take it this is true of all versions of OpenOffice.  
The default preferences may not be ideal; they are in writer2latex.xml, which is
easy to find and fairly humanly readable - even if it is a script - and can be
adjusted according to the principles in the user's manual 
http://www.hj-gym.dk/~hj/writer2latex/index7.html
Since you are writing in google docs, you will have control over how much of a
hash the result is.  I use NeoOffice to open Word documents, and if I have to
print a long student term paper, the temptation to export is overwhelming, of
course, if only to save paper and ink. If you delete all of the garbage that
appears in the preamble under Document --> Settings, the results are not too
bad. (Once someone figures out how to have a handsome "Powered by LyX" figure
printed at the bottom of the last page, or maybe every page, which might be
mentioned in the preamble, I'd be bold enough to return the text to the student
that way.)  It is surprising how rapid the steps are; it was much more
complicated when I was first using LyX and LaTeX a year or so ago, and thus
converting lots of stuff. 
If you have to study and alter a document, and thus stare at paragraphs in the
LyX user interface, there may be some ugly ERT, especially if the preferences
are too kind to what Charles calls the 'wysiwyg cruft'.  If you find a solution
to the problem with em-dashes that doesn't involve a find-and-replace in the
.tex file, tell me.