1

I would like to emulate a 'justify' environment as seen in most WYSIWYG editors.

  • Each line should extend its spacing to fit the maximum possible width.
  • No words should be hyphenated. (Using \hbox or hyphenat has not worked due to items extending over the page margins).

How do I achieve this? I've had no luck so far with ragged2e.

Example of justified paragraph in Microsoft Word.

1 Answers1

3

I'm not sure why one would strive for bad typesetting such as what you get from word processors when you disable hyphenation.

Anyway…

\documentclass{article}
\usepackage{fontspec}

\usepackage{lipsum}

\setmainfont{Calibri}

% how to obtain bad typesetting \hyphenpenalty=10000 \exhyphenpenalty=10000 \emergencystretch=\maxdimen %%%

\frenchspacing % no extended end-of-sentence space

\begin{document}

%%% % just to reproduce your column width, not something % to be used in real documents \settowidth{\hsize}{Contrary to popular belief, Lorem ipsum} %%%

\noindent\lipsum[1]

\end{document}

enter image description here

egreg
  • 1,121,712