I'm looking for an application in which I can write pure LaTeX in one half of the screen and on the other half to see the compiled document in real time.
This seems really like an obvious way to do LaTeX authoring but it doesn't look like any software is able to do it.
LyX is not what I'm looking for. I want to edit the actual LaTeX and see it rendered in real time. Why isn't this already being done somewhere?
views:
5096answers:
24To answer your second question:
because it is not the way it is intended to be used. LaTeX is not (!) a WYSIWYG-system. It is a document layout system. So you write your text (in a low end teletype-terminal) with some minor layout-directives, and someone else (the tex-subsystem on a high-end maschine) is producing (compiling) the ready-to-print Paper.
So you take your focus only on your content, not on the appearance.
The idea behind this is, that you are not as skilled in the art (!) of printing (setting letters) like a professional printer (the person, not the machine), so all formatting you do may be wrong in the sense of professionalism. Tex is implemented with the knowledge of a professional printer in mind.
Because LaTeX for big(ish) documents takes at least a few milliseconds to compile. The best solution I've found (and what I'm using right now) is to use Kile and Quick Preview using (Alt-1) every few seconds. If you use evince or some similar DVI/PDF viewer, it will just update whatever page you're looking at, which allows me to make changes and see them almost instantly (almost real-time).
Lytha is absolutely right, but I've found it really difficult to learn the syntax of LaTeX without running the compiler a dozen times with all my (typically wrong) syntax to see the result.
Being a vim user, I never used it, but there is an extension for emacs that does something like that and it's called preview-latex.
HTH
LEd (http://www.latexeditor.org/) comes with split screen mode.
It's still not real time, but you can hit the compile key as often as you want ;)
TeXworks may be the solution you're looking for. It opens two windows: one is the text editor for entering your LaTeX code, the other is the PDF/DVI viewer that gets live updates. It can also use SyncTeX so that you can click in the PDF document and the text editor will jump to the code that generated that output you clicked on.
You can watch a video presentation of TeXworks from the TeXLive 2008 conference.
We had that on the mac before OS-X with Textures. It is of very limited use though. It is nice when experimenting with difficult formulas, but not when writing, as Shreevatsa already noticed.
The delay for compilation is not strictly necessary on modern machines, but that would need major surgery in the TeX engine.
You might want to take a look at TeXmacs, which is much more WYSIWYG.
In answer your second question, Why isn't this already being done somewhere? It has been done somewhere, quite some time ago. Check out Scientific Word, assuming you don't mind a commercial application. It may meet your needs, and they offer a 30 day trial version.
Note: I don't use this program myself, but I had heard seen it many years ago, and it does seem to meet your criteria.
As many of the other respondants have commented, it seems the majority of LaTeX users are happy enough without a real-time WYSIWYG editor.
About the "non-wysiwygness" of LaTeX, may I point out a previous question and some of its answers, which raise some interesting points.
In particular, the fact that a LaTeX file is a logical, not a physical, description of the document you are composing leads to several useful features, outlined in the above question/answers: use of comments, indenting as a way to keeps things cleaner and more readable and so on, in a spirit not different from what is done in other languages.
I read an interview of Knuth a few years ago where he mentioned this sort of thing as his way of working. My vague and probably inaccurate memory is he'd edit the raw TeX or maybe Latex code in Emacs, keeping another window open with a viewer that'd get updated by a script that noticed when the source file changed. (C-x C-s rather than after every keystroke -- but still done often.)
Obviously this isn't a real answer to your question, but it's something to consider for the haters saying "Don't do that!".
In reply to ShreevatsaR observation that LaTeX is not wysiwyg and that simultaneously considering presentation and content is pointless, sometimes presentation and content are not separable: try entering a multi-line \equation that takes up a quarter page in a research journal with a two-column format, or entering a data table. Sooner or later you are going to have to fix those typos and will need to refer repeatedly back and forth between the presentation and content to get it right. Another place is where you have a page or word count limit and you are trying to juggle meaning and document length. I think being able to see immediately the effects of your edits is extremely useful.
That being said, judicious use of a makefile, xdvi or gv, and your favorite editor (mine is vim) makes the need for a separate program to accomplish a wysiwyg effect for LaTeX superfluous, as has been pointed out.
I used to use whizzytex, a package for Emacs which uses advi to do the preview.
It has been in Debian and Ubuntu for quite a while now. It may not interact perfectly with all the LaTeX packages out there, but it does a good job of connecting your cursor in Emacs with the cursor in the preview pane.
It's true that this isn't a 100% WYSIWYG emacs editor, but it does provide real-time preview updates as you type, and the preview window is interactive. Just make sure that your LaTeX is always in a compilable state (YaTeX provides a set of macros the help maintain this property).
(I now just use emacs with YaTeX and the Evince pdf viewer which updates every time I save/compile)
I recommend latexmk which, with -pvc switch (for "preview continuously"), will recompile (as many times as necessary) whenever the source changes. If you have a pdf viewer that autorefreshes the pdf view (Skim on Mac OSX does this) then you can see a refreshed preview every time you hit save.
Using latexmk is nice even without the -pvc option since it automatically compiles (including bibtex) as many times as necessary.
Added: How to set up latexmk and Skim for near realtime LaTeX
Added: Here's something similar to latexmk, written in python: http://iml.univ-mrs.fr/~beffara/soft/rubber/. It doesn't seem to have anything like the "preview continuously" option, though that could be added with something like this: http://stackoverflow.com/questions/393176/monitor-a-set-of-files-for-changes
Note to those railing against WYSIWYG:
Realtime previewing (like StackOverflow does!) does not mean WYSIWYG. WYSIWYG means hiding the source from you so that what you are editing appears like the final output. Which, yes, for technical writing is a terrible idea. Seeing a realtime preview does not make LaTeX WYSIWYG -- you are still editing the plain text source. (Note that this is the way the StackOverflow editor works.)
I don't dispute that you should not typically worry about the preview. You could even argue against this feature on the grounds that it would encourage bad habits. I would actually argue the opposite -- seeing the choices TeX is making in realtime just reassures you that you can put the typesetting out of your mind and have faith in TeX.
In any case, there are plenty of times when you do need to care (like with messy equations, or in the final stages of editing when you're cleaning up bad line breaks and whatnot) and a truly realtime preview would save a lot of time.
Someone up there was wishing for a realtime tikz editor. I cannot add comments. It exists. It is called ktikz, I believe. I haven't used it yet, because there appears to be no windows version. niko
BaKoMa TeX is really the way to go. It is a complete real-time LaTeX system and does exactly what you requested. It does real incremental LaTeX compiling in the background, so it works with practically all LaTeX packages (e.g. those for complex diagrams). The LaTeX system itself is also one of the most powerful there is, I believe (e.g. it had early support for SVG).
It is unfortunate that it is not free and for Windows only, but I heard that it works with Wine under Linux too. For me paying the license fee is more than worth it. It is so superior to any other solution that I just can't imagine going back. The LaTeX comunity should be ashamed that a single russian physicist creates a better LaTeX system than all the rest of them together - so I feel the price is well justified.
Btw, I am not in any way connected to BaKoMa, just a very happy user.
Mostly nice answers. It was quite useful for myself. Just small comment about Kile and (Alt-1) (see above Stefan Mai). If I use (Alt-1) than later I have to use (Alt-Tab) to go back for editing. It is not really convenient. Better way is to put Kile on one half of screen (right|left) or (up|down). Put dvi viewer to another half of screen, then use (Alt-2). You will stay in Kile editor and dvi-viewer will be updated. It is real-time for me. Unfortunately it is useful only for Linux users. But I suppose something like this can be done in Windows with "Texmaker". P.S. Emacs is great for programming, LaTex and so on, but so difficult to learn.
Just use Emacs for Windows + latex-preview (auctex). It works for me :)
That is a bad expect. because it's against to one of principles of TeX Systems:
Visual attributes must not be mixed with logical structure
you are looking for a semi-WYSIWYG System, like most of popular HTML editors. the WYSIWYG and LaTeX words are like Hokey and Figure skating :-) LaTeX and all of TeX-based systems cannot and do not want to be WYSIWYG.
Gummi is better than BaKoMa Tex. It is a free, open source, program written in python, featuring a live preview pane.
Gummi is great but sadly the development seems pretty sparse. I'd like that to basically incorporate all the features of something like Kile (or even something like the gedit latex plugins), and it would be absolutely killer!