# Pasting latex in a lyx file

Rich Shepard rshepard at appl-ecosys.com
Wed Apr 7 14:24:54 UTC 2021

On Wed, 7 Apr 2021, Mario D wrote:

> sometime I need to paste some latex code inside a lyx file. When I do
> this, I lose all the formatting and, in particular, I lose all new lines:
> this means that what I end up with in my red box in lyx is a complete mess
> which requires a lot of editing.
>
> This is quite annoying: am I missing something which results in this
> behaviour?

Mario,

Perhaps you are, but we need you to be more specific. You write about
pasting LaTeX code into a LyX document. This can be two things:

1) You want to enter a LaTeX command, e.g., \hspace{1.5cm} in an ERT box
with a red border.

2) You are inserting multiple lines of text that are to be printed verbatim
using the LyX-code environment.

If you are referring to 1 above, please provide a minimal working example of
what you've done, the output that produces, and what you want that's
different.

HTH,

Rich