1

I have a code like below but the fancyfoot doesn't follow the change of parameters which I altered randomly with the numbers -300 100pt and 200pt:

\documentclass[landscape,a4paper]{article} \usepackage{pdfpages} \usepackage{pgfmath} %\usepackage[margin=1cm,showframe]{geometry}% MWE only \pgfmathsetmacro{\scale}{(\paperheight-2cm)/(\paperwidth-3cm)}% 1cm margin \pgfmathsetlengthmacro{\delta}{\paperwidth-2cm-2*\scale*(\paperheight-3cm)-4 mm}% 4mm fudge factor \usepackage{pdfpages} \usepackage{fontspec} \newfontfamily\hebfont{Arial} \usepackage{pdfpages} \usepackage{fancyhdr} \fancypagestyle{importedpages}{% \fancyhf{}% Clear header/footer \renewcommand{\headrulewidth}{0pt}% Remove header rule \renewcommand{\footrulewidth}{0pt}% Remove footer rule (default) \fancyfoot[C]{\raisebox{-300\baselineskip}[100pt][200pt]{\thepage}}% Lower page number into position } \begin{document} \newcounter{Acount} \includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt, offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 2.5cm, pages=-, pagecommand={\thispagestyle{importedpages}} \stepcounter{Acount}% Roman: \roman{Acount}\ % Hebrew {\hebfont\char\numexpr"05CF+\value{Acount}\relax}, ]{RH9.pdf} % \includepdf[scale=1.02, nup=2x1,pages=1-8,trim=2.5cm 2.5cm 5.5cm 2.5cm]{sh1.pdf} \includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt, offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 2.5cm]{RH9.pdf} \includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt, offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 2.5cm]{RH9.pdf} \end{document} 
1
  • Can you provide more clarity in your question? For example, you ask "Why fancyfoot doesn't follow the change of parameters?" The change of what parameters exactly? And why do you "randomly" lower the footer by 300\baselineskip? Commented Aug 21 at 19:21

1 Answer 1

3

Using pdfpages to include external PDF files will change the style of the included pages, removing any custom headers and footers defined by fancyhdr. The \includepdf option of the pagecommand= can be used to reapply or change the page style.

(Default: pagecommand={\thispagestyle{empty}})

In the first example, the importedpages style (slightly modified to show the page number) is used on the first page, the Moreimportedpages style is used on the second page, and none is defined on the last page, where the style is reverted to plain.

a

\documentclass[landscape,a4paper]{article} \usepackage{pdfpages} \usepackage{pgfmath} %\usepackage[margin=1cm,showframe]{geometry}% MWE only \pgfmathsetmacro{\scale}{(\paperheight-2cm)/(\paperwidth-3cm)}% 1cm margin \pgfmathsetlengthmacro{\delta}{\paperwidth-2cm-2*\scale*(\paperheight-3cm)-4mm}% 4mm fudge factor %\usepackage{pdfpages} % <<<<<<<<<<<<<<<<< \usepackage{fontspec} \newfontfamily\hebfont{Arial} %\usepackage{pdfpages} % <<<<<<<<<<<<<<<<< \usepackage{fancyhdr} \fancypagestyle{importedpages}{% \fancyhf{}% Clear header/footer \renewcommand{\headrulewidth}{0pt}% Remove header rule \renewcommand{\footrulewidth}{0pt}% Remove footer rule (default) % \fancyfoot[C]{\raisebox{-\baselineskip}[100pt][200pt]{\thepage}}% Lower page number into position % changed for this MWE <<<<< } \fancypagestyle{Moreimportedpages}{%for this MWE <<<< \fancyhf{}% Clear header/footer \renewcommand{\headrulewidth}{3pt}% \renewcommand{\footrulewidth}{3pt}% \fancyfoot[C]{\color{red}\Huge\textbf{\thepage}}% } \begin{document} \newcounter{Acount} \includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt, offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 2.5cm, pagecommand={\thispagestyle{importedpages} \stepcounter{Acount}% Roman: \roman{Acount}\ % Hebrew {\hebfont\char\numexpr"05CF+\value{Acount}\relax}}, ]{example-image.pdf} \includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt, offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 2.5cm, pagecommand={\thispagestyle{Moreimportedpages} % added <<<<<<<<<<<<<<<<<<<<<<< \stepcounter{Acount}% Roman: \roman{Acount}\ % Hebrew {\hebfont\char\numexpr"05CF+\value{Acount}\relax}}, ]{example-image.pdf} \includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt, offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 2.5cm, pagecommand={ % added <<<<<<<<<<<<<<<<<<<<<<<<< \stepcounter{Acount}% Roman: \roman{Acount}\ % Hebrew {\hebfont\char\numexpr"05CF+\value{Acount}\relax}}, ]{example-image.pdf} \end{document} 

The second example will import the manual from the pdfpages package with two PDF pages per landscape page. The page numbers in Roman numerals and Hebrew are placed at the bottom center of each page.

d

e

% !TeX TS-program = xelatex \documentclass[landscape,a4paper]{article} \usepackage{pdfpages} \usepackage{pgfmath} %\usepackage[margin=1cm,showframe]{geometry}% MWE only \pgfmathsetmacro{\scale}{(\paperheight-2cm)/(\paperwidth-3cm)}% 1cm margin \pgfmathsetlengthmacro{\delta}{\paperwidth-2cm-2*\scale*(\paperheight-3cm)-4mm}% 4mm fudge factor %\usepackage{pdfpages} % <<<<<<<<<<<<<<<<< \usepackage{fontspec} \newfontfamily\hebfont{Arial} %\usepackage{pdfpages} % <<<<<<<<<<<<<<<<< \usepackage{fancyhdr} \fancypagestyle{importedpages}{% \fancyhf{}% Clear header/footer \renewcommand{\headrulewidth}{0pt}% Remove header rule \renewcommand{\footrulewidth}{0pt}% Remove footer rule (default) % \fancyfoot[C]{\raisebox{-5\baselineskip}{\Roman{page} -- {\hebfont\char\numexpr"05CF+\value{page}\relax}}}% Lower page number changed for this MWE <<<<< } \begin{document} \includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt, offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 2.5cm, pagecommand={\thispagestyle{importedpages}}% ]{pdfpages.pdf} \end{document} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.