- - - By CrazyStat - - -

27. March 2014

TeXworks: Compiling your main.tex from an included part

Filed under: Uncategorized — Tags: , — Christopher Kramer @ 18:31

In case you have split your LaTeX document (let’s say main.tex) into multiple parts (let’s say part01.tex, …) and use include or input to stick it back together, you cannot compile part01.tex because it misses all the header stuff. So you need to compile main.tex. But is there a way in TeXworks to compile it using the Play-Button or CTRL+T?

Yes, there is. Add this line at the top of part01.tex etc:

% !TEX root = main.tex

Then just compile your files normally. It will compile main.tex, show the main.pdf in the preview and you can even navigate nicely using the context menu from pdf to tex and back.


Try my Open Source PHP visitor analytics script CrazyStat.

12. June 2012

LaTeX: multiline comments

Filed under: Uncategorized — Tags: , , , — Christopher Kramer @ 23:26

You often want to out-comment some stuff while writing a LaTeX document very quickly, and LaTeX does only offer single-line comments out of the box:

% This is a comment
% This is the next line

Of course this can get a lot of work if you do this manually for a lot of lines. There might be editors that ease this, but I just found a very easy way to achieve multiline-comments using the verbatim package:


You can now just have multiline comments like this:

This is a comment
This is the next line

Very easy. I knew there had to be a package for that. I was just too lazy to search for it up to now.