Re: replace text

2008-07-22 Thread Nicolas Ferré

Jon Brauer a écrit :

I have a question about a seemingly simple thing that I can't figure
out how to get LyX to do: I am writing an article for a chemical
journal, so I am including a lot of chemical formulas. So I would like
to be able to type H2O and have the final output read with the 2 as a
subscript. The same way if I type LaTeX it prints pretty and
formatted. Thanks in advance for any help.

--
- jon




Hi,

The mhchem package is rather convenient for typing chemical formulae and 
reaction equations. The water molecule can be written as \ce{H2O}.


--
Nicolas Ferre'
Laboratoire Chimie Provence
Universite' de Provence - France
Tel: +33 491282733
http://sites.univ-provence.fr/lcp-ct


Re: replace text

2008-07-22 Thread Sylvain
 Try this in the preamble:
 
 \usepackage{fixltx2e}
 \newcommand{\HHO}{H\textsubscript{2}O}
 
 Then in your text, put \HHO{} in ERT.
 
 /Paul
 
 
What happens when there are plenty of different formulas? Any clever way of
dealing with it?
Thanks,
Sylvain





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

Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning

On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


I can get it working if I specify in Skim's preferences the complete  
path to lyxeditor by selecting a custom preset for PDFSync support:


/Applications/LyX.app/Contents/MacOS/lyxeditor

If that works for you, then it looks like the problem is in Skim,  
and the bug should be reported to them.


Bennett


That didn't work for me. But based on the following I now have an  
hypothesis and two questions for you:


I learned from the following command line experiments. I ran
/Applications/LyX.app/Contents/MacOS/lyxeditor foo 123
to go to line 123 of foo.lyx (currently open in LyX) and that did not  
work. I then ran

/Applications/LyX.app/Contents/MacOS/lyxeditor ~/foo 123
and that worked! Turns out my file is stored in my home directory and  
I needed to add ~/ in front of the file name.


Now, how is Skim supposed to know this path? The file in Skim is  
opened with the same filename but in a tmp directory.


It works for you though, so here are my questions;

1. your pdf file is located in a tmp directory or alongside your .lyx  
file?


2. in LyX when you have a file opened, do you see the full pathname or  
just the name of the file [I see the full path, so it seems LyX  
considers that the name of the file, which may be the root of the  
problem]


Thanks

-Ivan


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



Refernces

2008-07-22 Thread Hesham Kamel
Hello,
I am writing my thesis now, and just knew about LATEX.
I downloaded LyX, and started to work with, however I have a concern.
In MS Word, I am using a citation manager, Refworks to insert citations, and
at the end it produces a bibliography numbered list, while in the main
document itself, it generates  references to the list according to the
selected style.
e.g. a full frontal impact can extend for more than half a day even with
current computational capabilities [1].
and

1. REFERENCES

[1]  Natori, S., and Yu, Q., 2007, 2007-01-0882 an Application of CAP
(Computer-Aided Principle) to Structural Design for Vehicle Crash Safety,
SAE SP, (2072) pp. 73-80.
so, can I get the same using LyX?
Do I need any additional software?

Thank you,

-- 
Hesham Kamel
PhD. Candidate at Mechanical and Industrial Engineering

Concordia University
1515 St. Catherine West, EV013.205
Montreal, Quebec
H3G-2W1

Telephone : +1-514-848-2424 x 7095
Fax : +1-514-848-3175


Re: How to make a clone of the Enumerate environment?

2008-07-22 Thread Steve Litt
Günter (and everyone else),

Your response contains one of the most useful LyX idioms I've ever seen, 
limiting my biggest objection to LyX. It will lead to vastly improved 
productivity for me.

Can anyone guess which part of Günter's email is so useful? I'll reveal it in 
another email, coming up shortly.

On Wednesday 16 July 2008 07:34, G. Milde wrote:
 On 14.07.08, Steve Litt wrote:
  Hi all,
 
  I'm trying to make a simple clone of the Enumerate environment. Once I
  can do that, I'll make a few changes. But I've not been able to clone
  it.

 You need to clone both, LyX layout::

   Style Questions
  CopyStyle   Enumeration


 and LaTeX environment::

   \newenvironment{questions}{\begin{enumerate}}{\end{enumerate}}

  Here's my layout file:
 
  #% Do not delete the line below; configure depends on this
  #  \DeclareLaTeXClass[book]{quizbook}
 
  Input stdclass.inc
 
  Preamble
  \let\questions = \enumerate
  \let\oldquestions = \oldenumerate
  EndPreamble

 I am not sure if this works well, as enumerate is an environment, not a
 command. Use the latex \newenvironment instead.

  Style Questions

 ...

  End

 With CopyStyle, you get all the definitions of the copied style and
 need to change only thing that should differ.

  The preceding layout produces the output shown in the attached
  screenshot_questions.gif. However, if I change the LatexName in the LyX
  environment from questions to enumerate, it outputs as shown in the
  attached screenshot_enumerate.gif.

 Describing the difference in words helps (while pics might augment
 this, they cannot always replace a description, e.g. while browsing
 this mail to see if I can help at all, I do not see the attachments.)

  Can somebody explain to me why the two don't output the same?

 no.

 Can somebody explain how I can truly clone the Enumerate environment?

 see above.

  NOTE: In order to toggle the output when switching between LatexType
  questions and LatexType enumerate, you must Tools-reconfigure and then
  terminate and restart LyX. Trust me on this -- I tried without
  reconfiguring and the output didn't toggle.

 You could define 2 Styles in your layout file (one QuestionsTest, say)
 and switch between them in the document.

 Günter

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



Life changing LyX idiom gives me new productivity

2008-07-22 Thread Steve Litt
Hi all,

In a different thread, Gunter Milde penned these words:

 You need to clone both, LyX layout::

   Style Questions
  CopyStyle   Enumeration


That is THE most powerful LyX idiom I've ever seen.

As most of you know, my biggest objection to LyX is the excruciating pain 
required to make my own environments in the layout file.

Excruciating pain is an overstatement. I was a contract software developer 
from 1984-2002, so obviously I can make the environments. My problem is that, 
for me, it's very hard to switch mindsets from author to tech geek and back 
again in order to create a style.

Now I don't have to. When I come upon a situation requiring a new style, I 
just put this in my layout file:

Style MyNewStyle
CopyStyle Standard
End

And I go on about my business. When I have time I'll check whether I can 
actually change appearances in LyX like this:

Style MyNewStyle
CopyStyle Standard
LeftMarginMMM
RightMargin   MMM
Font
SizeLarger
EndFont
End

If that's possible, then within LyX I can see at a glance that my new style is 
custom, and that I later have to develop the LaTeX to complete it.

After several days or weeks of creating this type of dummy styles, one day I 
can go into programmer mode and make all the styles without the pressure of 
having to slam out 2000 words that day.

So Gunter -- thanks SO much for that idiom. It makes LyX a much more useful 
tool.

SteveT

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



Re: Refernces

2008-07-22 Thread Kamran SHAFQAT

Hesham Kamel wrote:

Hello,
I am writing my thesis now, and just knew about LATEX.
I downloaded LyX, and started to work with, however I have a concern.
In MS Word, I am using a citation manager, Refworks to insert citations, and
at the end it produces a bibliography numbered list, while in the main
document itself, it generates  references to the list according to the
selected style.
e.g. a full frontal impact can extend for more than half a day even with
current computational capabilities [1].
and

1. REFERENCES

[1]  Natori, S., and Yu, Q., 2007, 2007-01-0882 an Application of CAP
(Computer-Aided Principle) to Structural Design for Vehicle Crash Safety,
SAE SP, (2072) pp. 73-80.
so, can I get the same using LyX?
Do I need any additional software?

Thank you,

  

Hi,
As far as i know you have to get a bib file for your references and than 
you can insert them in Lyx using any style. The citation manager that 
you are using probably will generate the bib file i think. But you can 
have a look at Lyx wiki page were thay have information about software 
that you can use and other details regarding references.


http://wiki.lyx.org/BibTeX/BibTeX

I am using Jabref a free references manager which is quite good you can 
get it from


http://jabref.sourceforge.net/

Regards

Kamran



Re: replace text

2008-07-22 Thread Paul A. Rubin

Sylvain wrote:

Try this in the preamble:

\usepackage{fixltx2e}
\newcommand{\HHO}{H\textsubscript{2}O}

Then in your text, put \HHO{} in ERT.

/Paul



What happens when there are plenty of different formulas? Any clever way of
dealing with it?
Thanks,
Sylvain



If they are all chemical formulae, I suspect the package Nicolas Ferre' 
recommended is the answer.  If they are something else, and assuming you 
use them frequently, I would suggest either putting them all in a text 
file that you can \include in any document where you need them, or else 
modify your layout file(s) to include them in the preamble (the former 
being less work).


/Paul



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:

layout name=Standard
this.
/layout

layout name=Standard
inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
/layout

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

That's not anything actually agreed or implemented

rh



Re: Life changing LyX idiom gives me new productivity

2008-07-22 Thread rgheck

Steve Litt wrote:
When I have time I'll check whether I can 
actually change appearances in LyX like this:


Style MyNewStyle
CopyStyle Standard
LeftMarginMMM
RightMargin   MMM
Font
SizeLarger
EndFont
End

If that's possible, then within LyX I can see at a glance that my new style is 
custom, and that I later have to develop the LaTeX to complete it.


  
You can do this kind of thing. Later declarations just override earlier 
ones. Have a look at e.g. stdsections.inc, or the ams layouts, where 
this idea is used over and over again.


rh



Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning


On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


I can get it working if I specify in Skim's preferences the complete  
path to lyxeditor by selecting a custom preset for PDFSync support:


/Applications/LyX.app/Contents/MacOS/lyxeditor

If that works for you, then it looks like the problem is in Skim,  
and the bug should be reported to them.


Bennett


I finally got it working, combining what you said (adding the full  
path) and changing the way Skim calls lyxeditor. Skim's default is

%file %line
but that does not work for me. I removed the quotes and it works with:
   %file %line
I have no idea why.

Bennett, if you could check what arguments you have set up in Skim  
that would be helpful. I could then report to the Skim developers with  
more than my own experience. Thanks


-ivan


Re: replace text

2008-07-22 Thread Sylvain
 If they are all chemical formulae, I suspect the package Nicolas Ferre' 
 recommended is the answer.  If they are something else, and assuming you 
 use them frequently, I would suggest either putting them all in a text 
 file that you can \include in any document where you need them, or else 
 modify your layout file(s) to include them in the preamble (the former 
 being less work).
 
 /Paul
 

Thanks, the package mentioned by Nicolas is exactly what I was looking for. It
makes copy-pasting chemistry documents from MS-Word much easier.
Sylvain






Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 12:24 PM, Ivan Werning [EMAIL PROTECTED] wrote:


 On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


 I can get it working if I specify in Skim's preferences the complete path
 to lyxeditor by selecting a custom preset for PDFSync support:

 /Applications/LyX.app/Contents/MacOS/lyxeditor

 If that works for you, then it looks like the problem is in Skim, and the
 bug should be reported to them.

 Bennett


 I finally got it working, combining what you said (adding the full path)
 and changing the way Skim calls lyxeditor. Skim's default is
%file %line
 but that does not work for me. I removed the quotes and it works with:
   %file %line
 I have no idea why.

 Bennett, if you could check what arguments you have set up in Skim that
 would be helpful. I could then report to the Skim developers with more than
 my own experience. Thanks


Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my system is a
developmental build of LyX-1.6. There's a line in the lyxeditor script that
is supposed to point to possible LyX user folders in ~/Library/Application
Support/, but it currently does not point to the new (for 1.6) LyX-1.6
folder there. Correcting that makes the default setting in Skim work for me.
Similarly, going back to LyX-1.5 works for me as well -- with the default
Skim settings.

Note, by the way, that Skim assumes it's dealing with a .tex file and it
passes the complete path to the .tex file to lyxeditor. So what it actually
calls (when I fill in the complete path to lyxeditor) is something like:

/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in what it
sends to lyxeditor, but I might be doing something wrong.) That means your
worries about the .lyx file and complete path are, I believe, misplaced.

Nonetheless, I can't yet explain why it fails to work for you with the
default Skim settings or why you need to remove the quotes from %file to get
it to work. Do you have LyX at /Applications/LyX.app? What is the actual
filename of the file you are testing? (Does it have any unusual characters
in it?) Have you specified a LyX temporary directory other than the default
(/tmp)? If so, what is the complete path to it?

Bennett


Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 12:24 PM, Ivan Werning [EMAIL PROTECTED] wrote:


 On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


 I can get it working if I specify in Skim's preferences the complete path
 to lyxeditor by selecting a custom preset for PDFSync support:

 /Applications/LyX.app/Contents/MacOS/lyxeditor

 If that works for you, then it looks like the problem is in Skim, and the
 bug should be reported to them.

 Bennett


 I finally got it working, combining what you said (adding the full path)
 and changing the way Skim calls lyxeditor. Skim's default is
%file %line
 but that does not work for me. I removed the quotes and it works with:
   %file %line
 I have no idea why.

 Bennett, if you could check what arguments you have set up in Skim that
 would be helpful. I could then report to the Skim developers with more than
 my own experience. Thanks


Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my system is a
developmental build of LyX-1.6. There's a line in the lyxeditor script that
is supposed to point to possible LyX user folders in ~/Library/Application
Support/, but it currently does not point to the new (for 1.6) LyX-1.6
folder there. Correcting that makes the default setting in Skim work for me.
Similarly, going back to LyX-1.5 works for me as well -- with the default
Skim settings.

Note, by the way, that Skim assumes it's dealing with a .tex file and it
passes the complete path to the .tex file to lyxeditor. So what it actually
calls (when I fill in the complete path to lyxeditor) is something like:

/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in what it
sends to lyxeditor, but I might be doing something wrong.) That means your
worries about the .lyx file and complete path are, I believe, misplaced.

Nonetheless, I can't yet explain why it fails to work for you with the
default Skim settings or why you need to remove the quotes from %file to get
it to work. Do you have LyX at /Applications/LyX.app? What is the actual
filename of the file you are testing? (Does it have any unusual characters
in it?) Have you specified a LyX temporary directory other than the default
(/tmp)? If so, what is the complete path to it?

Bennett


Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning

First of all, thanks for your help Bennett. See below.

On Jul 22, 2008, at 1:52 PM, Bennett Helm wrote:



Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my  
system is a developmental build of LyX-1.6. There's a line in the  
lyxeditor script that is supposed to point to possible LyX user  
folders in ~/Library/Application Support/, but it currently does not  
point to the new (for 1.6) LyX-1.6 folder there. Correcting that  
makes the default setting in Skim work for me. Similarly, going back  
to LyX-1.5 works for me as well -- with the default Skim settings.




The default didn't work for me on LyX 1.5.5 and Skim 1.1.8
Both programs are in /Applications/


Note, by the way, that Skim assumes it's dealing with a .tex file  
and it passes the complete path to the .tex file to lyxeditor. So  
what it actually calls (when I fill in the complete path to  
lyxeditor) is something like:


/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in  
what it sends to lyxeditor, but I might be doing something wrong.)  
That means your worries about the .lyx file and complete path are, I  
believe, misplaced.


Well, all I know is that I got it to work by giving it the complete  
path to lyxeditor (which is precisely /Applications/LyX.app/Contents/ 
MacOS/lyxeditor) and by removing the quotes in the argument field.


Without either of those changes, it does not work (at least not  
consistently, more below).




Nonetheless, I can't yet explain why it fails to work for you with  
the default Skim settings or why you need to remove the quotes from  
%file to get it to work. Do you have LyX at /Applications/LyX.app?


Yes

What is the actual filename of the file you are testing? (Does it  
have any unusual characters in it?)


~\text.lyx


Have you specified a LyX temporary directory other than the default  
(/tmp)? If so, what is the complete path to it?




I left it at the default /tmp indeed


Bennett



One last thing: everything I reported above, notwithstanding, I just  
tested it now with the default LyX settings in Skim and it works!  
Given that previously it failed, and I am dead sure of that (and I had  
restarted programs, deleted pipe files, tried everything etc.), I have  
to conclude that there is something random that throws it off  
sometimes, maybe the status of pipe files or something (which I do not  
know much about). I think that those default settings hence seem to  
work, but may not do so reliably.  A true mystery


(btw, slightly off topic now: LyX doesn't have forward search does it?)


Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 2:24 PM, Ivan Werning [EMAIL PROTECTED] wrote:

 First of all, thanks for your help Bennett. See below.


You're welcome.

snip


 One last thing: everything I reported above, notwithstanding, I just tested
 it now with the default LyX settings in Skim and it works! Given that
 previously it failed, and I am dead sure of that (and I had restarted
 programs, deleted pipe files, tried everything etc.), I have to conclude
 that there is something random that throws it off sometimes, maybe the
 status of pipe files or something (which I do not know much about). I think
 that those default settings hence seem to work, but may not do so reliably.
  A true mystery


That is strange. If you notice a pattern to it, please let us know.


 (btw, slightly off topic now: LyX doesn't have forward search does it?)


Unfortunately, no. There's a very old enhancement request for this:

http://bugzilla.lyx.org/show_bug.cgi?id=706

Bennett


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:

 layout name=Standard
 this.
 /layout

 layout name=Standard
 inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
 /layout

 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 Pavel Sanda
 Steve Litt wrote:
 layout name=Standard
 this.
 /layout

 layout name=Standard
 inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
 /layout

 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 layout name=Standard. 

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 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 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 layout name=Standard.

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 (xml)

2008-07-22 Thread rgheck

Pavel Sanda wrote:

Steve Litt wrote:
layout name=Standard
this.
/layout

layout name=Standard
inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
/layout

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 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

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:
 
  layout name=Standard
  this.
  /layout
 
  layout name=Standard
  inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain
  / /layout
 
  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 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 layout name=Standard.
 
 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 (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


Hollywood template author's address

2008-07-22 Thread Thomas King
I looked through the archives and wiki, and didn't find an answer to
this issue (although it was mentioned on the devel list). The
hollywood.lyx template doesn't render the author's address. Is there
something I need to tweak first? 

Thank you, 
Tom King


signature.asc
Description: This is a digitally signed message part


Documentation of LyX functions (aka LFUNs)

2008-07-22 Thread Pavel Sanda
Dear LyXers,

I'm proud to announce that the LFUNs documentation project has been finished.

If you are interested in mastering LyX this documentation could be useful for
your needs.

Some technical speech:

* All documentation is orginally written as doxygen comments in our source 
code, 
  so this should be the first place to check-up documentation bugs, 
improvements etc.
  You should be able to find most up-to-date version (but not much readable) 
here:

  http://www.lyx.org/trac/browser/lyx-devel/trunk/src/LyXAction.cpp


* The documentation is synchonized with the upcomming LyX 1.6. Many things
  could be used even for 1.5 series of LyX, but be careful (bug reports should
  be checked always against 1.6.)


* HTML documentation was produced via doxygen. The file could be found here:

  http://www.lyx.org/~sanda/doxygen/html/namespacelyx.html

  or you can go directly to the right section:

  
http://www.lyx.org/~sanda/doxygen/html/namespacelyx.html#5ae63e8160e98b54ad28f142ed40c202


* .lyx version was produced by hand-crafted script and can be found here:

   http://www.lyx.org/~sanda/doxygen/lfuns.lyx

   or .pdf version respectively:

   http://www.lyx.org/~sanda/doxygen/lfuns.pdf


I would appreciate all bug reports (i.e. some lfun does not work in the way
its documented), typo in documentation etc.


Disclaimer: Please note that the conversion to HTML or .lyx is not at all
100% and is not intended to be typographical jewel...

Enjoy!
Pavel


Re: How to make a clone of the Enumerate environment?

2008-07-22 Thread Dirk Markert
2008/7/22 Steve Litt [EMAIL PROTECTED]:

 Günter (and everyone else),

 Your response contains one of the most useful LyX idioms I've ever seen,
 limiting my biggest objection to LyX. It will lead to vastly improved
 productivity for me.

 Can anyone guess which part of Günter's email is so useful? I'll reveal it
 in
 another email, coming up shortly.


CopyStyle?

Dirk


Re: replace text

2008-07-22 Thread Nicolas Ferré

Jon Brauer a écrit :

I have a question about a seemingly simple thing that I can't figure
out how to get LyX to do: I am writing an article for a chemical
journal, so I am including a lot of chemical formulas. So I would like
to be able to type H2O and have the final output read with the 2 as a
subscript. The same way if I type LaTeX it prints pretty and
formatted. Thanks in advance for any help.

--
- jon




Hi,

The mhchem package is rather convenient for typing chemical formulae and 
reaction equations. The water molecule can be written as \ce{H2O}.


--
Nicolas Ferre'
Laboratoire Chimie Provence
Universite' de Provence - France
Tel: +33 491282733
http://sites.univ-provence.fr/lcp-ct


Re: replace text

2008-07-22 Thread Sylvain
 Try this in the preamble:
 
 \usepackage{fixltx2e}
 \newcommand{\HHO}{H\textsubscript{2}O}
 
 Then in your text, put \HHO{} in ERT.
 
 /Paul
 
 
What happens when there are plenty of different formulas? Any clever way of
dealing with it?
Thanks,
Sylvain





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

Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning

On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


I can get it working if I specify in Skim's preferences the complete  
path to lyxeditor by selecting a custom preset for PDFSync support:


/Applications/LyX.app/Contents/MacOS/lyxeditor

If that works for you, then it looks like the problem is in Skim,  
and the bug should be reported to them.


Bennett


That didn't work for me. But based on the following I now have an  
hypothesis and two questions for you:


I learned from the following command line experiments. I ran
/Applications/LyX.app/Contents/MacOS/lyxeditor foo 123
to go to line 123 of foo.lyx (currently open in LyX) and that did not  
work. I then ran

/Applications/LyX.app/Contents/MacOS/lyxeditor ~/foo 123
and that worked! Turns out my file is stored in my home directory and  
I needed to add ~/ in front of the file name.


Now, how is Skim supposed to know this path? The file in Skim is  
opened with the same filename but in a tmp directory.


It works for you though, so here are my questions;

1. your pdf file is located in a tmp directory or alongside your .lyx  
file?


2. in LyX when you have a file opened, do you see the full pathname or  
just the name of the file [I see the full path, so it seems LyX  
considers that the name of the file, which may be the root of the  
problem]


Thanks

-Ivan


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



Refernces

2008-07-22 Thread Hesham Kamel
Hello,
I am writing my thesis now, and just knew about LATEX.
I downloaded LyX, and started to work with, however I have a concern.
In MS Word, I am using a citation manager, Refworks to insert citations, and
at the end it produces a bibliography numbered list, while in the main
document itself, it generates  references to the list according to the
selected style.
e.g. a full frontal impact can extend for more than half a day even with
current computational capabilities [1].
and

1. REFERENCES

[1]  Natori, S., and Yu, Q., 2007, 2007-01-0882 an Application of CAP
(Computer-Aided Principle) to Structural Design for Vehicle Crash Safety,
SAE SP, (2072) pp. 73-80.
so, can I get the same using LyX?
Do I need any additional software?

Thank you,

-- 
Hesham Kamel
PhD. Candidate at Mechanical and Industrial Engineering

Concordia University
1515 St. Catherine West, EV013.205
Montreal, Quebec
H3G-2W1

Telephone : +1-514-848-2424 x 7095
Fax : +1-514-848-3175


Re: How to make a clone of the Enumerate environment?

2008-07-22 Thread Steve Litt
Günter (and everyone else),

Your response contains one of the most useful LyX idioms I've ever seen, 
limiting my biggest objection to LyX. It will lead to vastly improved 
productivity for me.

Can anyone guess which part of Günter's email is so useful? I'll reveal it in 
another email, coming up shortly.

On Wednesday 16 July 2008 07:34, G. Milde wrote:
 On 14.07.08, Steve Litt wrote:
  Hi all,
 
  I'm trying to make a simple clone of the Enumerate environment. Once I
  can do that, I'll make a few changes. But I've not been able to clone
  it.

 You need to clone both, LyX layout::

   Style Questions
  CopyStyle   Enumeration


 and LaTeX environment::

   \newenvironment{questions}{\begin{enumerate}}{\end{enumerate}}

  Here's my layout file:
 
  #% Do not delete the line below; configure depends on this
  #  \DeclareLaTeXClass[book]{quizbook}
 
  Input stdclass.inc
 
  Preamble
  \let\questions = \enumerate
  \let\oldquestions = \oldenumerate
  EndPreamble

 I am not sure if this works well, as enumerate is an environment, not a
 command. Use the latex \newenvironment instead.

  Style Questions

 ...

  End

 With CopyStyle, you get all the definitions of the copied style and
 need to change only thing that should differ.

  The preceding layout produces the output shown in the attached
  screenshot_questions.gif. However, if I change the LatexName in the LyX
  environment from questions to enumerate, it outputs as shown in the
  attached screenshot_enumerate.gif.

 Describing the difference in words helps (while pics might augment
 this, they cannot always replace a description, e.g. while browsing
 this mail to see if I can help at all, I do not see the attachments.)

  Can somebody explain to me why the two don't output the same?

 no.

 Can somebody explain how I can truly clone the Enumerate environment?

 see above.

  NOTE: In order to toggle the output when switching between LatexType
  questions and LatexType enumerate, you must Tools-reconfigure and then
  terminate and restart LyX. Trust me on this -- I tried without
  reconfiguring and the output didn't toggle.

 You could define 2 Styles in your layout file (one QuestionsTest, say)
 and switch between them in the document.

 Günter

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



Life changing LyX idiom gives me new productivity

2008-07-22 Thread Steve Litt
Hi all,

In a different thread, Gunter Milde penned these words:

 You need to clone both, LyX layout::

   Style Questions
  CopyStyle   Enumeration


That is THE most powerful LyX idiom I've ever seen.

As most of you know, my biggest objection to LyX is the excruciating pain 
required to make my own environments in the layout file.

Excruciating pain is an overstatement. I was a contract software developer 
from 1984-2002, so obviously I can make the environments. My problem is that, 
for me, it's very hard to switch mindsets from author to tech geek and back 
again in order to create a style.

Now I don't have to. When I come upon a situation requiring a new style, I 
just put this in my layout file:

Style MyNewStyle
CopyStyle Standard
End

And I go on about my business. When I have time I'll check whether I can 
actually change appearances in LyX like this:

Style MyNewStyle
CopyStyle Standard
LeftMarginMMM
RightMargin   MMM
Font
SizeLarger
EndFont
End

If that's possible, then within LyX I can see at a glance that my new style is 
custom, and that I later have to develop the LaTeX to complete it.

After several days or weeks of creating this type of dummy styles, one day I 
can go into programmer mode and make all the styles without the pressure of 
having to slam out 2000 words that day.

So Gunter -- thanks SO much for that idiom. It makes LyX a much more useful 
tool.

SteveT

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



Re: Refernces

2008-07-22 Thread Kamran SHAFQAT

Hesham Kamel wrote:

Hello,
I am writing my thesis now, and just knew about LATEX.
I downloaded LyX, and started to work with, however I have a concern.
In MS Word, I am using a citation manager, Refworks to insert citations, and
at the end it produces a bibliography numbered list, while in the main
document itself, it generates  references to the list according to the
selected style.
e.g. a full frontal impact can extend for more than half a day even with
current computational capabilities [1].
and

1. REFERENCES

[1]  Natori, S., and Yu, Q., 2007, 2007-01-0882 an Application of CAP
(Computer-Aided Principle) to Structural Design for Vehicle Crash Safety,
SAE SP, (2072) pp. 73-80.
so, can I get the same using LyX?
Do I need any additional software?

Thank you,

  

Hi,
As far as i know you have to get a bib file for your references and than 
you can insert them in Lyx using any style. The citation manager that 
you are using probably will generate the bib file i think. But you can 
have a look at Lyx wiki page were thay have information about software 
that you can use and other details regarding references.


http://wiki.lyx.org/BibTeX/BibTeX

I am using Jabref a free references manager which is quite good you can 
get it from


http://jabref.sourceforge.net/

Regards

Kamran



Re: replace text

2008-07-22 Thread Paul A. Rubin

Sylvain wrote:

Try this in the preamble:

\usepackage{fixltx2e}
\newcommand{\HHO}{H\textsubscript{2}O}

Then in your text, put \HHO{} in ERT.

/Paul



What happens when there are plenty of different formulas? Any clever way of
dealing with it?
Thanks,
Sylvain



If they are all chemical formulae, I suspect the package Nicolas Ferre' 
recommended is the answer.  If they are something else, and assuming you 
use them frequently, I would suggest either putting them all in a text 
file that you can \include in any document where you need them, or else 
modify your layout file(s) to include them in the preamble (the former 
being less work).


/Paul



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:

layout name=Standard
this.
/layout

layout name=Standard
inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
/layout

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

That's not anything actually agreed or implemented

rh



Re: Life changing LyX idiom gives me new productivity

2008-07-22 Thread rgheck

Steve Litt wrote:
When I have time I'll check whether I can 
actually change appearances in LyX like this:


Style MyNewStyle
CopyStyle Standard
LeftMarginMMM
RightMargin   MMM
Font
SizeLarger
EndFont
End

If that's possible, then within LyX I can see at a glance that my new style is 
custom, and that I later have to develop the LaTeX to complete it.


  
You can do this kind of thing. Later declarations just override earlier 
ones. Have a look at e.g. stdsections.inc, or the ams layouts, where 
this idea is used over and over again.


rh



Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning


On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


I can get it working if I specify in Skim's preferences the complete  
path to lyxeditor by selecting a custom preset for PDFSync support:


/Applications/LyX.app/Contents/MacOS/lyxeditor

If that works for you, then it looks like the problem is in Skim,  
and the bug should be reported to them.


Bennett


I finally got it working, combining what you said (adding the full  
path) and changing the way Skim calls lyxeditor. Skim's default is

%file %line
but that does not work for me. I removed the quotes and it works with:
   %file %line
I have no idea why.

Bennett, if you could check what arguments you have set up in Skim  
that would be helpful. I could then report to the Skim developers with  
more than my own experience. Thanks


-ivan


Re: replace text

2008-07-22 Thread Sylvain
 If they are all chemical formulae, I suspect the package Nicolas Ferre' 
 recommended is the answer.  If they are something else, and assuming you 
 use them frequently, I would suggest either putting them all in a text 
 file that you can \include in any document where you need them, or else 
 modify your layout file(s) to include them in the preamble (the former 
 being less work).
 
 /Paul
 

Thanks, the package mentioned by Nicolas is exactly what I was looking for. It
makes copy-pasting chemistry documents from MS-Word much easier.
Sylvain






Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 12:24 PM, Ivan Werning [EMAIL PROTECTED] wrote:


 On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


 I can get it working if I specify in Skim's preferences the complete path
 to lyxeditor by selecting a custom preset for PDFSync support:

 /Applications/LyX.app/Contents/MacOS/lyxeditor

 If that works for you, then it looks like the problem is in Skim, and the
 bug should be reported to them.

 Bennett


 I finally got it working, combining what you said (adding the full path)
 and changing the way Skim calls lyxeditor. Skim's default is
%file %line
 but that does not work for me. I removed the quotes and it works with:
   %file %line
 I have no idea why.

 Bennett, if you could check what arguments you have set up in Skim that
 would be helpful. I could then report to the Skim developers with more than
 my own experience. Thanks


Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my system is a
developmental build of LyX-1.6. There's a line in the lyxeditor script that
is supposed to point to possible LyX user folders in ~/Library/Application
Support/, but it currently does not point to the new (for 1.6) LyX-1.6
folder there. Correcting that makes the default setting in Skim work for me.
Similarly, going back to LyX-1.5 works for me as well -- with the default
Skim settings.

Note, by the way, that Skim assumes it's dealing with a .tex file and it
passes the complete path to the .tex file to lyxeditor. So what it actually
calls (when I fill in the complete path to lyxeditor) is something like:

/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in what it
sends to lyxeditor, but I might be doing something wrong.) That means your
worries about the .lyx file and complete path are, I believe, misplaced.

Nonetheless, I can't yet explain why it fails to work for you with the
default Skim settings or why you need to remove the quotes from %file to get
it to work. Do you have LyX at /Applications/LyX.app? What is the actual
filename of the file you are testing? (Does it have any unusual characters
in it?) Have you specified a LyX temporary directory other than the default
(/tmp)? If so, what is the complete path to it?

Bennett


Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 12:24 PM, Ivan Werning [EMAIL PROTECTED] wrote:


 On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


 I can get it working if I specify in Skim's preferences the complete path
 to lyxeditor by selecting a custom preset for PDFSync support:

 /Applications/LyX.app/Contents/MacOS/lyxeditor

 If that works for you, then it looks like the problem is in Skim, and the
 bug should be reported to them.

 Bennett


 I finally got it working, combining what you said (adding the full path)
 and changing the way Skim calls lyxeditor. Skim's default is
%file %line
 but that does not work for me. I removed the quotes and it works with:
   %file %line
 I have no idea why.

 Bennett, if you could check what arguments you have set up in Skim that
 would be helpful. I could then report to the Skim developers with more than
 my own experience. Thanks


Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my system is a
developmental build of LyX-1.6. There's a line in the lyxeditor script that
is supposed to point to possible LyX user folders in ~/Library/Application
Support/, but it currently does not point to the new (for 1.6) LyX-1.6
folder there. Correcting that makes the default setting in Skim work for me.
Similarly, going back to LyX-1.5 works for me as well -- with the default
Skim settings.

Note, by the way, that Skim assumes it's dealing with a .tex file and it
passes the complete path to the .tex file to lyxeditor. So what it actually
calls (when I fill in the complete path to lyxeditor) is something like:

/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in what it
sends to lyxeditor, but I might be doing something wrong.) That means your
worries about the .lyx file and complete path are, I believe, misplaced.

Nonetheless, I can't yet explain why it fails to work for you with the
default Skim settings or why you need to remove the quotes from %file to get
it to work. Do you have LyX at /Applications/LyX.app? What is the actual
filename of the file you are testing? (Does it have any unusual characters
in it?) Have you specified a LyX temporary directory other than the default
(/tmp)? If so, what is the complete path to it?

Bennett


Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning

First of all, thanks for your help Bennett. See below.

On Jul 22, 2008, at 1:52 PM, Bennett Helm wrote:



Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my  
system is a developmental build of LyX-1.6. There's a line in the  
lyxeditor script that is supposed to point to possible LyX user  
folders in ~/Library/Application Support/, but it currently does not  
point to the new (for 1.6) LyX-1.6 folder there. Correcting that  
makes the default setting in Skim work for me. Similarly, going back  
to LyX-1.5 works for me as well -- with the default Skim settings.




The default didn't work for me on LyX 1.5.5 and Skim 1.1.8
Both programs are in /Applications/


Note, by the way, that Skim assumes it's dealing with a .tex file  
and it passes the complete path to the .tex file to lyxeditor. So  
what it actually calls (when I fill in the complete path to  
lyxeditor) is something like:


/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in  
what it sends to lyxeditor, but I might be doing something wrong.)  
That means your worries about the .lyx file and complete path are, I  
believe, misplaced.


Well, all I know is that I got it to work by giving it the complete  
path to lyxeditor (which is precisely /Applications/LyX.app/Contents/ 
MacOS/lyxeditor) and by removing the quotes in the argument field.


Without either of those changes, it does not work (at least not  
consistently, more below).




Nonetheless, I can't yet explain why it fails to work for you with  
the default Skim settings or why you need to remove the quotes from  
%file to get it to work. Do you have LyX at /Applications/LyX.app?


Yes

What is the actual filename of the file you are testing? (Does it  
have any unusual characters in it?)


~\text.lyx


Have you specified a LyX temporary directory other than the default  
(/tmp)? If so, what is the complete path to it?




I left it at the default /tmp indeed


Bennett



One last thing: everything I reported above, notwithstanding, I just  
tested it now with the default LyX settings in Skim and it works!  
Given that previously it failed, and I am dead sure of that (and I had  
restarted programs, deleted pipe files, tried everything etc.), I have  
to conclude that there is something random that throws it off  
sometimes, maybe the status of pipe files or something (which I do not  
know much about). I think that those default settings hence seem to  
work, but may not do so reliably.  A true mystery


(btw, slightly off topic now: LyX doesn't have forward search does it?)


Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 2:24 PM, Ivan Werning [EMAIL PROTECTED] wrote:

 First of all, thanks for your help Bennett. See below.


You're welcome.

snip


 One last thing: everything I reported above, notwithstanding, I just tested
 it now with the default LyX settings in Skim and it works! Given that
 previously it failed, and I am dead sure of that (and I had restarted
 programs, deleted pipe files, tried everything etc.), I have to conclude
 that there is something random that throws it off sometimes, maybe the
 status of pipe files or something (which I do not know much about). I think
 that those default settings hence seem to work, but may not do so reliably.
  A true mystery


That is strange. If you notice a pattern to it, please let us know.


 (btw, slightly off topic now: LyX doesn't have forward search does it?)


Unfortunately, no. There's a very old enhancement request for this:

http://bugzilla.lyx.org/show_bug.cgi?id=706

Bennett


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:

 layout name=Standard
 this.
 /layout

 layout name=Standard
 inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
 /layout

 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 Pavel Sanda
 Steve Litt wrote:
 layout name=Standard
 this.
 /layout

 layout name=Standard
 inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
 /layout

 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 layout name=Standard. 

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 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 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 layout name=Standard.

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 (xml)

2008-07-22 Thread rgheck

Pavel Sanda wrote:

Steve Litt wrote:
layout name=Standard
this.
/layout

layout name=Standard
inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain /
/layout

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 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

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:
 
  layout name=Standard
  this.
  /layout
 
  layout name=Standard
  inset type=bibtext latex=bibtex bibfiles=/tmp/bib options=plain
  / /layout
 
  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 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 layout name=Standard.
 
 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 (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


Hollywood template author's address

2008-07-22 Thread Thomas King
I looked through the archives and wiki, and didn't find an answer to
this issue (although it was mentioned on the devel list). The
hollywood.lyx template doesn't render the author's address. Is there
something I need to tweak first? 

Thank you, 
Tom King


signature.asc
Description: This is a digitally signed message part


Documentation of LyX functions (aka LFUNs)

2008-07-22 Thread Pavel Sanda
Dear LyXers,

I'm proud to announce that the LFUNs documentation project has been finished.

If you are interested in mastering LyX this documentation could be useful for
your needs.

Some technical speech:

* All documentation is orginally written as doxygen comments in our source 
code, 
  so this should be the first place to check-up documentation bugs, 
improvements etc.
  You should be able to find most up-to-date version (but not much readable) 
here:

  http://www.lyx.org/trac/browser/lyx-devel/trunk/src/LyXAction.cpp


* The documentation is synchonized with the upcomming LyX 1.6. Many things
  could be used even for 1.5 series of LyX, but be careful (bug reports should
  be checked always against 1.6.)


* HTML documentation was produced via doxygen. The file could be found here:

  http://www.lyx.org/~sanda/doxygen/html/namespacelyx.html

  or you can go directly to the right section:

  
http://www.lyx.org/~sanda/doxygen/html/namespacelyx.html#5ae63e8160e98b54ad28f142ed40c202


* .lyx version was produced by hand-crafted script and can be found here:

   http://www.lyx.org/~sanda/doxygen/lfuns.lyx

   or .pdf version respectively:

   http://www.lyx.org/~sanda/doxygen/lfuns.pdf


I would appreciate all bug reports (i.e. some lfun does not work in the way
its documented), typo in documentation etc.


Disclaimer: Please note that the conversion to HTML or .lyx is not at all
100% and is not intended to be typographical jewel...

Enjoy!
Pavel


Re: How to make a clone of the Enumerate environment?

2008-07-22 Thread Dirk Markert
2008/7/22 Steve Litt [EMAIL PROTECTED]:

 Günter (and everyone else),

 Your response contains one of the most useful LyX idioms I've ever seen,
 limiting my biggest objection to LyX. It will lead to vastly improved
 productivity for me.

 Can anyone guess which part of Günter's email is so useful? I'll reveal it
 in
 another email, coming up shortly.


CopyStyle?

Dirk


Re: replace text

2008-07-22 Thread Nicolas Ferré

Jon Brauer a écrit :

I have a question about a seemingly simple thing that I can't figure
out how to get LyX to do: I am writing an article for a chemical
journal, so I am including a lot of chemical formulas. So I would like
to be able to type H2O and have the final output read with the 2 as a
subscript. The same way if I type LaTeX it prints pretty and
formatted. Thanks in advance for any help.

--
- jon




Hi,

The mhchem package is rather convenient for typing chemical formulae and 
reaction equations. The water molecule can be written as \ce{H2O}.


--
Nicolas Ferre'
Laboratoire Chimie Provence
Universite' de Provence - France
Tel: +33 491282733
http://sites.univ-provence.fr/lcp-ct


Re: replace text

2008-07-22 Thread Sylvain
> Try this in the preamble:
> 
> \usepackage{fixltx2e}
> \newcommand{\HHO}{H\textsubscript{2}O}
> 
> Then in your text, put \HHO{} in ERT.
> 
> /Paul
> 
> 
What happens when there are plenty of different formulas? Any clever way of
dealing with it?
Thanks,
Sylvain





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

Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning

On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


I can get it working if I specify in Skim's preferences the complete  
path to lyxeditor by selecting a custom preset for PDFSync support:


/Applications/LyX.app/Contents/MacOS/lyxeditor

If that works for you, then it looks like the problem is in Skim,  
and the bug should be reported to them.


Bennett


That didn't work for me. But based on the following I now have an  
hypothesis and two questions for you:


I learned from the following command line experiments. I ran
/Applications/LyX.app/Contents/MacOS/lyxeditor foo 123
to go to line 123 of foo.lyx (currently open in LyX) and that did not  
work. I then ran

/Applications/LyX.app/Contents/MacOS/lyxeditor ~/foo 123
and that worked! Turns out my file is stored in my home directory and  
I needed to add "~/" in front of the file name.


Now, how is Skim supposed to know this path? The file in Skim is  
opened with the same filename but in a tmp directory.


It works for you though, so here are my questions;

1. your pdf file is located in a tmp directory or alongside your .lyx  
file?


2. in LyX when you have a file opened, do you see the full pathname or  
just the name of the file [I see the full path, so it seems LyX  
considers that the name of the file, which may be the root of the  
problem]


Thanks

-Ivan


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



Refernces

2008-07-22 Thread Hesham Kamel
Hello,
I am writing my thesis now, and just knew about LATEX.
I downloaded LyX, and started to work with, however I have a concern.
In MS Word, I am using a citation manager, Refworks to insert citations, and
at the end it produces a bibliography numbered list, while in the main
document itself, it generates  references to the list according to the
selected style.
e.g. a full frontal impact can extend for more than half a day even with
current computational capabilities [1].
and

1. REFERENCES

[1]  Natori, S., and Yu, Q., 2007, "2007-01-0882 an Application of CAP
(Computer-Aided Principle) to Structural Design for Vehicle Crash Safety,"
SAE SP, (2072) pp. 73-80.
so, can I get the same using LyX?
Do I need any additional software?

Thank you,

-- 
Hesham Kamel
PhD. Candidate at Mechanical and Industrial Engineering

Concordia University
1515 St. Catherine West, EV013.205
Montreal, Quebec
H3G-2W1

Telephone : +1-514-848-2424 x 7095
Fax : +1-514-848-3175


Re: How to make a clone of the Enumerate environment?

2008-07-22 Thread Steve Litt
Günter (and everyone else),

Your response contains one of the most useful LyX idioms I've ever seen, 
limiting my biggest objection to LyX. It will lead to vastly improved 
productivity for me.

Can anyone guess which part of Günter's email is so useful? I'll reveal it in 
another email, coming up shortly.

On Wednesday 16 July 2008 07:34, G. Milde wrote:
> On 14.07.08, Steve Litt wrote:
> > Hi all,
> >
> > I'm trying to make a simple clone of the Enumerate environment. Once I
> > can do that, I'll make a few changes. But I've not been able to clone
> > it.
>
> You need to clone both, LyX layout::
>
>   Style Questions
>  CopyStyle   Enumeration
>
>
> and LaTeX environment::
>
>   \newenvironment{questions}{\begin{enumerate}}{\end{enumerate}}
>
> > Here's my layout file:
> >
> > #% Do not delete the line below; configure depends on this
> > #  \DeclareLaTeXClass[book]{quizbook}
> >
> > Input stdclass.inc
> >
> > Preamble
> > \let\questions = \enumerate
> > \let\oldquestions = \oldenumerate
> > EndPreamble
>
> I am not sure if this works well, as enumerate is an environment, not a
> command. Use the latex \newenvironment instead.
>
> > Style Questions
>
> ...
>
> > End
>
> With CopyStyle, you get all the definitions of the copied style and
> need to change only thing that should differ.
>
> > The preceding layout produces the output shown in the attached
> > screenshot_questions.gif. However, if I change the LatexName in the LyX
> > environment from "questions" to "enumerate", it outputs as shown in the
> > attached screenshot_enumerate.gif.
>
> Describing the difference in words helps (while pics might augment
> this, they cannot always replace a description, e.g. while browsing
> this mail to see if I can help at all, I do not see the attachments.)
>
> > Can somebody explain to me why the two don't output the same?
>
> no.
>
> >Can somebody explain how I can truly clone the Enumerate environment?
>
> see above.
>
> > NOTE: In order to toggle the output when switching between LatexType
> > questions and LatexType enumerate, you must Tools->reconfigure and then
> > terminate and restart LyX. Trust me on this -- I tried without
> > reconfiguring and the output didn't toggle.
>
> You could define 2 Styles in your layout file (one QuestionsTest, say)
> and switch between them in the document.
>
> Günter

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



Life changing LyX idiom gives me new productivity

2008-07-22 Thread Steve Litt
Hi all,

In a different thread, Gunter Milde penned these words:

> You need to clone both, LyX layout::
>
>   Style Questions
>  CopyStyle   Enumeration
>

That is THE most powerful LyX idiom I've ever seen.

As most of you know, my biggest objection to LyX is the excruciating pain 
required to make my own environments in the layout file.

"Excruciating pain" is an overstatement. I was a contract software developer 
from 1984-2002, so obviously I can make the environments. My problem is that, 
for me, it's very hard to switch mindsets from author to tech geek and back 
again in order to create a style.

Now I don't have to. When I come upon a situation requiring a new style, I 
just put this in my layout file:

Style MyNewStyle
CopyStyle Standard
End

And I go on about my business. When I have time I'll check whether I can 
actually change appearances in LyX like this:

Style MyNewStyle
CopyStyle Standard
LeftMarginMMM
RightMargin   MMM
Font
SizeLarger
EndFont
End

If that's possible, then within LyX I can see at a glance that my new style is 
custom, and that I later have to develop the LaTeX to complete it.

After several days or weeks of creating this type of dummy styles, one day I 
can go into programmer mode and make all the styles without the pressure of 
having to slam out 2000 words that day.

So Gunter -- thanks SO much for that idiom. It makes LyX a much more useful 
tool.

SteveT

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



Re: Refernces

2008-07-22 Thread Kamran SHAFQAT

Hesham Kamel wrote:

Hello,
I am writing my thesis now, and just knew about LATEX.
I downloaded LyX, and started to work with, however I have a concern.
In MS Word, I am using a citation manager, Refworks to insert citations, and
at the end it produces a bibliography numbered list, while in the main
document itself, it generates  references to the list according to the
selected style.
e.g. a full frontal impact can extend for more than half a day even with
current computational capabilities [1].
and

1. REFERENCES

[1]  Natori, S., and Yu, Q., 2007, "2007-01-0882 an Application of CAP
(Computer-Aided Principle) to Structural Design for Vehicle Crash Safety,"
SAE SP, (2072) pp. 73-80.
so, can I get the same using LyX?
Do I need any additional software?

Thank you,

  

Hi,
As far as i know you have to get a bib file for your references and than 
you can insert them in Lyx using any style. The citation manager that 
you are using probably will generate the bib file i think. But you can 
have a look at Lyx wiki page were thay have information about software 
that you can use and other details regarding references.


http://wiki.lyx.org/BibTeX/BibTeX

I am using Jabref a free references manager which is quite good you can 
get it from


http://jabref.sourceforge.net/

Regards

Kamran



Re: replace text

2008-07-22 Thread Paul A. Rubin

Sylvain wrote:

Try this in the preamble:

\usepackage{fixltx2e}
\newcommand{\HHO}{H\textsubscript{2}O}

Then in your text, put \HHO{} in ERT.

/Paul



What happens when there are plenty of different formulas? Any clever way of
dealing with it?
Thanks,
Sylvain



If they are all chemical formulae, I suspect the package Nicolas Ferre' 
recommended is the answer.  If they are something else, and assuming you 
use them frequently, I would suggest either putting them all in a text 
file that you can \include in any document where you need them, or else 
modify your layout file(s) to include them in the preamble (the former 
being less work).


/Paul



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: Life changing LyX idiom gives me new productivity

2008-07-22 Thread rgheck

Steve Litt wrote:
When I have time I'll check whether I can 
actually change appearances in LyX like this:


Style MyNewStyle
CopyStyle Standard
LeftMarginMMM
RightMargin   MMM
Font
SizeLarger
EndFont
End

If that's possible, then within LyX I can see at a glance that my new style is 
custom, and that I later have to develop the LaTeX to complete it.


  
You can do this kind of thing. Later declarations just override earlier 
ones. Have a look at e.g. stdsections.inc, or the ams layouts, where 
this idea is used over and over again.


rh



Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning


On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:


I can get it working if I specify in Skim's preferences the complete  
path to lyxeditor by selecting a custom preset for PDFSync support:


/Applications/LyX.app/Contents/MacOS/lyxeditor

If that works for you, then it looks like the problem is in Skim,  
and the bug should be reported to them.


Bennett


I finally got it working, combining what you said (adding the full  
path) and changing the way Skim calls lyxeditor. Skim's default is

"%file" %line
but that does not work for me. I removed the quotes and it works with:
   %file %line
I have no idea why.

Bennett, if you could check what arguments you have set up in Skim  
that would be helpful. I could then report to the Skim developers with  
more than my own experience. Thanks


-ivan


Re: replace text

2008-07-22 Thread Sylvain
> If they are all chemical formulae, I suspect the package Nicolas Ferre' 
> recommended is the answer.  If they are something else, and assuming you 
> use them frequently, I would suggest either putting them all in a text 
> file that you can \include in any document where you need them, or else 
> modify your layout file(s) to include them in the preamble (the former 
> being less work).
> 
> /Paul
> 

Thanks, the package mentioned by Nicolas is exactly what I was looking for. It
makes copy-pasting chemistry documents from MS-Word much easier.
Sylvain






Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 12:24 PM, Ivan Werning <[EMAIL PROTECTED]> wrote:

>
> On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:
>
>>
>> I can get it working if I specify in Skim's preferences the complete path
>> to lyxeditor by selecting a custom preset for PDFSync support:
>>
>> /Applications/LyX.app/Contents/MacOS/lyxeditor
>>
>> If that works for you, then it looks like the problem is in Skim, and the
>> bug should be reported to them.
>>
>> Bennett
>>
>
> I finally got it working, combining what you said (adding the full path)
> and changing the way Skim calls lyxeditor. Skim's default is
>"%file" %line
> but that does not work for me. I removed the quotes and it works with:
>   %file %line
> I have no idea why.
>
> Bennett, if you could check what arguments you have set up in Skim that
> would be helpful. I could then report to the Skim developers with more than
> my own experience. Thanks


Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my system is a
developmental build of LyX-1.6. There's a line in the lyxeditor script that
is supposed to point to possible LyX user folders in ~/Library/Application
Support/, but it currently does not point to the new (for 1.6) LyX-1.6
folder there. Correcting that makes the default setting in Skim work for me.
Similarly, going back to LyX-1.5 works for me as well -- with the default
Skim settings.

Note, by the way, that Skim assumes it's dealing with a .tex file and it
passes the complete path to the .tex file to lyxeditor. So what it actually
calls (when I fill in the complete path to lyxeditor) is something like:

/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in what it
sends to lyxeditor, but I might be doing something wrong.) That means your
worries about the .lyx file and complete path are, I believe, misplaced.

Nonetheless, I can't yet explain why it fails to work for you with the
default Skim settings or why you need to remove the quotes from %file to get
it to work. Do you have LyX at /Applications/LyX.app? What is the actual
filename of the file you are testing? (Does it have any unusual characters
in it?) Have you specified a LyX temporary directory other than the default
(/tmp)? If so, what is the complete path to it?

Bennett


Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 12:24 PM, Ivan Werning <[EMAIL PROTECTED]> wrote:

>
> On Jul 22, 2008, at 12:07 AM, Bennett Helm wrote:
>
>>
>> I can get it working if I specify in Skim's preferences the complete path
>> to lyxeditor by selecting a custom preset for PDFSync support:
>>
>> /Applications/LyX.app/Contents/MacOS/lyxeditor
>>
>> If that works for you, then it looks like the problem is in Skim, and the
>> bug should be reported to them.
>>
>> Bennett
>>
>
> I finally got it working, combining what you said (adding the full path)
> and changing the way Skim calls lyxeditor. Skim's default is
>"%file" %line
> but that does not work for me. I removed the quotes and it works with:
>   %file %line
> I have no idea why.
>
> Bennett, if you could check what arguments you have set up in Skim that
> would be helpful. I could then report to the Skim developers with more than
> my own experience. Thanks


Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my system is a
developmental build of LyX-1.6. There's a line in the lyxeditor script that
is supposed to point to possible LyX user folders in ~/Library/Application
Support/, but it currently does not point to the new (for 1.6) LyX-1.6
folder there. Correcting that makes the default setting in Skim work for me.
Similarly, going back to LyX-1.5 works for me as well -- with the default
Skim settings.

Note, by the way, that Skim assumes it's dealing with a .tex file and it
passes the complete path to the .tex file to lyxeditor. So what it actually
calls (when I fill in the complete path to lyxeditor) is something like:

/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in what it
sends to lyxeditor, but I might be doing something wrong.) That means your
worries about the .lyx file and complete path are, I believe, misplaced.

Nonetheless, I can't yet explain why it fails to work for you with the
default Skim settings or why you need to remove the quotes from %file to get
it to work. Do you have LyX at /Applications/LyX.app? What is the actual
filename of the file you are testing? (Does it have any unusual characters
in it?) Have you specified a LyX temporary directory other than the default
(/tmp)? If so, what is the complete path to it?

Bennett


Re: pdfsync problems with Skim

2008-07-22 Thread Ivan Werning

First of all, thanks for your help Bennett. See below.

On Jul 22, 2008, at 1:52 PM, Bennett Helm wrote:



Actually, this is not a bug in Skim, as far as I can see.

I have been testing LyX-1.6, and so /Applications/LyX.app on my  
system is a developmental build of LyX-1.6. There's a line in the  
lyxeditor script that is supposed to point to possible LyX user  
folders in ~/Library/Application Support/, but it currently does not  
point to the new (for 1.6) LyX-1.6 folder there. Correcting that  
makes the default setting in Skim work for me. Similarly, going back  
to LyX-1.5 works for me as well -- with the default Skim settings.




The default didn't work for me on LyX 1.5.5 and Skim 1.1.8
Both programs are in /Applications/


Note, by the way, that Skim assumes it's dealing with a .tex file  
and it passes the complete path to the .tex file to lyxeditor. So  
what it actually calls (when I fill in the complete path to  
lyxeditor) is something like:


/Applications/LyX.app/Contents/MacOS/lyxeditor /path/to/foo.tex 123

(Even when I have the quotes around %file, I don't see the quotes in  
what it sends to lyxeditor, but I might be doing something wrong.)  
That means your worries about the .lyx file and complete path are, I  
believe, misplaced.


Well, all I know is that I got it to work by giving it the complete  
path to lyxeditor (which is precisely /Applications/LyX.app/Contents/ 
MacOS/lyxeditor) and by removing the quotes in the argument field.


Without either of those changes, it does not work (at least not  
consistently, more below).




Nonetheless, I can't yet explain why it fails to work for you with  
the default Skim settings or why you need to remove the quotes from  
%file to get it to work. Do you have LyX at /Applications/LyX.app?


Yes

What is the actual filename of the file you are testing? (Does it  
have any unusual characters in it?)


~\text.lyx


Have you specified a LyX temporary directory other than the default  
(/tmp)? If so, what is the complete path to it?




I left it at the default /tmp indeed


Bennett



One last thing: everything I reported above, notwithstanding, I just  
tested it now with the default LyX settings in Skim and it works!  
Given that previously it failed, and I am dead sure of that (and I had  
restarted programs, deleted pipe files, tried everything etc.), I have  
to conclude that there is something random that throws it off  
sometimes, maybe the status of pipe files or something (which I do not  
know much about). I think that those default settings hence seem to  
work, but may not do so reliably.  A true mystery


(btw, slightly off topic now: LyX doesn't have forward search does it?)


Re: pdfsync problems with Skim

2008-07-22 Thread Bennett Helm
On Tue, Jul 22, 2008 at 2:24 PM, Ivan Werning <[EMAIL PROTECTED]> wrote:

> First of all, thanks for your help Bennett. See below.


You're welcome.




> One last thing: everything I reported above, notwithstanding, I just tested
> it now with the default LyX settings in Skim and it works! Given that
> previously it failed, and I am dead sure of that (and I had restarted
> programs, deleted pipe files, tried everything etc.), I have to conclude
> that there is something random that throws it off sometimes, maybe the
> status of pipe files or something (which I do not know much about). I think
> that those default settings hence seem to work, but may not do so reliably.
>  A true mystery


That is strange. If you notice a pattern to it, please let us know.


> (btw, slightly off topic now: LyX doesn't have forward search does it?)
>

Unfortunately, no. There's a very old enhancement request for this:

http://bugzilla.lyx.org/show_bug.cgi?id=706

Bennett


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 (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 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 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 (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 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

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 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 (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


Hollywood template author's address

2008-07-22 Thread Thomas King
I looked through the archives and wiki, and didn't find an answer to
this issue (although it was mentioned on the devel list). The
hollywood.lyx template doesn't render the author's address. Is there
something I need to tweak first? 

Thank you, 
Tom King


signature.asc
Description: This is a digitally signed message part


Documentation of LyX functions (aka LFUNs)

2008-07-22 Thread Pavel Sanda
Dear LyXers,

I'm proud to announce that the LFUNs documentation project has been finished.

If you are interested in mastering LyX this documentation could be useful for
your needs.

Some technical speech:

* All documentation is orginally written as doxygen comments in our source 
code, 
  so this should be the first place to check-up documentation bugs, 
improvements etc.
  You should be able to find most up-to-date version (but not much readable) 
here:

  http://www.lyx.org/trac/browser/lyx-devel/trunk/src/LyXAction.cpp


* The documentation is synchonized with the upcomming LyX 1.6. Many things
  could be used even for 1.5 series of LyX, but be careful (bug reports should
  be checked always against 1.6.)


* HTML documentation was produced via doxygen. The file could be found here:

  http://www.lyx.org/~sanda/doxygen/html/namespacelyx.html

  or you can go directly to the right section:

  
http://www.lyx.org/~sanda/doxygen/html/namespacelyx.html#5ae63e8160e98b54ad28f142ed40c202


* .lyx version was produced by hand-crafted script and can be found here:

   http://www.lyx.org/~sanda/doxygen/lfuns.lyx

   or .pdf version respectively:

   http://www.lyx.org/~sanda/doxygen/lfuns.pdf


I would appreciate all bug reports (i.e. some lfun does not work in the way
its documented), typo in documentation etc.


Disclaimer: Please note that the conversion to HTML or .lyx is not at all
100% and is not intended to be typographical jewel...

Enjoy!
Pavel


Re: How to make a clone of the Enumerate environment?

2008-07-22 Thread Dirk Markert
2008/7/22 Steve Litt <[EMAIL PROTECTED]>:

> Günter (and everyone else),
>
> Your response contains one of the most useful LyX idioms I've ever seen,
> limiting my biggest objection to LyX. It will lead to vastly improved
> productivity for me.
>
> Can anyone guess which part of Günter's email is so useful? I'll reveal it
> in
> another email, coming up shortly.


CopyStyle?

Dirk