# ! Missing \endcsname inserted

I have a problem with the package \usepackage{pdfpages} and maybe the reason is \usepackage[turkish]{babel}. I need to use that package. Can anyone help me, please?

 \documentclass[11pt]{article}
\usepackage[left=2cm, right=2cm, top=3cm, bottom=3cm]{geometry}

\usepackage{sectsty}
\usepackage{amssymb,latexsym,cite}
\usepackage{pstcol,pstricks,color}
\usepackage{amsfonts, amsmath}
\usepackage{graphicx}
\usepackage{comment}
\usepackage{pdfpages}
\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{subcaption}
\newtheorem{theorem}{Theorem}[section]

\usepackage{fancyhdr}
\usepackage{pdfpages}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[CE,CO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\footrulewidth}{1pt}

\begin{document}
\pagenumbering{gobble}
\title{XYZ}

\date{}
\maketitle
\vspace*{-1.5\baselineskip}

\section{B}

\includepdf[pages=-]{putyourpdfhere}

\end{document}

• Thanks for editing! – Probability student Jul 27 at 5:31
• Do you compile your file with xelatex? I compile your file without any problem with TexLive2019. Also try to put a complete and compilable source code. – A Diyanat Jul 27 at 5:46
• I use Texmaker. – Probability student Jul 27 at 6:19
• Please add a minimal example so that everyone can reproduce your problem. – AndréC Jul 27 at 6:51
• So go to Configure Texmaker->Quick Build and choose XeLaTeX. Compile your source code again. You probably compile your file with pdfLatex. Also as @AndréC please out a complete and compilable source code. – A Diyanat Jul 27 at 6:54

Your MWE can be further reduced to the following code:

\documentclass[11pt]{article}

\usepackage{pdfpages}
\usepackage[turkish]{babel}

\begin{document}
\section{B}
\includepdf[pages=-]{<document name>}
\end{document}


That still produces the error message Missing \endcsname inserted..

As already discussed here, and here the turkish option of babel makes the = active. To overcome this, you could use the following if you want to keep shorthands active thoroughout the rest of the document.

\documentclass[11pt]{article}

\usepackage{pdfpages}
\usepackage[turkish]{babel}

\begin{document}
\section{B}
\shorthandoff{=}
\includepdf[pages=-]{<document name>}
\shorthandon{=}
\end{document}


If you don't want to use any shorthands throughout the document, you might also be interested in globally turning them off using the shorthands=off option as shown in the following MWE:

\documentclass[11pt]{article}

\usepackage{pdfpages}
\usepackage[turkish,shorthands=off]{babel}

\begin{document}
\section{B}

\includepdf[pages=-]{<document name>}

\end{document}


More information on this topic can also be found in section "1.10 Shorthands" of the babel manual.

• Thank you very much. Finally, it worked. I had spent more than one hour to fix it but failed. This is a wonderful platform with many great people. – Probability student Jul 27 at 8:30