Text FormattingForce to wrap Word to next Line

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
imdadullah

Force to wrap Word to next Line

Post by imdadullah »

I want the word forced to wrap to next line instead of having hyphen in sentence. How it can be done.

Code: Select all

\documentclass{report}
\begin{document}

\noindent This is sample text in which word is not \textbf{wrapping} to next line I want hyphened word forced to be wrap on next line. This is sample text in which word is not \textbf{wrapping} to next line I want hyphened word forced to be wrap on next line. Thiasdfasdfs is sample text in sdfasdfwhich word is not \textbf{wrapping} to next line I want hyphened word forced to be wrap on next line.
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Force to wrap Word to next Line

Post by 5gon12eder »

What do you actually mean with "forced"? You can end a line at any point using the \\ command. So you could write

Code: Select all

This line breaks and the word wonder-\\ful is hyphenated.
But doing so would mean throwing away LaTeX's service. Maybe you just want to suggest a good place for potential hyphenation, i.e. declare a soft hyphen. This is done with the \- command.

Best
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
User avatar
Stefan Kottwitz
Site Admin
Posts: 10281
Joined: Mon Mar 10, 2008 9:44 pm

Force to wrap Word to next Line

Post by Stefan Kottwitz »

To avoid line-breaking in a word, you could write \mbox{word}. The hyphenat package can help suppressing hyphenation within environments or the complete document.

Stefan
LaTeX.org admin
imdadullah

Force to wrap Word to next Line

Post by imdadullah »

Stefan_K wrote:To avoid line-breaking in a word, you could write \mbox{word}. The hyphenat package can help suppressing hyphenation within environments or the complete document.

Stefan

it makes the text like zigzag.
imdadullah

Force to wrap Word to next Line

Post by imdadullah »

I found this solution for forced justification (like word) in latex document.

Code: Select all

\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
Use before begin document....
Post Reply