1

I´m pretty new to LaTeX. When generating the pdf, I receive the error:

File ended while scanning use of \kvsetkeys

I´m using the standard code developed by an brazilian university to write my phd dissertation.

Could anyone help me?

Here is the code:

\documentclass[
12pt,
openright,          
oneside,            
a4paper,             
english,            
french,             
spanish,            
brazil              
]{abntex2}

\usepackage{lmodern}                        
\usepackage[T1]{fontenc}        
\usepackage{ucs}
\usepackage[utf8]{inputenc}     
\usepackage{lastpage}           
\usepackage{indentfirst}        .
\usepackage{color}              
\usepackage{graphicx}           
\usepackage{microtype}          
\usepackage{amsmath}
\usepackage{chngcntr}
\usepackage[table]{xcolor}
\usepackage{pgf-pie}
\usepackage{multirow}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage[brazilian,hyperpageref]{backref}    
\usepackage[alf,abnt-etal-list=0,abnt-etal-cite=2,abnt-etal-text=it,abnt-repeated-author-omit=yes]{abntex2cite} 
\renewcommand{\backrefpagesname}{Citado na(s) página(s):~}
\renewcommand{\backref}{}
\renewcommand*{\backrefalt}[4]{
    \ifcase #1 %
        Nenhuma citação no texto.%
    \or
        Citado na página #2.%
    \else
        Citado #1 vezes nas páginas #2.%
    \fi}%

\counterwithout{equation}{chapter}
\makeatletter
\hypersetup{
%pagebackref=true,
pdftitle={\@title}, 
pdfauthor={\@author},
pdfsubject={\imprimirpreambulo},
pdfcreator={LaTeX with abnTeX2},
pdfkeywords={abnt}{latex}{abntex}{abntex2}{trabalho acadêmico}, 
colorlinks=true,            
linkcolor=black,            
citecolor=black,            
filecolor=magenta,          
urlcolor=black,
%bookmarksdepth=4}
\makeatother
\setlength{\parindent}{1.3cm}
\setlength{\parskip}{0.2cm}  % tente também \onelineskip
\makeindex
\begin{document}
\selectlanguage{brazil}
\frenchspacing 
\imprimircapa
\imprimirfolhaderosto
\setlength{\absparsep}{18pt} 
\begin{resumo}  
\vspace{\onelineskip}
\end{resumo}
\begin{resumo}[Abstract]
\vspace{\onelineskip} 
\noindent 
\end{resumo}
\pdfbookmark[0]{\listfigurename}{lof}
\listoffigures*
\cleardoublepage
\pdfbookmark[0]{\listtablename}{lot}
\listoftables*
\cleardoublepage
\begin{siglas}
\end{siglas}
\pdfbookmark[0]{\contentsname}{toc}
\tableofcontents*
\cleardoublepage
\textual
\chapter{Introdução}
\section{Apresentação}
\phantompart
\postextual
\bibliography{Bibliografia}
\begin{apendicesenv}
\end{apendicesenv}
\begin{anexosenv}
\end{anexosenv}
\phantompart
\printindex
\end{document}
6
  • 1
    You would get that if you had \kvsetkeys{ with no closing brace anywhere. If you show no code that is about the only thing anyone could guess. – David Carlisle Oct 7 '17 at 19:55
  • Thanks, David. I just posted the code. I´m using the standard code developed by an brazilian university to write my phd dissertation. – Lucas Oct 7 '17 at 20:31
  • I get the error ! LaTeX Error: Missing \begin{document}. – David Carlisle Oct 7 '17 at 20:40
  • if I correct that (stray . on line 17) then I get the error ! LaTeX Error: File pgf-pie.sty' not found.` – David Carlisle Oct 7 '17 at 20:42
  • You have %bookmarsdepth=4} and the % hides the closing }. Put the brace on the following line, if you want to keep the commented entry. – egreg Oct 7 '17 at 20:45
2

Your main error here is the commented closing bracket in command \hypersetup. Change it to (see the marking <=======:

\hypersetup{%
% pagebackref=true,
  pdftitle={\@title}, 
  pdfauthor={\@author},
  pdfsubject={\imprimirpreambulo},
  pdfcreator={LaTeX with abnTeX2},
  pdfkeywords={abnt}{latex}{abntex}{abntex2}{trabalho acadêmico}, 
  colorlinks=true,            
  linkcolor=black,            
  citecolor=black,            
  filecolor=magenta,          
  urlcolor=black,
%bookmarksdepth=4 % <===================================================
} % <===================================================================

After commenting a few other options and adding some missing commands your code compiles. See the following MWE (and please check the lines marked with <====):

\documentclass[%
12pt,
openright,          
oneside,            
a4paper,             
%english,            
%french,             
%spanish,            
brazil              
]{abntex2}

\usepackage{lmodern}                        
\usepackage[T1]{fontenc}        
\usepackage{ucs}
\usepackage[utf8]{inputenc}     
\usepackage{lastpage}           
\usepackage{indentfirst}        %.<=====================================
\usepackage{color}              
\usepackage{graphicx}           
\usepackage{microtype}          
\usepackage{amsmath}
\usepackage{chngcntr}
\usepackage[table]{xcolor}
\usepackage{pgf-pie}
\usepackage{multirow}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage[brazilian,hyperpageref]{backref}    
\usepackage[alf,abnt-etal-list=0,abnt-etal-cite=2,abnt-etal-text=it,abnt-repeated-author-omit=yes]{abntex2cite} 
\renewcommand{\backrefpagesname}{Citado na(s) página(s):~}
\renewcommand{\backref}{}
\renewcommand*{\backrefalt}[4]{
    \ifcase #1 %
        Nenhuma citação no texto.%
    \or
        Citado na página #2.%
    \else
        Citado #1 vezes nas páginas #2.%
    \fi}%

\counterwithout{equation}{chapter}
\makeatletter
\hypersetup{%
% pagebackref=true,
  pdftitle={\@title}, 
  pdfauthor={\@author},
  pdfsubject={\imprimirpreambulo},
  pdfcreator={LaTeX with abnTeX2},
  pdfkeywords={abnt}{latex}{abntex}{abntex2}{trabalho acadêmico}, 
  colorlinks=true,            
  linkcolor=black,            
  citecolor=black,            
  filecolor=magenta,          
  urlcolor=black,
%bookmarksdepth=4 % <===================================================
} % <===================================================================
\makeatother
\setlength{\parindent}{1.3cm}
\setlength{\parskip}{0.2cm}  % tente também \onelineskip
\makeindex

\author{John Doe} % <===================================================
\title{title of document}
\date{\today}

\begin{document}
\selectlanguage{brazil}
\frenchspacing 
\imprimircapa
%\imprimirfolhaderosto % <============== causes errors
\setlength{\absparsep}{18pt} 
\begin{resumo}  
\vspace{\onelineskip}
\end{resumo}
\begin{resumo}[Abstract]
\vspace{\onelineskip} 
\noindent 
\end{resumo}
\pdfbookmark[0]{\listfigurename}{lof}
\listoffigures*
\cleardoublepage
\pdfbookmark[0]{\listtablename}{lot}
\listoftables*
\cleardoublepage
%\begin{siglas}
%\end{siglas}
\pdfbookmark[0]{\contentsname}{toc}
\tableofcontents*
\cleardoublepage
\textual
\chapter{Introdução}
\section{Apresentação}
\phantompart
\postextual
\bibliography{Bibliografia}
\begin{apendicesenv}
\end{apendicesenv}
\begin{anexosenv}
\end{anexosenv}
\phantompart
\printindex
\end{document}

Please check the commented lines to evaluate the error there and change then your original code ...

0
1

As predicted in the intial comment you have more { than }

\hypersetup{

has no matching }

Note that the full error message, which you did not show, shows exactly the problem starting with the { and saying it reached the end of the file

Runaway argument?
{ pdftitle={\@title }, pdfauthor={\@author }, pdfsubject={\imprimirpreambulo \E
TC.
! File ended while scanning use of \kvsetkeys.
<inserted text> 
                \par 

\kvsetkeys is the internal command used by \hypersetup but the error message highlights the { pdftitle... argument that is in your source file.

2
  • @Lucas just put a } before \makeatother to finish the \hypersetup{ command. (and remove the . in the indentfirst line as noted in comments) – David Carlisle Oct 7 '17 at 21:56
  • Thanks, David. The code is compiling now, although other errors appeared (for another topic). – Lucas Oct 9 '17 at 11:37

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.