2

I am compiling a document from many full-page PDFs and add a table of contents. Because the PDFs are full page, the page number might not stand out from the background. Is there a good way to make them stand out? (I would prefer not to scale the included pages down to make room for the footer because some pages already have some pretty small print.)

\documentclass[a4paper,11pt]{article}
\usepackage{pdfpages}
\usepackage{lmodern}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{hyperref}

\includepdfset{noautoscale=true, pagecommand={\thispagestyle{plain}}}

\begin{document}
\tableofcontents    

\section{Documents}
\includepdf[pages=-,addtotoc={
      1, subsection,1,One,h1,
      2, subsection,1,Two,h2,
      3, subsection,1,Three,h3
    }]{blahblah.pdf}
\end{document}
3

You could make a new page style with fancyhdr and place the page number in a \fcolorbox with white fill.

\documentclass[a4paper,11pt]{article}
\usepackage{pdfpages}
\usepackage{lmodern}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}

\usepackage{xcolor}
\usepackage{fancyhdr}
\fancypagestyle{pageno}{
\setlength\fboxsep{5pt}
\fancyhf{}
\fancyfoot[C]{\fcolorbox{white}{white}{\thepage}}
}


\usepackage{hyperref}

\includepdfset{noautoscale=true, pagecommand={\thispagestyle{pageno}}}

\begin{document}
\tableofcontents    

\section{Documents}
\includepdf[pages=-,addtotoc={
      1, subsection,1,One,h1,
      2, subsection,1,Two,h2,
      3, subsection,1,Three,h3
    }]{blahblah.pdf}
\end{document}
  • This is a simple yet effective solution. – Christian Lindig Apr 11 '18 at 18:17
  • To set the frame of the box, I'm using \setlength\fboxrule{0.2pt} and \fcolorbox{black}{white}{\thepage}. – Christian Lindig Apr 12 '18 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.