# Document isn't justifying after compilation

I am currently working on a report but for some reason, after I compile it, the text appears to be unjustified. I thought LaTex did this by default.

Below is my code

\documentclass[12pt,a4paper,oneside]{report}

%%Label Equations According To Chapter
\usepackage{amsmath}
\numberwithin{equation}{chapter}

%% Enables Sub Sub Sections to be Numbered
\setcounter{secnumdepth}{3}

\usepackage{fancyhdr}

%% Used to Insert Graphics
\usepackage{graphicx}
\usepackage{setspace}

%% Used to Convert EPS images to PDF
\usepackage{epstopdf}

%% Paragraph Formatting
\usepackage{parskip}

%% Used to Insert Blocks of Code
\usepackage{listings}

%% Used for Tables
\usepackage{tabularx}

% Use Numbers Libary for numbering
\usepackage{enumerate}
%\renewcommand{\labelenumi}{\arabic{enumi}. }

%% Used to Insert SI Units
\usepackage{siunitx}
\raggedright

\usepackage{hyperref}
\hypersetup{
citecolor=black,
filecolor=black,
urlcolor=black
}

%% Referencing Library
\usepackage{natbib}

%% Include Graphics from Multiple Folders
\graphicspath{{title_page/img/},{6_state_estimation/img/},{2_cannon_subsystem/img/}}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%\setlength{\parskip}{10pt}

%New Command: Diagram Scale - % of textwidth
\newcommand{\imgscale}{0.9\textwidth}

\begin{document}
\setkeys{Gin}{draft}

\input{title_page/title_page_prelim}
\pagestyle{fancy}

\fancyfoot{}
\renewcommand{\footrulewidth}{0pt}
\setlength{\parindent}{0in}

\pagenumbering{roman}

\input{0_preamble/disclaimer}
\input{0_preamble/acknowledgements}

\onehalfspacing
\setcounter{tocdepth}{2}
\tableofcontents
\listoffigures
\listoftables
\clearpage
\pagenumbering{arabic}

\input{1_introduction/1_project_definition_and_goals}

\input{2_cannon_subsystem/2_literature_review}
\input{2_cannon_subsystem/2_preliminary_design}
\input{2_cannon_subsystem/2_detailed_design}
\input{2_cannon_subsystem/2_literature_review}

\input{6_state_estimation/state_estimation}

\renewcommand\bibname{References}
%\bibliographystyle{plainnat}
\bibliographystyle{custom_harvard}
\bibliography{prelim_ref}

\end{document}


The resulting PDF can be found at Report PDF Result

Any help is appreciated.

-

Try removing the line \raggedright.

('Ragged right' is how you get left-aligned text in LaTeX. There's also a \raggedleft for right-aligned text.)

Edit: If you only want part of your document to be left-aligned, then make sure \raggedright occurs inside a pair of braces. Otherwise it will ruin your whole document! For example, to make just your disclaimer page left-aligned, use:

{
\raggedright
\input{0_preamble/disclaimer}
\par % This ends the paragraph properly. See egreg's comment below.
}

-
Yeah, check out the warning here: en.wikibooks.org/wiki/LaTeX/Paragraph_Formatting –  rickhg12hs May 8 '13 at 7:31
the \raggedright is there so the disclaimer page in my document is aligned correctly (2nd page in the attached file). Removing the \raggedright disturbs this only but fixes everything else. Can I just define \raggedright for this page only? –  JHoop May 8 '13 at 7:35
many thanks, just applied that to the file that needed it, worked a treat –  JHoop May 8 '13 at 7:41
Add \par before the closing brace. –  egreg May 8 '13 at 8:18
@egreg: Why's that? –  John Wickerson May 8 '13 at 8:20