GeneralWindows batch file for compiling report

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
loji
Posts: 1
Joined: Sat Mar 03, 2012 12:20 pm

Windows batch file for compiling report

Post by loji »

I have created a Windows batch file to compile a report. The file is as follows:

Code: Select all

latex report
dvips report
ps2pdf report.ps report.pdf
pause
report.pdf is created correctly, but defaults to US letter paper. I would like a4 paper size, but don't know where and how to specify it so that report.pdf is on a4 paper.

I have tried the following but they dont work:
1. ps2pdf report.ps report.pdf -sPAPERSIZE=a4
2. set GS_OPTIONS=-sPAPERSIZE=a4 (before the ps2pdf command)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Windows batch file for compiling report

Post by Stefan Kottwitz »

Hi Loji,

welcome to the board!

Which are your paper settings in the document? It's important that you
  • Specify the paper size, as letter paper is the default in standard classes. Specify it as document class option such as

    Code: Select all

    \documentclass[a4paper]{report}
    or at least as option to a page layout package such as geometry.
  • Especially if you don't use pdfLaTeX but compile to DVI first, load a package which is capable of setting PDF sizes via DVI \special, such as geometry or hyperref.
Stefan
LaTeX.org admin
Post Reply