[Tex/LaTex] Can’t get fancyhdr to work (nothing happens)

fancyhdrheader-footertemplates

Basicaly, all I want to do is to put page numbers on the bottom of the page. I'm using the fancyhdr package.

\documentclass[12pt,openright,twoside,a4paper,english,brazilian]{abntex2}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}
\usepackage{color}
\usepackage{graphicx}
\usepackage{microtype}
\usepackage{float}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{array}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{
         colorlinks,
         linkcolor={black!80!black},
         citecolor={blue!50!black},
         urlcolor={blue!80!black}
        }

\usepackage{multicol}
\usepackage{multirow}

\usepackage[brazilian,hyperpageref]{backref}
\usepackage[alf]{abntex2cite}

\let\footruleskip\undefined
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
\fancyfoot[RO,LE]{\thepage}

The problem is, nothing happens. I don't get any errors, but the page number doesn't show up. What's happening?

Best Answer

The authors of the class has chosen to automatically run the command \pretextual at the start of the document. This command is similar to \frontmatter and removed all headers and footers.

Thus start your document with \mainmatter or \textual to start a normal setup.

As mentioned in a comment. memoir (which this class is based on) has its own very well integrated system for handling headers and footers. fancyhdr should not be used with anything that runs on top of the memoir class.