2

I am looking to copy many whatsapp chats into a document and retain the linebreaks. If I just copy them in, then there are no linebreaks. How do I do this? Thanks

Verbatim (alone) doesn't work because it means text flows off the page

Just using \obeylines worked perfectly

Greg
  • 21
  • Welcome to TeX.SX! I think this isn't a LaTeX related question or could you explain the problem with latex? – Bobyandbob Nov 17 '17 at 14:51
  • 1
    @Bobyandbob I suspect the user wants just to keep line breaks as \obeylines or similar would do, but this question is rather unclear. – TeXnician Nov 17 '17 at 15:10
  • 1
    related: https://tex.stackexchange.com/questions/266713/resemble-popular-messenger-with-latex-macros – cgnieder Nov 17 '17 at 15:23
  • Can you add some examples of what your input text looks like? I mean the text you copied into your .tex document and are trying to typeset. – ShreevatsaR Nov 17 '17 at 17:42

1 Answers1

3

Put it into a verbatim environment. \begin{verbatim} whatsapptext \end{verbatim}.


EDIT:

So you don't want linebreak, except in all cases where lines that are longer than let's say 72 letters? Please provide an example as »MWE«. Probably the easiest way might be to use your editor's search and replace function:

Swap each end-of-line sign with a double backslass \\. Then try instead of the verbatim environment the verse environment. However, it would be much easier if we had an MWE.

Keks Dose
  • 30,892
  • 1
    @Greg Then please accept my answer, because then the question no longer remains in the list of unanswered questions. – Keks Dose Nov 17 '17 at 14:56
  • 1
    @KeksDose a question is only on the unanswered list if it has no upvoted answer – cgnieder Nov 17 '17 at 15:22
  • I'm recieving this error seemingly with longer conversations. Do you know how to fix this? Package inputenc Error: Unicode char ‍ (U+200D) (inputenc) not set up for use with LaTeX.

    See the inputenc package documentation for explanation. Type H for immediate help. ...

    l.204 \end{verbatim}

    – Greg Nov 17 '17 at 15:22
  • Wait, this actually doesn't work, because it means that the text flows off the page for some reason? – Greg Nov 17 '17 at 15:31