I am writing one text which has some very long words but i don't need to split word in multiline using hyphen. I just want to add spaces to fit in the line as shown below.
This is my first text for wrapping word
in a file. This text need to be
adjusted and acted based on the table
which need to be modified and tested
basedonthethedata which is given here.
How can i implement it?
Best Answer
Normal Length Words:
One way to do this is to use
\nohypens
from thehyphenat
package. Here is a comparison without (on the left) and with\nohypens
(on the right):Notes:
If you wish to disable hyphenation for the entire document (not that I am recommending that), you can use
Code:
Very Long Words:
If you have really long words, you need to specify where the breaks can occur in the word. Below, I have used a solution from How to break long word containing symbols but with no hyphen? to automatically add a possible break after every letter (the macro is not complete, but the code just needs to be duplicated for each letter/character after which you want to allow a break).
Code: