views:

5096

answers:

24
+23  Q: 

Real Time LaTeX?

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?

+8  A: 

To 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.

Peter Miehle
Most peer reviewed journals supply a tex template for submissions to restructure their layout, so you can submit a printworthy pdf in exactly their book format.
Karl
Other accept LaTeX tarbals as input and auto-process them. You get back the "proofs" in as little as an hour!
dmckee
Printing is a craft, and nobody wants to show it's secrets. And if you look at Adison-Wesley books for example, they look nice and have a common feeling over a wide range of books. The numbers (distances, spaces, font sizes) behind this appearance is one of the trade secrets of their success.
Peter Miehle
I think that those railing against WYSIWYG are missing the point. See my answer below.
dreeves
+3  A: 

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.

Stefan Mai
+7  A: 

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

André
If I understand correctly it only works for formulas. not the entire document.
shoosh
Nope that's just an example IIRC it works for everything.
André
In my current setup, it shows formulas, tables, and titles in emacs. When I move the cursor on such an item, I can switch to editing it so that the source is shown, and back.
Svante
+4  A: 

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 ;)

Nick
+1  A: 

BaKoMa is not 'free', and it is Windows only, but it is the closest I ever encountered as being a WYSIWYG LaTeX editor.

Personally I prefer the WYSIWYM method of LyX over the WYSIWYG method of BaKoMa...

Why did you not just Google for it?

Tader
+17  A: 
ShreevatsaR
I disagree with your last paragraph. See my answer below.
dreeves
+3  A: 

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.

godbyk
I upvoted this (thanks for the link!) but TeXworks does not really do real-time previewing, any more than TeXShop does -- you still have to hit "Typeset" every few minutes yourself. That's why I mentioned the trick about having a script that compiles automatically frequently.
ShreevatsaR
+3  A: 

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.

Stephan Eggermont
Thanks, I happened to check out Textures (well its website) and I see what you mean.
ShreevatsaR
A: 

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.

Stephen C. Steel
+2  A: 

It seems that latex users have learned to live with the limitation of latex. If you do complicated math or draw a picture with tikz, you will wish the realtime update stronly.

Next time ask a real mathemetician about tex and what he/she want to be improved.

A: 

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.

DaG
+2  A: 

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!".

Darius Bacon
Do you have a citation? I've seen too much garbage misattributed to Knuth in Stackoverflow answers :p[And Knuth *certainly* wouldn't be using LaTeX.]
ShreevatsaR
No. I've read several interviews; the most recent was a series in CACM this past year, but I don't think that was it. (Though it might have been.) I'm sure of the general picture, though as I said the details are unlikely to all be right.
Darius Bacon
+8  A: 

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.

Chris Duncombe Rae
+3  A: 

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)

Suppressingfire
+18  A: 

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.

dreeves
Ah, I think you added this comment as I was extending my answer. Do you think my answer now addresses this point?
dreeves
Yes :) I've removed the comment since it's now pointless. Thanks :)
Mihai Limbășan
I actually agree with you (note that nowhere did I use "WYSIWYG"), so +1. I still think that having the preview always visible can be distracting, and encourage bad habits, but I certainly agree with you that latexmk is nice and -pvc is useful.
ShreevatsaR
Cool, thanks Shreevatsa. I think we've reached rough consensus. When this question was first posted a lot of people jumped down the asker's throat, accusing them of not appreciating LaTeX's elegant separation of form and content. It seems that most everyone's now on the same page about that. Realtime compiling of the LaTeX source is at worst distracting (though personally I like it). It's not any kind of violation of the principles of LaTeX.
dreeves
+1  A: 

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

nes1983
+12  A: 

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.

nikow
+1  A: 

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.

A: 

look at texpad on http://new.math.uiuc.edu/math198/latex.html

adk
+1  A: 

Just use Emacs for Windows + latex-preview (auctex). It works for me :)

najmi
+1  A: 

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.

Sorush Rabiee
+3  A: 

Gummi is exactly what you need.

apjena
+3  A: 

Gummi is better than BaKoMa Tex. It is a free, open source, program written in python, featuring a live preview pane.

http://gummi.midnightcoding.org/

e4

D W
Not sure why you're being downvoted. I've used Gummi, it's great for small documents.
Andrioid
A: 

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!

This post is more suited to a comment rather than an answer.
D W
It really depends on the extent to which you're obsessed.
It actually depends on convention for the sake of usability.
Chetan