Text FormattingTransmission of short words and to prevent hyphenation

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
yerpy
Posts: 1
Joined: Sat Jun 25, 2016 3:18 pm

Transmission of short words and to prevent hyphenation

Post by yerpy »

Hello,
I would like to know If it is possible to prevent dividing words when they are too long at the end of the line.
Second thing is If there exist comment to move single letters or for example "a, on, in" from the end of the line.
Image
Thanks for the help in advance.

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

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Transmission of short words and to prevent hyphenation

Post by cgnieder »

I'll quote Joseph Wright on the hyphenation question:
This is discussed in detail in the TeX FAQ. Summarising the information given there:
  1. You can set \hyphenpenalty and \exhyphenpenalty to 10000, which will stop hyphenation, but as TeX will still try to hyphenate this is not hugely efficient.
  2. […] you can use \usepackage[none]{hyphenat} to select a 'language' with no hyphenation at all. This works fine for a single language document, but not if you want to use babel or polyglossia for other language-specific effects.
  3. Setting \righthyphenmin and \lefthyphenmin to very large values will prevent hyphenation as it tells TeX that it must have more characters in the word than are going to be available. The suggested value in the FAQ is 62.
  4. You can set \hyphenchar\font=-1, which will prevent hyphenation for the current font: this is probably not the best way for an entire document but is how it is done for the tt font shape in LaTeX.
Now, of those (2) is probably the best choice. However, what you did not say is why you want no hyphenation. TeX hyphenates when it cannot find a good line break without it, so you get few hyphens in most cases. The risk with no hyphenation at all is that the output looks bad.
Regards
site moderator & package author
Post Reply