0

everyone. I need to set the line numbering in the following template so that it also counts the title. Line 5 should be line 6 and so on. Moreover, I need to set the page numbering in all pages as "1/2", "2/2" and so on (including the first page). How can I do that?

\documentclass[12pt,a4paper]{article}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{titling}
\usepackage{lastpage}
\setlength{\droptitle}{4cm}
\usepackage{lipsum}
\title{notitle}
\author{}
\date{}
\usepackage[modulo]{lineno}
\usepackage[a4paper,left=3cm,right=3cm,top=2cm,bottom=4cm]{geometry}
\usepackage{fancyhdr}
\fancyhead[C]{\thepage/\pageref{LastPage}}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt} 
\pagestyle{fancy}
\linespread{1.25}
\renewcommand\linenumberfont{\normalsize}
\setlength{\headheight}{20mm}
\begin{document}
\maketitle\vspace{-4cm}
\linenumbers
\lipsum
\end{document}
2
  • Possible duplicate here.
    – Niklas
    Aug 15, 2019 at 19:16
  • I used that answer to make my code but I can't make all the pages with the same numbering style (including the first page).
    – Rodrigo
    Aug 15, 2019 at 19:17

1 Answer 1

0

Altough this is not with \maketitle it's an alternative. But if you still want to use \maketitle this questions has the same question. As \maketitle sets the page style to plain.

\documentclass[12pt,a4paper]{article}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{titling}
\usepackage{lastpage}
\usepackage{lipsum}
\usepackage[modulo]{lineno}
\usepackage[left=3cm,right=3cm,top=2cm,bottom=4cm]{geometry}
\usepackage{fancyhdr}
\fancyhead[C]{\thepage/\pageref{LastPage}}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt} 
\pagestyle{fancy}
\linespread{1.25}
\renewcommand\linenumberfont{\normalsize}
\setlength{\headheight}{20mm}

\begin{document}
{\centering \section*{notitle}}

\linenumbers
\lipsum
\end{document}
1
  • Putting the \linenumbers before {\centering \section*{notitle}} also gives the right numbering :)
    – Rodrigo
    Aug 15, 2019 at 19:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .