Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}

%% Format Header and Footer
\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

%% Hyperlinks Formatting
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=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}

%% Header and Footer Setup
\fancyhead[L]{\slshape \leftmark}
\fancyhead[R]{\thepage}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{14.5pt}
\setlength{\parindent}{0in}

\pagenumbering{roman}

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

\onehalfspacing
\setcounter{tocdepth}{2}
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}
\listoffigures
\addcontentsline{toc}{section}{List of Figures}
\listoftables
\addcontentsline{toc}{section}{List of Tables}
\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}
\addcontentsline{toc}{chapter}{References}

\end{document}

The resulting PDF can be found at Report PDF Result

Any help is appreciated.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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.
}
share|improve this answer
    
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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.