I am trying to include a centered algorithm in a single column latex document on overleaf, however as can be seen from the picture, the border requires to be shortend in width to look and fit the page better.
How can I reduce the width of the top and bottom lines, so that they only cover the text, but remain centered on the page
\documentclass{article}
\usepackage[tmargin=1.25in,bmargin=1.25in,lmargin=1.5in,rmargin=1.5in]{geometry}
\usepackage{fancyhdr}
\usepackage[fleqn]{amsmath}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{apacite}
\begin{document}
\fontfamily{ptm}\selectfont
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\rhead{\large{\textit{header
}}}
\rfoot{Copyright $\textcopyright$ 2018+}
\cfoot{}
\sffamily
\noindent\rule{14cm}{1pt}
\begin{center}
\huge{\textbf{Title}}
\end{center}
\vspace{-\baselineskip}
\noindent\rule{14cm}{1pt}
\fontfamily{ptm}\selectfont
\begin{flushleft}
\vspace{7mm}
\par
\large{\textbf{authors}}
\vspace{5mm}
\par
\large{\textit{School}}
\par
\large{\textit{No emails (please)}}
\vspace{7mm}
\par
\renewcommand{\sfdefault}{\large{\textbf{ABSTRACT}}}
\sfdefault
\par
\fontfamily{ptm}\selectfont
abstract.
\vspace{5mm}
\par
\textit{Keyword:}
\par
\vspace{5mm}
\noindent\rule{14cm}{1pt}
\vspace{5mm}
\par
\renewcommand{\sfdefault}{\large{\textbf{1 \quad \quad INTRODUCTION}}}
\sfdefault
\par
\fontfamily{ptm}\selectfont
Describe the general perspective of the chapter. Toward the end, specifically state the objectives of the chapter.
\vspace{7mm}
\par
\renewcommand{\sfdefault}{\large{\textbf{BACKGROUND (SUBHEAD STYLE 1- ARIAL, SIZE 12, BOLD)}}}
\sfdefault
\par
\fontfamily{ptm}\selectfont
Provide broad definitions and discussions of the topic and incorporate views of others (literature review) into the discussion to support, refute or demonstrate your position on the topic.
\vspace{7mm}
\par
\renewcommand{\sfdefault}{\large{\textbf{MAIN FOCUS OF THE CHAPTER}}}
\sfdefault
\vspace{7mm}
\par
\cite{TEIXEIRA2017}
\begin{algorithm}
\centering
\caption{title}\label{algorithm}
\begin{algorithmic}[1]
\State \text{algorithm}
\Repeat
\State \text{/*Parse data to format*/}
\For{$i\gets 1, rows$}
\State $\text{algorithm}$
\State $\text{Pad data arrays with 0s}$
\EndFor
\Until {Data is converted}
\State \text{algorithm}
\Repeat
\State \text{algorithm}
\For{$i\gets 1, rows$}
\State $\text{algorithm}$
\EndFor
\Until {algorithm}
\State \textbf{Return} \text{algorithm}
\end{algorithmic}
\end{algorithm}
\renewcommand{\sfdefault}{\large{\textbf{2 \quad \quad INTRODUCTION2}}}
\sfdefault
\end{flushleft}
\renewcommand{\sfdefault}{\large{\textbf{2 \quad \quad REFERENCE}}}
\sfdefault
\bibliographystyle{apacite}
\bibliography{sa.bib}
\end{document}



minipageenvironment smaller than the full width, then the lines will be smaller as well. – Marijn Jun 20 '18 at 13:36