configure latexmk in Texworks 0.2.3

Go to Edit->Preferences->Typesetting to add Processing tools. Use latexmk under Program and ensure that you have perl installed. Then go to Arguments for further configuration.

If you want to compile via pdflatex, use

-e
$pdflatex='pdflatex -synctex=1 %S'
-pdf
$fullname

If you want to compile via latex+dvipdfm, use

-e
$latex='latex -synctex=1 %S'
-e
$dvipdf='dvipdfm %S'
-pdfdvi
$fullname

If you want to compile via latex+dvips+ps2pdf, use

-e
$latex='latex -synctex=1 %S'
-e
$dvips='dvips -P pdf -t a4 %S'
-pdfps
$fullname

Check the box View PDF after running.

The -synctex=1 flag enables synctex, the ability to jump between source code and output with a right click.

The -P pdf option ensures you get a quality pdf output when using dvips, while the -t a4 option takes care of papersize, which may be changed to -t letter as appropriate.

For all configuration options, refer to the latexmk manual.


You can find all information here: https://github.com/TeXworks/texworks/wiki/AdvancedTypesettingTools


On my machine with texworks (version 0.5 r.952 (Debian)), latexmk version 4.31, and pdflatex from texlive 2011, the above mentioned solution(s) does not work. But the following works.

-pdf 
-pdflatex=pdflatex 
-interaction=nonstopmode 
-synctex=1  
$fullname