# ConTeXt equivalent to LaTeX's \linebreak with full justification

In Latex, the following MWE:

\documentclass{article}

\begin{document}
Hello World\linebreak
Hello World\linebreak
Hello World\linebreak
Hello World
\end{document}


leaves each line fully justified (to horrible effect).

But In ConTeXt, neither \crlf, nor \\, nor any of the documented line delimiters seem to have this behaviour:

\starttext
Hello world \crlf
Hello world \\
Hello world | |
Hello world
\stoptext


I've scoured the wiki and looked through the reference manual for a solution, unsuccesfully.

• Did you try \break? Hello world\break seems to do. Jul 17 '15 at 22:03
• Thanks, you're right. Not one mention of it in a 350+ pg reference manual, nor the wiki. Goodbye, ConTeXt. Jul 17 '15 at 22:10
• @JaredKulik: \break is defined in plain TeX. Like LaTeX, ConTeXt also includes many macros that are defined in plain TeX without documenting them. Jul 19 '15 at 1:47
• BTW, why do you want to do this? See the XY problem. There may be more canonical way to achieve the desired effect in ConTeXt. Jul 19 '15 at 1:51
• @Aditya, Duly noted. LaTeX does offer and document its own way of doing it even if TeX can be used, ConTeXt doesn't and I was left scratching my head. Not worth arguing over. Jul 19 '15 at 12:33

As @egreg noted, \break does the job.

• Note that \break is essentially \penalty-10000, so it will also cause a page break if issued between paragraphs. Jul 18 '15 at 5:38
• @egreg: IIUC, \linebreak is essentially \penalty-1000 followed by \hskip \lastskip if \lastskip > 0pt. In the LaTeX example included in the MWE above, wont \linebreak also expand to penalty -1000? Jul 19 '15 at 1:50
• @Aditya but this isn't about linebreak, it's about a break that does not break a page with the startlinealignment environment. Of course there is pagebreak, but that's not the point. And one also has \hbox to \hsize bla bla \break, but that's not the point either. Also, I'm getting a Lua linebreak filter failed reverting to default ad infinitum here. Any insights about it, your majesty? :)
– doed
Jul 19 '15 at 12:57

To justify a single line of text you use \maxaligned or \startmaxaligned. For the same effect for the last line in a paragraph you can use the paragraph keyword for the \startalignment environment.

\starttext

\startlinealignment[max]
Hello world
\stoplinealignment

% \startmaxaligned
% Hello world
% \stopmaxaligned
%
% \maxaligned{Hello world}

\startalignment[paragraph]
\input ward
\stopalignment

\stoptext


• I don't think this answers the question. Jul 18 '15 at 5:36