i have this makefile:


    latex $(FILE).tex
    dvips $(FILE).dvi
    ps2pdf $(FILE).ps

and i want to add parameter -sPAPERSIZE=a4 for latex, dvips and ps2pdf, how should i do it?

Thank you for your answer

  • 2
    Welcome! Why can't you just add it in? What's the problem? I'm not sure why you would want to add that in like that but, if you do, I don't see why you can't. I can see why you might want to add it for dvips and ps2pdf but does it make any sense to add it for latex? And given that, does it make sense to add it for the others either? – cfr Mar 26 '16 at 21:14
  • 1
    It will normally be better to set the page size in the .tex file. Otherwise you run the risk of TeX thinking the page dimensions are one thing and the external cropping doing something else. If you are concerned about TeX defaulting to letterpage when you want a4, you can use tlmgr to reconfigure the defaults. – jon Mar 26 '16 at 21:19
  • latex doesn't take a command line argument -sPAPERSIZE=a4. – Christian Lindig Mar 26 '16 at 21:50

This would work:

FILE=   name

    latex $(FILE).tex
    dvips $(SIZE) $(FILE).dvi
    ps2pdf $(SIZE) $(FILE).ps

However, this Makefile doesn't really use what Make is designed for. You could as well implement this in a shell script (or batch file). latex doesn't accept the -s flag.

  • I need this makefile for school project. And thank you very much, it works well. – Mr. Ghost Mar 26 '16 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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