LyXSearch for missing blanks after math environments

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
kai2nd
Posts: 4
Joined: Fri Mar 22, 2019 11:47 am

Search for missing blanks after math environments

Post by kai2nd »

Hi all!

I've been using LyX for a while now for collaborative writing, especially for the support of tracked changes and commenting. It has made life a whole lot easier! But here's something I haven't been able to figure out:

Quite often, blank characters (space) is missing following an inline math equation. The way LyX sets this, it's not always easy to detect visually. So what I want is to automatically find inline math followed by anything but the blank character. Is there a way to do this in LyX?

Best wishes
Kai

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
kai2nd
Posts: 4
Joined: Fri Mar 22, 2019 11:47 am

Search for missing blanks after math environments

Post by kai2nd »

Hm, so nobody knows? Then maybe it's not possible.
Can you point me to another LyX Forum where I might get an answer?

cheers,
Kai
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Search for missing blanks after math environments

Post by Ijon Tichy »

I even do not understand your problem. I'm not a LyX user and for me your description is not very clear. Maybe it is that you try to insert the space at the end of the math instead of after the math? However, for another LyX forum see https://www.lyx.org/MailingLists.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
kai2nd
Posts: 4
Joined: Fri Mar 22, 2019 11:47 am

Search for missing blanks after math environments

Post by kai2nd »

Hi Ijon,

thanks for the feedback, that's good to know.

So let me try to be clearer:

I have a long document with lots of inline math equations ($…$ in LaTeX) where there is no blank following the equation (in LaTeX, this will look like this: "$…$next word" but I want "$…$ next word").

As this is a recurring issue for me, I would like to do a search and replace which finds all occurrences or these "missing blanks" and fills in the missing blank.

Thanks also for the pointer to the mailing list, I'll hold off posting there for a while – maybe my problem is clearer now.

Kai
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Search for missing blanks after math environments

Post by Ijon Tichy »

LyX files are simple text documents (like LaTeX). So you should be able to write e.g. a pearl or awk script to fix such code. However, if you do not want the space, e.g., at »$NP$-complete«, such an automatic correction would break things. So, already input correctly would always be better than trying to fix wrong input afterwards.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
kai2nd
Posts: 4
Joined: Fri Mar 22, 2019 11:47 am

Search for missing blanks after math environments

Post by kai2nd »

I like the idea of coming up with a script to fix this. If I come up with something useful, I'll report back.
Thanks Ijon!
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Search for missing blanks after math environments

Post by scottkosty »

Perhaps you will find it useful to do Tools > Preferences > Look & Feel > Display > "Mark end of paragraphs".
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Search for missing blanks after math environments

Post by scottkosty »

Note that this issue is reported at https://www.lyx.org/trac/ticket/8252. Please post there if you have any suggestions.
Post Reply