3

Page 8 of the unofficial latex2e manual says

One way to do that is to put \pdfpagewidth=\paperwidth and \pdfpageheight=\paperheight in your document’s preamble.

However, I get

! Undefined control sequence.
l.8 \pdfpagewidth
               =\paperwidth
?

! LaTeX Error: Missing \begin{document}

! Undefined control sequence. l.9 \pdfpageheight =\paperheight ?

when I run

\documentclass{article}
\usepackage{fontspec}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{upquote}

%per latex2e p. 8 One way to do that is to put \pdfpagewidth=\paperwidth and \pdfpageheight=\paperheight in your document’s preamble. \pdfpagewidth=\paperwidth \pdfpageheight=\paperheight

\begin{document} \lstset{language=Rexx, extendedchars=true, frame=trbl, escapechar={!}, linewidth=20em}

\section{Statement of problem}

\subsection{Secondary Problem}

Using upquote listings with language=Rexx, extendedchars=true, frame=trbl, escapechar={!}, width=20em

\begin{lstlisting} foo = 'Ren!'{e}!' baz = Ren!\'{e}! parse upper var foo bar \end{lstlisting}

\end{document}

To clarify, when I use B4 paper I get massive left and right margins, with the text formatted in what looks to be an 8.5"x11" box. Is there an engine independent way to set the PDF geometry from the paper size?

Also, how do I report this in order to get engine dependency added to page 8?

shmuel
  • 1,449

2 Answers2

9

In luatex the names of the commands are \pageheight and \pagewidth.

Typically the best is to load a package like geometry or graphics which will set the PDF mediabox automatically to the values of \paperheight and \paperwidth.

Ulrike Fischer
  • 327,261
5

See this answer by David Carlisle. From there we can see that \pdfpageheight is supported by pdftex and xetex but not luatex. So you can't use luatex as the compiling engine in this case.

Stephen
  • 3,826