1

I'm trying to write a package, which can supports various Trim sizes through option in TeX application file, and my tags are follows:

Definition in my .sty file

\newif\ifsixbynine  
\newif\ifsevenbynine
\newif\ifeightbynine

\NeedsTeXFormat{LaTeX2e}

\usepackage[a4,center,cam,info]{crop}

\usepackage{lipsum}

\ifsixbynine \setlength{\paperheight}{9truein}% \setlength{\paperwidth}{6truein}% \fi

\ifsevenbynine \setlength{\paperheight}{9truein}% \setlength{\paperwidth}{7truein}% \fi

\ifeightbynine \setlength{\paperheight}{9truein}% \setlength{\paperwidth}{8truein}% \fi

\addtolength\topmargin{-1in}

\setlength\textwidth{26pc}

\setlength\textheight{39pc}

\setlength\oddsidemargin{5pc} \addtolength\oddsidemargin{-1in} % subtract out the 1 inch driver margin \setlength@tempdima{\paperwidth} \addtolength@tempdima{-\textwidth} \addtolength@tempdima{-5pc} \setlength\evensidemargin{@tempdima} \addtolength\evensidemargin{-1in}

\DeclareOption{6x9}{\global\sixbyninetrue} \DeclareOption{7x9}{\global\sevenbyninetrue} \DeclareOption{8x9}{\global\eightbyninetrue}

\ProcessOptions

\endinput

Content of my .tex file

\documentclass{book}
\usepackage[6x9]{test}

\begin{document}

\lipsum[1-9]

\end{document}

But the output doesn't come what I expected. Can you help me what I did wrong in my definitions...

MadyYuvi
  • 13,693

1 Answers1

0

The problem is that you are declaring your options and calling the \ProcessOptions macro at the end of the package file. Depending on the provided options, this macro sets the appropriate flags (\sixbynine and others), so it needs to be called before the flags are used.