Text FormattingMaximum inter word space (or space between words)

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Sahas
Posts: 8
Joined: Wed Aug 31, 2011 10:59 am

Maximum inter word space (or space between words)

Post by Sahas »

Please help me.
I want to increase maximum possible inter word space for whole text.
The background of a problem: I have a text and when I see dvi output, it looks like

Code: Select all

           Example
This is just  example  of text
with  too  long  line  due  to 
short maximum inter word space
as in this line withverylongwordthatcannot
be separated by hyphen.
I want to increase maximum interword space to get something like:

Code: Select all

           Example
This is just  example  of text
with  too  long  line  due  to 
short maximum inter word space
as     in      this       line 
withverylongwordthatcannot  be
separated by hyphen.
As I know that there are commands like \fontdimen2, \fontdimen3 and so on, but I do not know exactly what they mean and do not know how to use its globally (in preamble).
Last edited by Sahas on Sat Apr 28, 2012 7:35 am, edited 1 time in total.

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

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Maximum inter word space (or space between words)

Post by Stefan Kottwitz »

Hi Saha,

it's easier, you could simply use a sloppypar environment.

Have a look at this example:

Code: Select all

\documentclass{article}
\usepackage[textwidth=5cm]{geometry}
\usepackage{parskip}
\begin{document}
This is just an example  of text
with  too  long  line  due  to
short maximum inter word space
as in this line
\mbox{withverylongwordthatcannot}
be separated by hyphen
\end{document}
Standard paragraph with too long word
Standard paragraph with too long word
paragraph.png (5.83 KiB) Viewed 6327 times
Now we add sloppypar:

Code: Select all

\documentclass{article}
\usepackage[textwidth=5cm]{geometry}
\usepackage{parskip}
\begin{document}
\begin{sloppypar}
This is just an example  of text
with  too  long  line  due  to
short maximum inter word space
as in this line
\mbox{withverylongwordthatcannot}
be separated by hyphen
\end{sloppypar}
\end{document}
Sloppy paragraph, justified
Sloppy paragraph, justified
sloppypar.png (6.3 KiB) Viewed 6327 times
As you can see, the interword space has been increased and it's justified now.

Stefan
LaTeX.org admin
Sahas
Posts: 8
Joined: Wed Aug 31, 2011 10:59 am

Re: Maximum inter word space (or space between words)

Post by Sahas »

Stefan, thank you very much for answer, the problem is solved!
Post Reply