I am using using XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/W32TeX) to design a book cover. I thought of writing a generic document with customizable sizes of book width, height, bleed and spine that I can use for books of other sizes also. I am using the calc package to compute the final widths and heights including the spine and/or bleed.

I cannot get crop to work with dynamic width and length. Below is an MWE.

\setlength{\bookwidth}{138mm}   % metric demy 8vo
\setlength{\bookheight}{216mm}  % metric demy 8vo
\setlength{\bookspine}{8mm}     % spine based on number of pages 
\setlength{\bookbleed}{3mm}     % bleed as suggested by printing press
\setlength{\ltwidth}{\bookwidth*\real{2.0} + \bookspine}
\setlength{\cvrwidth}{\bookwidth*\real{2.0} + \bookspine + \bookbleed*\real{2.0}}
\setlength{\cvrheight}{\bookheight + \bookbleed*\real{2.0}}
%Does not compile with the following
%The following works though
\noindent Book cover content here.\\

1 Answer 1


LaTeX expects that package options are simple strings or something, that expands to simple strings. A length register cannot be expanded and will break, for example, when LaTeX tries to find out, if the option is defined. A length register can be expanded by prefixing it with \the:

\usepackage[..., width=\the\cvrwidth, height=\the\cvrheight, ...]{crop}
  • Thanks, that works. Wondering why geometry package option works without expanding the register? \usepackage[...,paperwidth=\ltwidth,paperheight=\bookheight]{geometry}
    – user22209
    Jun 4, 2015 at 2:42
  • Package geometry defines and uses a different option handler for proper support of key value options. Package crop implements the key value parsing inside \DeclareOption*, when LaTeX passes the unrecognized options to the package. Jun 4, 2015 at 3:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .