Compiling a LaTeX document manually

I've created LaTeX documents before using 'nice IDEs' such as TeXnicCenter and have a little experience in general with TeX, however, now I'm wondering about creating one "manually". By that, I mean doing something such as writing the tex document in a very simple editor (such as VIM) and then compiling it myself with pdflatex via the command prompt. Has anyone ever done this and if so, I really just need to know how I'd go about it? What's the process to doing it? While the IDE is nice, I'd really like to be able to create LaTeX documents 'on my own'. Thanks for any information you can provide!

90.2k 26 26 gold badges 256 256 silver badges 291 291 bronze badges asked Apr 28, 2011 at 18:14 283 1 1 gold badge 2 2 silver badges 5 5 bronze badges

Err . just go ahead and do it! This is how I've always created my LaTeX documents (except that I use Emacs, not vim). I don't even know what "IDE" stands for.

Commented Apr 28, 2011 at 18:19 I can't tell if you're being facetious or not, but if not IDE == Integrated Development Environment. Commented Apr 28, 2011 at 18:22

"in a very simple editor (such as VIM)". VIM is one of the most complex editors in existence. I assume you mean "simple" as "without a fancy graphical interface", which is true for VIM. Also, I never knew that TeXnicCenter can create LaTeX documents "automatically".

Commented Apr 28, 2011 at 18:42

Well, in reality, probably not the command line, but something like Cygwin. And Yes, I'm on Windows. By TeXnicCenter automatically creating documents, I mean I just have to type the 'code', then push a button and somehow I have a pdf document -- all the work is done for me to get from code to pdf. I just wonder how (and what I'd need) to do it myself with commands starting with just the tex document.

Commented Apr 28, 2011 at 18:51

You would need a functioning TeX distribution like MiKTeX. Then you just go to command prompt and write pdflatex yourdocument.tex , or yourtexengine yourdocument.tex .

Commented Apr 28, 2011 at 20:41

4 Answers 4

Your question is a little confusing. What you mean is compiling a LaTeX document manually (into a PDF). You might want to adjust your title. Creating one would be the process of writing the document. This can be done in the command line using pdflatex . In VIM you could just use ESC :!pdflatex % ( % can be used instead of the current filename) when you edit the main file. There is also the LaTeX Suite for VIM which gives you short cuts for the compilation and a lot of IDE functionality. The LaTeX compiler must be in your PATH for this to work, but this should be already the case for a proper installed LaTeX.

The latexmk script (also called with the filename) will compile the LaTeX document as often as required and also run external tools like bibtex and makeindex , which is basically the things the IDE is doing automatically when you press the compile button.

answered Apr 28, 2011 at 18:58 Martin Scharrer Martin Scharrer 265k 66 66 gold badges 779 779 silver badges 941 941 bronze badges

Oh come on, you don't have to tear his question to pieces like this. His last comment clarifies his post perfectly well. He has so far used a program that created the pdf with the press of a button, and now wants to know if there's anything he needs to know about producing (La)TeX output so by entering commands into some interface. There's really no reason to ridicule some minorly suboptimal wording in this manner.

Commented Apr 28, 2011 at 20:08

See, your edit about latexmk is something someone coming from TeXnicCenter wouldn't know, for example. That's the kind of thing he was asking for. I think a GUI made him feel like he's "triggering a whole bunch of complex commands" (I'm exaggerating), and I'm sure he's right in the respect that there's certainly a lot to learn what can be done instead of "clicking that button", just like latexmk .

Commented Apr 28, 2011 at 20:34 @doncherry: I rewrote the answer to be more useful. Commented Apr 28, 2011 at 20:38

Here is a basic tutorial for a Unix-like system (tested on Debian GNU/Linux). Yes, one can use latexmk , arara , shell scripts, or editor functions to automate much of this, but I wanted to demonstrate the simplest way to write and compile a LaTeX file "by hand" in the terminal.