4

I've got a problem with the page numbering in my document. First, it was in the middle of the footer of the first page (as now), then to the left in the header of the second, and then on the right side of the header of the third page. Then, when I added some text in the header the page numbers of page 2 and 3 disappeared. I've tried different strategies in order to define one single position, e.g. trying different styles, title page environment, and fancyhdr. Would really appreciate some help!

    \documentclass[twoside,twocolumn, 12pt]{article}

    \usepackage{blindtext}
    \usepackage[square,numbers,comma,sort&compress]{natbib}
    \bibliographystyle{unsrtnatnodoi}
    \usepackage{natbib,epsfig,endnotes}
    \setlength\parindent{0pt}

    \usepackage[utf8]{inputenc}
    \usepackage{gensymb}
    \usepackage{textgreek}
    \usepackage{enumerate}
    \usepackage[table]{xcolor}
    \usepackage{url}
    \usepackage{pgfplots}\pgfplotsset{compat=1.14}
    \usepackage{makecell}
    \usepackage{float}
    \usepackage{times}
    % \usepackage{fancyhdr}
    % \pagestyle{fancy}
    \usepackage{lastpage}
    \usepackage{graphicx, subcaption, setspace, booktabs}

    \usepackage{multirow}
    \usepackage{multicol}
    \usepackage{longtable}

    \usepackage[myheadings]{fullpage}
    \usepackage[T1]{fontenc}
    \linespread{1.05}
    \setlength{\parskip}{0.2cm}
    \widowpenalty10000
    \clubpenalty10000

    \usepackage[english]{babel}
    \usepackage[hmargin=20mm,top=20mm,columnsep=12pt]{geometry} 
    \newcommand{\HRule}[1]{\rule{\linewidth}{#1}}



    %\renewenvironment{titlepage}
        %{%
          %\if@twocolumn
            %\@restonecoltrue\onecolumn
          %\else
            %\@restonecolfalse\newpage
          %\fi
         % \thispagestyle{empty}% remove the empty page style
          %\setcounter{page}\z@ %remove the counter reset
        %}%
    %\makeatother

    \makeatletter
    \renewcommand{\fnum@figure}{Fig. \thefigure}
    \makeatother

    \usepackage{fancyhdr} % Headers and footers
    \pagestyle{fancy} % All pages have headers and footers
    \fancyhead{} % Blank out the default header
    \fancyfoot{} % Blank out the default footer
    \fancyhead[C]{\small Concept Plan $\bullet$ December 2018} 

    \usepackage{titling} 

    \usepackage{hyperref} 


    \begin{document}
    \title{ \vspace*{2\baselineskip} 
            \large \textsc{\today}
            \\ [2.0cm]
            \HRule{0.5pt} \\
            \LARGE \uppercase{\textbf{Concept Plan}\\ Title}
            \HRule{0.5pt} \\[0.5cm]
            \vspace*{2\baselineskip}}

    \date{}

    \author{
            person and info}


    \clearpage\thispagestyle{empty}
    \maketitle
    \newpage



    \vspace{-3\baselineskip}
    \textbf{State of the Art}

    \blindtext

    \newpage

    \bibliography{references}

    \end{document}
2

That's because you cleared the header/footer under the fancy page style. You probably need

\usepackage{fancyhdr}
\fancyhf{}% Clear header/footer
\fancyhead[C]{\small Concept Plan $\bullet$ December 2018}
\fancyhead[RO]{\thepage}
\fancyhead[LE]{\thepage}
\pagestyle{fancy}

Note that the first page will still be set in plain with \maketitle, which has the page number in the centre of the footer by default. To change this to match your fancy page style (that is, have it set in the right header, since the first page is odd), add

\makeatletter
\let\ps@plain\ps@fancy
\makeatother

to your preamble. This will set the plain page style to be equivalent to fancy.

2

Here is a suggestion using page style fancyplain provided by package fancyhdr:

\documentclass[twoside,twocolumn,12pt]{article}
\usepackage{blindtext}% only for dummy text

\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhf{} % clear default header and footer content
\fancyfoot[C]{\thepage}% page number on both plain and fancy pages
\fancyhead[C]{\fancyplain{}{\small Concept Plan $\bullet$ December 2018}}% header only on fancy pages

\begin{document}
\title{Title}
\date{}
\author{person and info}
\maketitle

\blinddocument
\end{document}

enter image description here

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.