I wrote the following LaTeX documents.
\documentclass[11pt]{book}
\newlength{\mywidth}
\newlength{\myheight}
\setlength{\mywidth}{85mm}
\setlength{\myheight}{112mm}
\newcommand{\setpagesize}[2]{%
\special{papersize=#1,#2}%
}
\setpagesize{\mywidth}{\myheight}
\begin{document}
The quick brown fox jumps over the lazy dog
\end{document}
I got following error messages from dvipdfmx
and failed.
$ latex abc.tex
$ dvipdfmx abc.dvi
abc.dvi -> abc.pdf
** WARNING ** Reading special command failed: "papersize=\mywidth ,\myheight "
[1
** WARNING ** Reading special command failed: "papersize=\mywidth ,\myheight "
]
4327 bytes written
When I use \def
in place of \newlength
and \setlength
, it worked.
\documentclass[11pt]{book}
\def\mywidth{85mm}
\def\myheight{112mm}
\newcommand{\setpagesize}[2]{%
\special{papersize=#1,#2}%
}
% ...
$ latex abc.tex
$ dvipdfmx abc.dvi
abc.dvi -> abc.pdf
[1]
4331 bytes written
Why?
dvipdfmx
. Perhaps try changing\setpagesize{\mywidth}{\myheight}
to\setpagesize{\the\mywidth}{\the\myheight}
?\the
is certainly needed.