0

This question is a variation of this.

In my case, the command has an argument. For example, suppose I processing sample.tex with texlive, to generate a dvi, ps and pdf respectively. The commands will be

latex sample.tex
bibtex sample.aux
latex samlpe.tex
dvips sample.dvi
ps2pdf sample.ps 

Can I merge them together to a script file so that whenever I enter

makepdf sample.tex

all the above commands are executed sequentially, so that I get a pdf.

2 Answers 2

1

This file is makepdf.bat:

@echo off
latex %1
bibtex %~N1.aux
latex %1
dvips %~N1.dvi
ps2pdf %~N1.ps 

Execute it as you said before:

makepdf sample.tex
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, but this is not working. When I use the set of commands, it the terminal says 'entering extended mode' and freezes there. But it works fine if I just replace the arguments with actual file names. Can you point me to some reference which explains the arguments?
0

This is the same as aacini's code but it also supports long filename elements.

@echo off
latex  "%~1"
bibtex "%~n1.aux"
latex  "%~1"
dvips  "%~n1.dvi"
ps2pdf "%~n1.ps"

If any of the commands are batch files then add a call keyword before the command name.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.