I got the following example:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[brazil]{babel}
\usepackage{array,ragged2e}
\begin{document}
\section{Riscos}
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.0cm}|p{2.0cm}|p{2.5cm}|p{2.5cm}|}
\hline Riscos & Probabilidade & Impacto & Prioridade & Resposta & Prevenção \\ \hline
\hline Problemas com notebook & Baixa & Médio & Alta & Usar desktop & Manutenção preventiva \\
\hline Problemas com o desktop & Baixa & Alto & Alta & Usar o labUFSC & Manutenção preventiva \\
\hline Problemas com perda de dados & Baixa & Alto & Alta & Uso do backup & Backup periódicos \\
\hline Problemas de Saúde & Baixa & Alto & Alta & Tratamento adequado & Cuidados diários apropriados \\ \hline
\end{tabular}
\end{document}
Which generates this PDF:
The letter o as pointed on the image, must not be placed/justified on the right of the space. I think latex should be able to identify such aberration.
My question is, are there some way to force latex automatically not justify the text when the words are too much sparse like on the example just above?
I searched a lot and found that I can manually force some words to not be badly justified, however I do not like the idea to do such manually because it could be done automatically by latex itself, when certain conditions are meet, i.e. certain spacing limits are crossed.
Update
Answering the comment, I would to like latex to not justify the words if they go beyond a minimum width, and accordingly to the character count of the current line.
For example, if the line has less than 50 characters and the justification will create a hole bigger than something as 30 pixels or 6 characters, therefore the justification must not be applied for that line.




\raggedright(or\RaggedRight) if and only if the justification gets “too much” bad, with “too much” specified in same (even rigorous) way. Unfortunately, I’m afraid that this clashes with a known limitation of TeX: that it provides no primitive to know, at run time, the total cost of line breaking in the most recent paragraph… See @gernot’s answer for a solution that always uses\raggedright/\RaggedRight. – GuM Apr 20 '17 at 23:46raggedrightif they are too underful. See section 5.9.6. Perhaps this method would be suitable? – David Purton Apr 20 '17 at 23:50This macro can be called as "\vbox{ ... some text ... \par\eatlines}" or it can be inserted automatically with \everypar. How would I use that \everypar? May be I should open a new question? – user Apr 21 '17 at 00:10\lastboxcan't be used in normal text. It needs to be in the\vbox. But by all means ask others. – David Purton Apr 21 '17 at 00:18\everyparon https://tex.stackexchange.com/questions/365818/how-could-the-everypar-justification-statement-be-used – user Apr 21 '17 at 02:21\linespread{1.5}. Then I would just how to figured it out how to change its value inside the table. – user Apr 23 '17 at 22:49