Text FormattingHow do I make text left-aligned and remove hyphenation?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

How do I make text left-aligned and remove hyphenation?

Post by LavaTyper »

In my project, I want to have left-justified text, instead of full-justified text, and essentially no hyphens. But each paragraph in the text should still be indented. When I try using parindent or raggedright I lose paragraph indents. Also, when I try using the hyphenat package, it breaks a requirement for my Table of Contents.


All I want is to make the text left-aligned, to remove uneven spaces, and to remove hyphenation.

How do I do that?

Code: Select all

%\listfiles
\documentclass[12pt]{book}


% I want clickable links to content in my dissertation:

\newcommand*\LTXcontentsline{}
\let\LTXcontentsline\contentsline
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, plainpages=false, pdfpagelabels=true, urlcolor=blue]{hyperref}


\usepackage[dotinlabels]{titletoc}
\usepackage[indentafter,newlinetospace]{titlesec}
\usepackage{ifthen}
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\renewcommand{\listtablename}{LIST OF TABLES}
\renewcommand{\appendixname}{Appendix}

% Format the Chapter in the TOC
\titlecontents{chapter}[0in]{\ifthenelse{\equal{\thecontentslabel}{1}}{
        \vspace{1.3\baselineskip}Chapter\\ \normalsize}{
        \normalsize\vspace{.2\baselineskip}}}
    {\contentspush{\thecontentslabel.~}}
    {}
    {\titlerule*[.3em]{.}\thecontentspage}
    {}
\titlecontents{section}[.3in]{}
              {\contentspush{\thecontentslabel.~}}{}
              {\titlerule*[.3em]{.}\thecontentspage}{}


% Format the Appendix in the TOC
\renewcommand{\appendixname}{Appendix}
\let\oldAppendix\appendix
\renewcommand{\appendix}{
  \oldAppendix
  \addtocontents{toc}{\protect \setcounter{tocdepth}{0} \par}
  \titlecontents{chapter}[0in]{\normalsize\vspace{.2\baselineskip}}
    {\contentspush{Appendix~\thecontentslabel.~}}{}
    {\titlerule*[.3em]{.}\thecontentspage}{}
}
    
\usepackage[doublespacing]{setspace}
\usepackage{lipsum}  % not for use in the actual document

\begin{document}

\tableofcontents
\listoftables

\chapter{MY FIRST CHAPTER WITH A REALLY SUPREMELY LONGTITLE}

Basically: \textbf{All I want is to make the text left-aligned, to remove uneven spaces, and to remove hyphenation.} 

\section{My first section and I want to remove uneven spaces and hyphenation}

\textbf{For both the Table of Contents and the body of the document, I want to have left-justified text, instead of full-justified text, and essentially no hyphens. But each paragraph in the text should still be indented. When I try using \emph{parindent} or \emph{raggedright} I lose the indents. Also, when I try using the \emph{hyphenat} package, it breaks a requirement for my Table of Contents, below.}

For my project, I also need consistently-spaced dot-filling in the Table of Contents...

Special requirement: For a really long title, which goes into two lines followed by the dots, the text in the first cannot run over into the second line. For instance, ``LONG" in the Table of Contents Chapter 1 entry, goes all the way to the last two dots.


\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|}
\hline
first & table \\
\hline
\end{tabular}
\end{center}
\caption{\label{table:first}Caption for my First table}
\end{table}

\section{Into deeper water}

\subsection{So here is an example with another obnoxiously long title for the subsection}

Refer to Table \ref{table:second}: \lipsum[1]

\begin{table}[h]
\begin{center}
\begin{tabular}{||c|c||}
\hline
first & table \\
\hline
\end{tabular}
\end{center}
\caption{\label{table:second}Caption for my Second table}
\end{table}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply