Graphics, Figures & Tablesextra space in table cell

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
rana
Posts: 1
Joined: Tue Nov 08, 2016 6:55 pm

extra space in table cell

Post by rana »

Hi
when I create a table using Tabular or Long table and I specify the columns width . a lot of extra spaces in a cell between words generated. How I can solve this issue
Thanks

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

extra space in table cell

Post by Johannes_B »

You can use something like >{\raggedright}p{10em}.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

extra space in table cell

Post by Stefan Kottwitz »

The microtype package helps in justifying and avoiding too much white space:

\usepackage{microtype}

You could even allow hyphenation in table cells:

Code: Select all

\usepackage{array}
\usepackage{ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\hspace{0pt}}p{#1}}
...
\begin{tabular}{P{3cm}P{4cm}}
  ...
\end{tabular}
Stefan
LaTeX.org admin
Post Reply