Discussion:
Getting value while compilation
2017-04-09 14:52:08 UTC
Raw Message
Hi All,

I need to fix the trim size as 6in x 9 in, some times it may vary, is it possible to fix LaTeX ask the trim size while doing compilation, e.g., if we compile a TeX file (I'm using MikTeX ver 2.9) either in LaTeX or PDFLaTeX, it will ask the Trim size each time compilation... is it possible to fix?

Peter Flynn
2017-04-18 20:28:47 UTC
Raw Message
I need to fix the trim size as 6in x 9 in, some times it may vary,
is it possible to fix LaTeX ask the trim size while doing
compilation, e.g., if we compile a TeX file (I'm using MikTeX ver
2.9) either in LaTeX or PDFLaTeX, it will ask the Trim size each time
compilation... is it possible to fix?
I don't think this is possible. Maybe some combination of geometry and
crop packages, with the \newgeometry command might work.

///Peter
jon
2017-04-22 02:32:47 UTC
Raw Message
Hi All,
I need to fix the trim size as 6in x 9 in, some times it may vary, is it possible to fix LaTeX ask the trim size while doing compilation, e.g., if we compile a TeX file (I'm using MikTeX ver 2.9) either in LaTeX or PDFLaTeX, it will ask the Trim size each time compilation... is it possible to fix?
why would having latex ask the question help? if you're going to pass the
dimensions anyway, just define them at the outset. e.g.:

pdflatex "\def\margindim{2in}\input{mainfile}"

where mainfile.tex looks (something) like this:

\documentclass{article}
\providecommand*{\margindim}{1in}
\usepackage[margin=\margindim]{geometry}
\usepackage{showframe,lipsum}

\begin{document}
\lipsum[1]
\end{document}

of course, you could write a shell script that queries for the size and
pass that to the pdflatex command....

cheers,
jon.