5

When I enter this

C = B log(1+SNR)
270.88 = 200 log(1+SNR)

The two lines are printed on the same line. I can force a line break by using \\ but this is very annoying. Is there a way to automatically force a line break after every newline in the source?

5
  • 2
    Is this material to be typeset as code (a listing) or as an equation (possibly with alignment)? Mar 10, 2015 at 1:02
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – cfr
    Mar 10, 2015 at 1:03
  • Maybe you want the listings package? If you are using LaTeX, that is.
    – cfr
    Mar 10, 2015 at 1:04
  • 1
    A suggestion: Do us a favour and change your username to something more telling than "user1234". Mar 10, 2015 at 1:12
  • I might add that another option is the verbatim environment (no package needed). Mar 10, 2015 at 2:01

1 Answer 1

13

Use \obeylines. In this way every line break in the source is a line break in the output. If you need this behavior locally, encase it in braces, like {\obeylines...}.

\documentclass{article}

\begin{document}
\obeylines
Some text
Some text in a new line
\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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