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.

Here is the illustrating code:

\documentclass[letterpaper, 10pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{array}
\usepackage[none]{hyphenat}
\begin{document}

\begin{center}
\begin{tabular}{|m{4.5cm}|m{1.2cm}<{\centering}|m{8cm}|c|}
\hline
\centering \textbf{Course Name} & \centering \textbf{Date} & \centering \textbf{Textbook} & \centering \textbf{Grade} \tabularnewline \hline

C Programming Language \& Lab & 09/2009 - 12/2009 & Brian W. Kernighan, and Dennis M. Ritchie, \textit{The C Programming Language}, 2nd ed. ISBN:9780131103627 & 89 \\ \hline

Integrative Practice on Courses & 07/2011 & LUPA, \textit{Linux Software Engineer}, ISBN:9787030199645 & 87 \\ \hline
\end{tabular}
\end{center}

\end{document}

As shown in the PDF generated, there are too much space between some words because I disabled automatic hyphenation. I'd like to leave only single space between words, without justify align.

share|improve this question

migrated from stackoverflow.com Dec 19 '12 at 15:48

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Dec 19 '12 at 17:08

1 Answer 1

up vote 3 down vote accepted

You can use a \raggedright alignment for the columns of interest:

enter image description here

\documentclass[letterpaper, 10pt]{article}
\usepackage[margin=1in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{array}% http://ctan.org/pkg/array
\usepackage[none]{hyphenat}% http://ctan.org/pkg/hyphenat
\begin{document}

\begin{center}
  \begin{tabular}{|m{4.5cm}|m{1.2cm}<{\centering}|m{8cm}|c|}
    \hline
    \centering \textbf{Course Name} & \centering \textbf{Date} & \centering \textbf{Textbook} & \centering \textbf{Grade} \tabularnewline
    \hline
    C Programming Language \& Lab & 09/2009 - 12/2009 & 
      Brian W. Kernighan, and Dennis M. Ritchie, \textit{The C Programming Language}, 2nd ed. ISBN:9780131103627 & 89 \\
    \hline
    Integrative Practice on Courses & 07/2011 & LUPA, \textit{Linux Software Engineer}, ISBN:9787030199645 & 87 \\
    \hline
  \end{tabular}
\end{center}

\begin{center}
  \begin{tabular}{|>{\raggedright}m{4.5cm}|>{\centering}m{1.2cm}|>{\raggedright}m{8cm}|c|}
    \hline
    \centering \textbf{Course Name} & \centering \textbf{Date} & \centering \textbf{Textbook} & \centering \textbf{Grade} \tabularnewline
    \hline
    C Programming Language \& Lab & 09/2009 - 12/2009 & 
      Brian W. Kernighan, and Dennis M. Ritchie, \textit{The C Programming Language}, 2nd ed. ISBN:9780131103627 & 89 \\
    \hline
    Integrative Practice on Courses & 07/2011 & LUPA, \textit{Linux Software Engineer}, ISBN:9787030199645 & 87 \\
    \hline
  \end{tabular}
\end{center}

\end{document}
share|improve this answer
    
Thank you! Just one more question, what are the ">""<"'s used for? –  goldfrapp04 Dec 19 '12 at 10:54
    
@goldfrapp04: >{<stuff>} is used to insert <stuff> before each cell entry in that column, while <{<stuff>} inserts <stuff> after each cell entry. Read p 2 of the array documentation. –  Werner Dec 19 '12 at 15:11

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.