[Tex/LaTex] includepdf error message cannot find file

packagespdfpages

When I try to compile the file, I get this error message:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[czech]{babel}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{makeidx}
\usepackage{hyperref
\usepackage{pdfpages}
\begin{document}
\includepdf[pages={-}]{file.pdf}
\end{document} 

Package pdfpages Error: Cannot find file `-'. \includepdf[pages=-]{file.pdf}

When I change \includepdf[pages=-]{file.pdf} to \includepdf[pages={1}]{file.pdf} it will print the first page or any other page I want. It also does not work and show the error message when I try to print pages 7-11, so anytime I put – sign I get the message.

Does anyone know, why is that and how to fix it? Thanks.

Best Answer

Unfortunately - is made into an active shorthand character by the czech babel option, you can use

\shorthandoff{-}

Just before the pdf inclusion to make - safe again. Normally this is inside a group so - will regain its babel meaning, or you could use \shorthandon to explicitly reset it.