1

This question already has an answer here:

I have been a writing a simple program using TeX programming like

Hello, World!
How are you.
\bye

I want the two sentences to in different lines but they come in same line. Using \\ it gives an error undefined control sequence. How can it be shifted to new line and also how to start a new paragraph?

marked as duplicate by Svend Tveskæg, Jesse, user31729, Malipivo, Andrew Swann Jan 4 '15 at 9:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I am asking about TeX and not LaTeX, I know using \\ will shift me to the next line in LaTeX and how this would be done in TeX? – Mistha Jan 4 '15 at 7:20
  • By different lines you're probably referring to \par (after Hello, World!). – Werner Jan 4 '15 at 7:26
  • Yes, done for that :) How to shift new paragraph? – Mistha Jan 4 '15 at 7:31
  • 1
    @luneart - the query is about creating simple documents using Plain TeX, not LaTeX. – Mico Jan 4 '15 at 8:54
  • 1
    The duplicate should be tex.stackexchange.com/q/53/15925 – Andrew Swann Jan 4 '15 at 9:55
7

The basic structural element of a typeset document is the paragraph. TeX separates paragraphs by \par command which is automatically inserted at each empty line in source document (when the common catcode settings are done). Thus, you can try two approaches:

5

Use \par to start a new paragraph (or leave a blank line between text blocks):

Hello, World!

How are you.
\bye

or

Hello, World!\par
How are you.
\bye

Alternatively, but highly unlikely, use \obeylines:

\obeylines
Hello, World!
How are you.
\bye
0

I advise you to consult the introduction on Latex, see this post or directly The (not so) short introduction to LaTeX2e.

The particular answer to your question is to use \\ or \newline.

  • 2
    IMHO, OP needs the introduction to TeX, no to LaTeX. – wipet Jan 4 '15 at 7:17
  • @wipet After all, OP is specifically asking about Plain :) – Sean Allred Jan 4 '15 at 8:01
  • well, my answer was made before the edits :) – luneart Jan 4 '15 at 9:05
  • 1
    @luneart The MWE in version one is clearly for plain! – Joseph Wright Jan 4 '15 at 9:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.