0

I'm modifying a model for my thesis that I found online. It's based on a cls file (abntex2.cls - https://pt.overleaf.com/latex/templates/modelo-canonico-de-trabalhos-academicos-com-abntex2/ybtpkzkccnnj) and a template (https://github.com/abntex/abntex2/blob/master/doc/latex/abntex2/examples/abntex2-modelo-trabalho-academico.tex).

The hyperref configs of the tex document is:

\makeatletter
\hypersetup{
           %pagebackref=true,
                pdftitle={\@title}, 
                pdfauthor={\@author},
            pdfsubject={\imprimirpreambulo},
            pdfcreator={LaTeX with abnTeX2},
                pdfkeywords={abnt}{latex}{abntex}{abntex2}{trabalho acadêmico}, 
                colorlinks=true,                 % false: boxed links; true: colored links
            linkcolor=black,              % color of internal links
            citecolor=black,                        % color of links to bibliography
            filecolor=black,                  % color of file links
                urlcolor=black,
                bookmarksdepth=4
}
\makeatother

( https://wtools.io/paste-code/b6dA)

and the cls file only mentions it in the line: \RequirePackage{hyperref}

However when I compile the document the hyperlinks are boxed in red and not as a black hyperlink. Those are the only mentions on the documents of hyperlinks and color links, I've tryed using in the begining of the document /usepackage[colorlinks=true] but I get a terminal error:

Package inputenc Warning: inputenc package ignored with utf8 based engines.

) (/usr/share/texlive/texmf-dist/tex/latex/tools/indentfirst.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/luatex.def)) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.sty (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype-luatex.def) (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.cfg))

! LaTeX Error: Option clash for package hyperref.

If anyone has any suggestion and can find the bug it would be a big help.

3
  • Please provide a full but minimal example others can copy and test. Please copy the example here, no external links as they tend to rot over time.
    – daleif
    Aug 3 at 14:00
  • 1
    I will not wander through various website to collect your template. Make a minimal complete example and post it here. Aug 3 at 14:00
  • 3
    The error message "Option clash for package hyperref" means that hyperef was previously loaded with different options, other than thoose you are looking at. This is a problem very common for packages featuring dozens of options as hyperef does. A common workaround would be to add, before \documentclass the line \PassOptionsToPackage{blabla}{hyperref} where blabla is a coma separated list of options. Anyways a genuine MWE would be very helpful...
    – Jhor
    Aug 3 at 15:26
0

Hypersetup is a package that modifies the package hyperref. Since you have not loaded hyperref before trying to manipulate it, it fails.

If you include \usepackage{hyperref} in your preamble it might at the very least get rid of the error \RequirePackage{hyperref}.

For example at this location:

% Pacotes de citações
% ---
\usepackage{hyperref}
\usepackage[brazilian,hyperpageref]{backref}     % Paginas com as citações na bibl
\usepackage[alf]{abntex2cite}   % Citações padrão ABNT

Bear in mind, i have not tested this with your template.

1
  • 2
    \hypersetup is a macro to change the values of keys used by package hyperref ...
    – Mensch
    Sep 15 at 21:13

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.