I have sometimes very long words, which are for example method names and so on.
Is there any possibility to force LaTeX to push them to a new line, if they overflow the margins?
It is possible to push them into a new line, because I know in my document aren't words which are too long for a line.
Here a mini example which produce the problem:
\documentclass{scrartcl}
\begin{document}
\section{Test}
Finally there is a simple solution using \textsc{\textbf{XMLResource.OPTION\_RECORD\_UNKNOWN\_FEATURE}} option. And the
text must go on \ldots.
\par
And another example the show must go on, but we have too less text (\textbf{createUnspecifiedNodeWarningMarker} and
\textbf{createUnspecifiedNodeErrorMarker}, sdjklashjksa \textbf{createUnspecifiedLinkWarningMarker} and
\textbf{createUnspecifiedLinkErrorMarker}).
\end{document}
Thanks for any advices.
\raggedright
would be the best solution. otherwise, if hyphenation is suppressed (which would make the technical terms more comprehensible) many lines will be very badly stretched and thus hard to read.\raggedright
doesn't work with all words. Is there a possibility to disable hyphenation for a region? Withflushleft
I got better results.\begingroup \hyphenpenalty=10000 \exhyphenpenalty=10000 <de-hyphenated text here> \par \endgroup
should satisfactorily isolate the change. if the group doesn't end with a\par
(or a blank line), any salutary effects of changing the penalties could be lost for the last paragraph. and yes,\flushleft
is better here than\raggedright
.\flushleft
it’s an environment{flushleft}
. You likely know that but a other user reading this later my don’t …\sloppypar
suggestion at tex.stackexchange.com/questions/53364/…