LyXtex import omits spaces before insets (Lyx 2.3)

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
rmtfleming
Posts: 2
Joined: Fri Jan 17, 2020 1:22 pm

tex import omits spaces before insets (Lyx 2.3)

Post by rmtfleming »

When I import a tex file, the resulting lyx file omits the spaces before insets

e.g. where $c\in\mathbb{R}_{\ge0}^{n}$

becomes

where$c\in\mathbb{R}_{\ge0}^{n}$

in the code pane of lyx, and in the source file

where
\begin_inset Formula $c\in\mathbb{R}_{\ge0}^{n}$
\end_inset

rather than

where
\begin_inset Formula $c\in\mathbb{R}_{\ge0}^{n}$
\end_inset

which it should be. Note that in the latter, there is a space after 'where'. Is there some setting to get around this or is it a bug of some sort?

#LyX 2.3 created this file.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

rmtfleming
Posts: 2
Joined: Fri Jan 17, 2020 1:22 pm

tex import omits spaces before insets (Lyx 2.3)

Post by rmtfleming »

Here is a workaround using atom editor (https://atom.io/) to open the lyx file as a text file:

Find and Replce with Regex option (.* button to top right of Find button) selected.

Find (regex)

\n\\begin_inset

Replace (note space at the beginning)

 \n\\begin_inset

Some replacements change

\begin_layout Standard
\begin_inset Formula

to

\begin_layout Standard
\begin_inset Formula

(with a space after Standard) and lyx complains that it cannot find the layout standard. Perhaps a regex expert can refine this workaround to avoid this.
Post Reply