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}
Rodrigo
  • 567

1 Answers1

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}
Niklas
  • 402
  • Putting the \linenumbers before {\centering \section*{notitle}} also gives the right numbering :) – Rodrigo Aug 15 '19 at 19:35