Paul A. Rubin wrote:
Roberto Gorjão wrote:
Hi all,

I would like to learn a bit more of LaTeX. I found surprising that we couldn't edit latex code directly on LyX at source view... Being used to web page visual editors, I was expecting that the source viewer would function like a "code mode" that we could choose as an alternative to the normal "design mode", as happens with dreamweaver, for instance. I know that we can edit LaTeX with the ERT command and at the preamble, but it isn't really the same as a "code mode".

As I'm already used to code web languages (HTML, CSS, JavaScript, PHP) using Eclipse I was happy to find about the TeXlipse plugin. But it seems far less complete than LEd or TeXnic. I would like to know what's your opinion about the best strategy and tools to learn and work directly on LaTeX while keep using LyX for text creation. Something like having dreamweavers' "design mode" and "code mode" at the same time.


This is really a question for the developers, but here's my uninformed opinion. Most of a LyX document is in what you might call an internal representation (what you see when you look at the .lyx file). LyX converts that to LaTeX when you view source.
Correct. You are not viewing the "source", but the "latex export" with this mode.

I think it would be fairly easy to allow you to edit LaTeX code that came from the preamble or ERT boxes (stuff you entered directly), but to do what you want would require that LyX be able to do a reverse conversion (from LaTeX back to LyX) on the fly. Furthermore, it would require considerable defensive coding to make sure that what you entered in the edit window, which might be perfectly valid LaTeX, did not screw up the LyX code upon reverse conversion. So this would IMHO be a huge effort for the developers.
LyX already has File->import->latex.
So there is effort, but not necessarily huge:
1. Cut from the lyx document whatever the user changed
2. Re-import the changed stuff. Now, if the user made a mistake,
   this part will result in a big ERT box being imported, and
   perhaps printing/viewing won't work until that is corrected.

This new import would have to handle stuff smaller than a whole document.

In order to collaborate today, consider file->export->latex in order to
send off a latex file, and file->import->latex in order to import a changed
latex file back into LyX.

Helge Hafting

Reply via email to