Can LyX be used as an IDE for LaTeX? I am considering using LyX instead of Emacs to write my LaTeX papers. Emacs is powerful editor/IDE which helps me be more productive while writing LaTeX. LyX looks like more than an IDE, because it uses its own file format. Is LyX is a good option if the end result must be a LaTeX code?
2 Answers
No, LyX should not be considered as an IDE for LaTeX, even though it uses LaTeX as backend.
The point here is that while every LyX document can be exported to LaTeX, not every LaTeX document can be imported into LyX (even though simple stuff works pretty well). This means, if collaborating on a paper, all or no authors have to use LyX.
I personally use and prefer LyX for writing papers and larger documents, but fall back to plain LaTeX if one of my collaborators does not want to use LyX.
Here is a more detailed answer...
Is LyX an IDE for LaTeX?
"IDE" stands for Integrated Development Environment. That is a software application which is usually used for writing and developing new programs in a certain programming language. An IDE integrates several components into one big entity. The basic requirements are to provide:
- a source code editor for a specific programming language;
- a configurable mechanism to build the output (e.g., an executable program) from the source code automatically;
Here the programming language corresponds to a language for typesetting documents: LaTeX.
- In LyX one cannot edit LaTeX code at an arbitrary position, see LyX FAQ. LyX generates a few different output formats (LaTeX, HTML, OpenDocument) from a LyX document. Thus, it is not a LaTeX editor.
- LyX automatically generates the output (e.g., a PDF file) also including bibliography, indices, etc. It is possible to influence this process. Thus, LyX satisfies the second requirement.
Overall, LyX cannot be considered as an IDE for LaTeX, although it acts in parts similarly to an IDE.
Is LyX a good option if the end result must be LaTeX code?
This picture shows a LaTeX document, its LyX equivalent, and the final PDF. LyX comes close to the PDF!
Features of LyX: LyX has a reasonably good support of LaTeX from classes ("article", "book", "letter") to commands (\textbf{...}
, \medskip
, \ref{...}
) and environments ("itemize", "minipage"). Furthermore, LyX has a good table editor, with which one can rapidly create, edit, format tables - no knowledge of the tabular
or longtable
environments is needed. For math formulas, typing the LaTeX code directly or using a graphical math editor are possible. Formulas can be displayed either similar to the print-out or exactly using instant preview. Furthermore, re-structuring a document is easy: changing the nesting levels, and re-ordering paragraphs, subsections, sections, items of lists can be done with just a few key strokes (no copying and pasting needed).
Not possible in LyX: As mentioned LyX does not offer to edit the LaTeX code at an arbitrary position! Though injection of TeX code at some points is possible. Hence, one somehow depends on the options that are supplied by LyX and its loadable modules.
A general recommendation: If you have some time, learn the basics of LaTeX before learning LyX. That is, how to write and compile a simple document with some figures and tables, e.g., see first LaTeX doc or Best Way to Start Using LaTeX or Best Book to Start Learning LaTeX. Then you will get a glimpse of what LyX does behind the scenes, and you can turn to LyX. (Note that LyX - generating LaTeX - is quite different from other document processors like Microsoft Word or LibreOffice Writer.)
In my opinion,
- LyX can be a good option in terms of productivity and time (by visually editing tables, formulas, etc.).
- Not all used LaTeX packages might be supported but support can be added. Nevertheless, if too many of them are missing or one wants to do heavy LaTeX customizations then it might be better to start off with a LaTeX document directly.
- Finally, if you started writing a LyX document and later need many LaTeX customizations, you can still switch from LyX to LaTeX by exporting the document and continuing writing in LaTeX. The other way around, start a LaTeX document and importing it to LyX might not be so seamless yet.
-
1+1 As long as we get more friends into latex'ing, Lyx is a very good tool for non-programmers and lowers the barrier. over time change though to emacs and vi category. Apr 16, 2013 at 17:25
-
8@texenthusiast: I have the exact opposite opinion, and sense that e-birk is hinting at the same stand as well. I first became comfortable with LaTeX, and then wholeheartedly switched to LyX. Why? In the middle of writing a complicated mathematical proof, the last thing I want to be bothered by is writing LaTeX markup. Sure, it gets simpler over time, but never to the point of being cognitively undemanding. Also, when I re-read the paragraph I just wrote, I want to read what I wrote, not markup. And I'm someone who's not too shabby at writing code myself. But I'm the oddball even in my own lab. Jun 18, 2014 at 23:38
-
-
@AFeldman I'm interested to hear more about why you think "cognitive demands" are a good thing. I have the same feeling myself, but have been unable to coherently express why.– ThevOct 7, 2018 at 19:45
-
1@AFeldman Well put! I was thinking about the "cognitive demands" of LaTeX after seeing this new font - Sans Forgetica - which is built on the concept of 'desirable difficulty'. Was wondering whether I should open a question on this site about whether people consider LaTeX to be desirably difficult.– ThevOct 19, 2018 at 10:31
.lyx
is the complete document..lyx
is a complete document, and LyX is indeed not a LaTeX IDE. The conclusion is correct.