8
\documentclass[12pt, a4paper]{article}
\usepackage{amsmath}
\usepackage{adjustbox} % uses graphicx
\usepackage[top=1.8cm,bottom=1.8cm,left=0.88cm,right=0.88cm]{geometry}


\usepackage{fancyhdr}
\usepackage{lastpage}

%\usepackage[
%   type={CC},
%   modifier={by-nc-nd},
%   version={4.0}
%]{doclicense}
%%
% \usepackage{doclicense}

\usepackage{lipsum}

\usepackage{hyperref}
\pdfsuppressptexinfo=-1
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{qrcode}
%\usepackage{background}
\usepackage{multicol} % cover page multicol

\begin{document}


% \doclicenseImage

\cleardoublepage
\pagestyle{fancy}
\lipsum[1-5]

\end{document}

enter image description here

It was working fine when I installed and updated up to 17th Sep 2020. Not sure which package casued it, but after the most recent update, if I add (put it back)\usepackage{doclicense}, I got this error now.

CasperYC
  • 683
  • 1
    well doclicense loads hyperxmp which loads totpages which claims to be not compatible with lastpage which you load. Ask the hyperxmp author is he really needs totpages, – Ulrike Fischer Oct 10 '20 at 13:29
  • 2
    interesting choice of terminal font – David Carlisle Oct 10 '20 at 14:11
  • totpages claims to offer everything which lastpage offers, too, so why not switch from lastpage to totpages? –  Oct 10 '20 at 15:53
  • hmmmmmmm, disabling lastpage does not really produce the lastpage. I don't think totpages functions at all in that case... – CasperYC Oct 15 '20 at 15:25

2 Answers2

4

Same issue here after a recent upgrade in Debian Bullseye.

Before:

\documentclass{report}
\usepackage{lastpage}
\usepackage{hyperxmp}
\begin{document}
  This is page~\thepage{} of~\pageref{LastPage}.
\end{document}

Which gave the error:

! Package totpages Error: Can't use both, lastpage and totpages.

See the totpages package documentation for explanation. Type H <return> for immediate help. ...

l.35 \begin{document}

I replaced the lastpage dependency with totpages and changed the corresponding \pageref{LastPage} to \pageref{TotPages}. After:

\documentclass{report}
\usepackage{totpages}
\usepackage{hyperxmp}
\begin{document}
  This is page~\thepage{} of~\pageref{TotPages}.
\end{document}

This also works with an unnumbered title page. The totpages package claims it's meant to be used for the actual total number of pages, not the last page's number for which the lastpage package is meant, but this way it can do that anyway and it resolves the dependency conflict.

Result:
"This is page 1 of 1."

Luc
  • 214
  • Thanks! Replacing 'lastpage' with 'totpages' got rid of this unclear error message. – gilu Jan 21 '21 at 07:40
3

With a recent distribution, neither OP's MWE nor Luc's code load totpages anymore. Therefore there is no longer a problem when loading lastpage. Additionally, the error message of totpages can be ignored (hit "enter"). There is no reason for the error message to be there.

Stephen
  • 14,890