# Edit LaTeX source in LyX

I recently installed LyX 2.0.1 (2011-08-31). I have the option to display the LaTeX source. I have tried to modify this source (in the LyX tab) in order to get some changes in the LyX file and the pdf output but I couldn't. I want to modify the LaTeX source directly in LyX because sometimes LyX doesn't align the tables as I want or the spaces between the lines or even the list are not in the format I want. How can I do that?

-

## migrated from stackoverflow.comOct 7 '11 at 14:13

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Marco Daniel Oct 7 '11 at 14:17
Where is the question? –  Marco Daniel Oct 7 '11 at 14:19
@Marco: I think/hope my edit reflects what armando wants to know. –  doncherry Oct 7 '11 at 16:23
@armando: Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. I hope you don't mind me adding a "How can I do that?" at the end of your question. –  doncherry Oct 7 '11 at 16:25

## 2 Answers

If you want to edit the LaTeX source, then LyX is the wrong tool. Use one of the LaTeX editors, e.g. TeXworks, TeXmaker, aso. LyX can only edit it's own file format which of course can have some part of LaTeX code, called ERT (Evil Red Text), but that is also part of the LyX file.

-

You can use CTRL + L to insert latex code anywhere. That is especially useful for mathematical equations, where auto-completion works. For example, you don't have to type \alpha, you type \a, and see many suggestions for auto-complete. To delete anything, you can uses Lyx main window.

It works neat with math, but it probably does not much sense to use it for text editing. Because for usual text you will see chunks of latex code, not WYSIWYG.

-
Welcome to TeX.SX! This is rather a comment than an answer to the question –  Christian Hupfer Jan 6 at 10:25
Answers should not only contain pointers to figure out the solution by oneself, but should give as much of a solution as possible (partial answers are ok if the problem is hard, but then the answer should show why this is hard). Please improve your answer by giving an example (e.g., using screenshots) that shows exactly how the source code can be modified directly. –  cryingshadow Jan 6 at 10:47