Re: Edit complete source?

2007-12-10 Thread G. Milde
On  7.12.07, Jean-Marc Lasgouttes wrote:
> Richard Heck <[EMAIL PROTECTED]> writes:
> > bigblop wrote:
> >>   
> > Yes, that's right. What people call "round-trip" source view doesn't
> > yet exist, though many people would like to see it. 

> > We can import LaTeX using tex2lyx. But the problem is that, at the
> > moment, tex2lyx isn't really integrated into LyX; it's a standalone
> > utility. And even if it were integrated into LyX, tex2lyx isn't always
> > terribly reliable. Those, as I understand things, are the main issues.

Whether standalone script or not, does not necessarily matter.

The problem is whether it is possible to have a loss-less lyx->latex->lyx
conversion.

Theory:
  is it possible to have a deterministic and loss-less round trip
  or will there always be some guessing and loss of information?

Praxis:
  is it feasible to assume that latex export and import can be made so
  stable that repeated round-trips will never corrupt your document?

> The main issue as I see it is that some people have the hope that writing
> raw latex will allow them to get almost native support for things that
> LyX does not support yet. 

I agree that latex source editing will not extend the set of things
with native LyX support and can lead to increase of ERT at the expense
of doing things "the LyX way".

> I'd like to hear about reasonable use cases.

Writing ERT in context: 
   LaTeX gurus might add some special LaTeX formatting or commands
   requiring ERT spead at different places (e.g. a closing } somewhere
   after som non-ERT text. Doing this in a LaTeX-adapted text editor
   (with syntax highlight, auto indent and blinking of matching
   brackets) might facilitate this task.
   
   Opening the latex-source view while inserting ERT is an
   approximation to this experience of "best of two worlds".
   
Advanced editing:

   * Search and replace in LyX objects (boxes), 
 e.g. math, labels, box type, or filenames of included graphics.
 
   * Search and replace with regular expressions.
  
   Currently I work on the *.lyx source for this purposes. 
   
   Editing the latex source has some advantages:
   
  * LaTeX source format is documented, LyX source format not.
  * LaTeX source is (IMO) better readable (designed for work on the
source, while the LyX format is not meant to be seen
directly by the user)
  * The LaTeX format is better known so the "only change this if
you know what you are doing" threshold is lower.

   However, there are disadvantages:
   
  * Conversion from lyx to tex and back again takes time
  * and is not always stable nor sure to be loss-less (I acknowledge 
the vast improvements since the times of reLyX).

Thanks
  
Günter   


Re: Edit complete source?

2007-12-08 Thread Paul A. Rubin

Jean-Marc Lasgouttes wrote:

Richard Heck <[EMAIL PROTECTED]> writes:


bigblop wrote:

But that does not work in the  "LaTeX source" area. Only in the LyX editor.
  

Yes, that's right. What people call "round-trip" source view doesn't
yet exist, though many people would like to see it. It's possible
it'll be implemented before too long, but there are non-trivial
obstacles to be overcome before then. In a way, all the pieces exist:
We can import LaTeX using tex2lyx. But the problem is that, at the
moment, tex2lyx isn't really integrated into LyX; it's a standalone
utility. And even if it were integrated into LyX, tex2lyx isn't always
terribly reliable. Those, as I understand things, are the main issues.


The main issue as I see it is that some people have the hope that writing
raw latex will allow them to get almost native support for things that
LyX does not support yet. If one does not like the kind of code that
LyX outputs, I do not see how it could be possible to modify it and
hop that LyX will stick to this new form of writing.

I'd like to hear about reasonable use cases.



One possible example:  I had a document in which I wanted an equation 
array with non-default column alignments.  I could not find any way to 
do this in LyX (which might just mean I missed something obvious -- but 
I posted the question here and got no responses).  So I exported a LaTeX 
file and edited it outside LyX.  That's fine, but suppose that I want to 
modify the document (in LyX) in the future while retaining that change. 
 I don't need LyX to display the equation array with the tweaked 
alignment, but I do want to be able to use LyX's math editing features 
on it (meaning that I do not want to convert it to ERT), and I'm not 
sure whether importing the LaTeX file will preserve the change and still 
produce a math inset v. ERT (I have not tried this).


This is probably not exactly what the original requester had in mind, 
but it might be an application of a round-trip edit feature.


/Paul



Re: Edit complete source?

2007-12-07 Thread Bo Peng
> I'd like to hear about reasonable use cases.

It would be nice to have this dual-editing feature but I frankly do
not see any usefulness of it. Lyx' output is better than latex, but
not really WYSIWYG. If something can not be done in lyx and has to be
entered by ERT, the source editing mode will not help.

If people would like to have WYSIWYG, please try Bakoma, it allows you
to edit latex source code, and its DVI output. It is great for small
articles, especially for presentations. The biggest problem is that
you will have to input plain latex code most of the time.

Bo


Re: Edit complete source?

2007-12-07 Thread Jean-Marc Lasgouttes
Richard Heck <[EMAIL PROTECTED]> writes:

> bigblop wrote:
>> But that does not work in the  "LaTeX source" area. Only in the LyX editor.
>>   
> Yes, that's right. What people call "round-trip" source view doesn't
> yet exist, though many people would like to see it. It's possible
> it'll be implemented before too long, but there are non-trivial
> obstacles to be overcome before then. In a way, all the pieces exist:
> We can import LaTeX using tex2lyx. But the problem is that, at the
> moment, tex2lyx isn't really integrated into LyX; it's a standalone
> utility. And even if it were integrated into LyX, tex2lyx isn't always
> terribly reliable. Those, as I understand things, are the main issues.

The main issue as I see it is that some people have the hope that writing
raw latex will allow them to get almost native support for things that
LyX does not support yet. If one does not like the kind of code that
LyX outputs, I do not see how it could be possible to modify it and
hop that LyX will stick to this new form of writing.

I'd like to hear about reasonable use cases.

JMarc 


Re: Edit complete source?

2007-12-07 Thread Richard Heck

bigblop wrote:

But that does not work in the  "LaTeX source" area. Only in the LyX editor.
  
Yes, that's right. What people call "round-trip" source view doesn't yet 
exist, though many people would like to see it. It's possible it'll be 
implemented before too long, but there are non-trivial obstacles to be 
overcome before then. In a way, all the pieces exist: We can import 
LaTeX using tex2lyx. But the problem is that, at the moment, tex2lyx 
isn't really integrated into LyX; it's a standalone utility. And even if 
it were integrated into LyX, tex2lyx isn't always terribly reliable. 
Those, as I understand things, are the main issues.


Richard




Helge Hafting wrote:
  

bigblop wrote:


I have choosen to view the complete source, but is there someway to edit
in
the source directly? Currently is  a read-only preview.
  
  

Click the TeX icon and you can write any latex code you want.
Note that the source view isn't really "source", what you see
is the latex code LyX will export if you print.

Helge Hafting





  




Re: Edit complete source?

2007-12-07 Thread bigblop

But that does not work in the  "LaTeX source" area. Only in the LyX editor.



Helge Hafting wrote:
> 
> bigblop wrote:
>> I have choosen to view the complete source, but is there someway to edit
>> in
>> the source directly? Currently is  a read-only preview.
>>   
> Click the TeX icon and you can write any latex code you want.
> Note that the source view isn't really "source", what you see
> is the latex code LyX will export if you print.
> 
> Helge Hafting
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Edit-complete-source--tf4952441.html#a14210822
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: Edit complete source?

2007-12-07 Thread Helge Hafting

bigblop wrote:

I have choosen to view the complete source, but is there someway to edit in
the source directly? Currently is  a read-only preview.
  

Click the TeX icon and you can write any latex code you want.
Note that the source view isn't really "source", what you see
is the latex code LyX will export if you print.

Helge Hafting


Re: Edit complete source?

2007-12-05 Thread David Hewitt


bigblop wrote:
> 
> I have chosen to view the complete source, but is there someway to edit in
> the source directly? Currently is a read-only preview.
> 

According to the developers, this is one of the most requested features of
LyX, but it's tough to implement. The query arises often on this list.

Check out a very recent thread here:
http://www.nabble.com/Live-Latex-Editing-tf4867351.html

You can always export the plain LaTeX and edit that in your favorite text
editor, then run LaTeX to generate the final product.

You can set up a specific editor as the Viewer for the plain LaTeX as well,
which might save a step or two (but does not allow code editing within LyX
per se).


-
David Hewitt
Virginia Institute of Marine Science
http://www.vims.edu/fish/students/dhewitt/
-- 
View this message in context: 
http://www.nabble.com/Edit-complete-source--tf4952441.html#a14181373
Sent from the LyX - Users mailing list archive at Nabble.com.



Edit complete source?

2007-12-05 Thread bigblop

I have choosen to view the complete source, but is there someway to edit in
the source directly? Currently is  a read-only preview.
-- 
View this message in context: 
http://www.nabble.com/Edit-complete-source--tf4952441.html#a14181160
Sent from the LyX - Users mailing list archive at Nabble.com.