10

I have played around with plain tex for a while now and can't figure out how to get back to justified text after e.g. \raggedright. Can it really be that I have to use \raggedright in a group \begingroup\raggedright...\endgroup in order to restore justified text? There has to be a way to get back the original justifying.

edit: I could get something similar to justified texts by using

\spaceskip3pt plus 2pt minus 1pt

But this is not the original justifying.

Henri Menke
  • 109,596
nox
  • 4,160
  • 12
  • 26

1 Answers1

12

Just revert the settings of \raggedright.

\def\justifying{%
  \rightskip=0pt
  \spaceskip=0pt
  \xspaceskip=0pt
  \relax
}

\raggedright

\input knuth

\justifying

\input knuth

\bye

enter image description here

Henri Menke
  • 109,596
  • 1
    +1. Using \begingroup and \endgroup to surround the ragged-right material doesn't seem to be such a bad idea after all... :-) – Mico Jul 08 '18 at 07:00
  • Indeed, but since I am learning, I am trying out things :P Why should I use plain tex nowadays? It's more trying to handle the basics, too. – nox Jul 08 '18 at 07:02
  • @nox, see https://tex.stackexchange.com/questions/7278/reasons-to-use-plain-tex – lhf Jul 08 '18 at 11:57