5

I'm trying to change the size of a single page in my document. Following this and this answer, I used \eject \pdfpagewidth=8.27in \pdfpageheight=15in, but the page number is not at the bottom, but at it's usual distance from top in a normal page as shown in the below figure. How can I make the page number go to the bottom?

Code snippet:

\documentclass{article}
\title{Summary of various Image and Video Quality Metrics on various Databases}
\author{Nagabhushan S N}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{float}
\usepackage{array, makecell}
\usepackage[paperheight=11.69in,paperwidth=8.27in,margin=1in,footskip=0.25in]{geometry}
\usepackage[pagebackref=true]{hyperref}
\hypersetup {
    colorlinks = true
}
\begin{document}

\eject \pdfpagewidth=8.27in \pdfpageheight=15in
\section{Blah blah blah}\label{sec:vqa}
More blah blah blah

\end{document}

Sample Image:

Sample image

PS: I'm using pdflatex.

  • 1
    \pdfpagewidth only adapts the "background paper". If you want to change the layout (textwidth/textheight etc), you should use the other answer which uses typearea. – Ulrike Fischer Feb 13 '20 at 08:20
  • 1
    But with typearea, I see that I can specify only standard page sizes. Can I specify arbitrary size? – Nagabhushan S N Feb 13 '20 at 08:21

1 Answers1

4

You can use a combination of packages typearea and geometry:

\documentclass{article}
\usepackage{lipsum}% only for dummy text

\usepackage[usegeometry,paper=11.69in:8.27in]{typearea}% load before geometry
\usepackage[margin=1in,footskip=0.25in]{geometry}

\newcommand\changepapersize[1]{%
  \cleardoublepage
  \KOMAoptions{paper=#1,DIV=last}%
  \newgeometry{margin=1in,footskip=0.5in}%
}
\AtBeginDocument{\storeareas\defaultareasettings}
\BeforeRestoreareas{\clearpage}

\usepackage[pagebackref=true]{hyperref}
\hypersetup {colorlinks = true}

\begin{document}
\section{Foo}
\lipsum

\changepapersize{15in:8.27in}
\section{Blah blah blah}\label{sec:vqa}
\lipsum[1-15]

\defaultareasettings
\section{Foo}
\lipsum
\end{document}

Result:

enter image description here

esdd
  • 85,675
  • This solution have a little problem with page number in rotated pages. But I follow this solution https://tex.stackexchange.com/a/250998/14423 – juanuni Jan 17 '21 at 03:50
  • @juanuni Which problem do you mean? – esdd Jan 17 '21 at 16:27
  • well, the problem ocurrs when the page is rotated, for example, with pdflscape. In that case the page number also is rotated. – juanuni Jan 17 '21 at 16:34
  • Do you want to switch to landscape for some pages inside the document? And the page number should be below the rotated text? – esdd Jan 17 '21 at 16:51
  • You are rigth. With pdflscape I couldn't do it. – juanuni Jan 17 '21 at 17:02
  • You could change the code above to: \usepackage[usegeometry,paper=a4]{geometry} or paper=letter or another paper format. Then use \changepapersize{landscape} in the document. – esdd Jan 17 '21 at 17:31
  • Yeah, but if is needed a custom paper size and switch to landscape ? – juanuni Jan 17 '21 at 17:40
  • You could use \changepapersize twice: \changepapersize{landscape}\changepapersize{15in:8.27in}. Or redefine \changepapersize to ...\KOMAoption{paper}{#1}\KOMAoption{DIV}{last}. Then #1 can be a list and you can use \changepapersize{landscape,15in:8.27in}. – esdd Jan 18 '21 at 10:05
  • How could I do it but with XeLaTeX – sayyidd25 Jul 08 '21 at 14:59