Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to configure TeXworks to run the following chains:

  1. latex with automatic dvi viewer opening
  2. latex+dvips with automatic ps viewer opening

Essentially, I want to learn how to configure TeXworks to create my own chains of commands possibly with a long list of executables that are usable and commands used within TeXworks. That is, what can go under Program and Arguments.

For example, from the post: http://tex.stackexchange.com/a/18938/10898 if I want to compile via latex+dvips+ps2pdf, I would need to use

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

with latexmk as the Program as shown below:

enter image description here

When I analyze the pdfLaTeX settings its much simple than the one shown above. Any clarifications on how to create these settings and explanation or tutorials to understand TeXworks at this level will be very helpful. Is latexmk the only Program which can be used? I have tried changing it to latex.exe or the sort but no good results.

share|improve this question
2  
Perhaps related/useful: arara does helps with this kind of thing –  cmhughes Dec 4 '12 at 1:19
    
@cmhughes I have read about arara but haven't implemented its use. –  azetina Dec 4 '12 at 1:20
    
Maybe, I understand you wrong, but perhaps my answer knitr with TeXworks helps a bit? –  Speravir Dec 4 '12 at 1:36
    
BTW from the help menu in TeXworks there is a link to “A short manual for TeXworks”. This ain’t helpful? –  Speravir Dec 4 '12 at 1:43
    
@Speravir Not quite. It contains only basic information about TeXworks and no specifications in creating processing tools. –  azetina Dec 4 '12 at 2:13

2 Answers 2

I would suggest that you create your own batch file doing exactly what you want. I'm not on windows now, but I believe it should look like this:

latex -synctex=1 "%1.%2" && dvips -P pdf -t a4 "%1.dvi" && ps2pdf "%1.ps"

(The && ensure that the next stages are not executed in the case of an error.) Save it under some unique name like myldpp.bat (MY Latex Dvi Ps Pdf) in the folder where TeXworks look for it, e.g. the ./bin/win32 of your texmf tree. Finally create a rule in TeXworks that calls myldpp.bat with two arguments $basename, $suffix.

The complete list of $... arguments to TeXworks:

$synctexoption   expands to "-synctex=1" if your tools support SyncTeX
$fullname        expands to the full name of your root document (e.g. rootfile.tex)
$basename        expands to the name (without ext.) of your root document (e.g. rootfile)
$suffix          expands to the extension of your root document (e.g. tex)
$directory       expands to the absolute path to the directory containing your root document

The webpage also suggest slight improvement of the .bat file that I incorporated to the answer now.

share|improve this answer
    
I have read a lot about the batch file. What I am also looking for is the specific inputting of the code names such as $fullname, $synctexoption, etc that TeXworks uses. I want to learn them so that I can create them within TeXworks. Is there a manual or paper that specifies these commands and how to create the processing tools within TeXworks? –  azetina Dec 4 '12 at 16:58
    
answer edited . –  tohecz Dec 4 '12 at 17:27
    
It would be good if someone can make a documentation about all of this. Like how to create the processing tools within TeXworks and as batch files later. –  azetina Dec 4 '12 at 23:15
3  
@azetina Two things are needed: (1) arara rule for TeXworks (2) good documentation of arara. I believe both of them exist. –  tohecz Dec 4 '12 at 23:20

Here are some useful information from David Arnold at redwood university. http://msenux.redwoods.edu/math/workshops/LatexWorkshop/ConfigureWindows.php

In the Texworks Preferences, Typesetting tab again, under Processing Tools, click the plus sign, then enter the following:

Name: latex=>dvips=>ps2pdf
Program: c:\miktex\miktex\bin\latex-dvips-ps2pdf.bat
Arguments: $basename

Check "View PDF after running". Click OK to finish.
Open Texworks and create a new file. Enter this line:

@latex -synctex=1 "%1.tex" && dvips "%1.dvi" && ps2pdf "%1.ps"

Save the file as c:\miktex\miktex\bin\latex-dvips-ps2pdf.bat.

share|improve this answer
1  
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Heiko Oberdiek Apr 30 at 1:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.