Dear Jean-Marc, I was using equation to write syntax-highlighted code. So I wanted to write something like this: $\keyword{hello} \comment{this is a comment}$ Which would display as hello // this is a comment Here \comment would be defined as \texttt{\textcolor{green}{#1}}.
Of course in lyx, pressing space whilst inside \comment macro would exit it, so I couldn't directly type the above. This was verry annoying for writing long comments as they would often have lots of words with spaces before them! I don't have this problem anymore, as I am now using the listings package to highlight blocks of code that contain such long comments; but I'm still using math equations to highlight inline code (and just typing ctrl+space on the odd occasion I need a space). — Isaac ________________________________ From: Jean-Marc Lasgouttes <lasgout...@lyx.org> Sent: 15 April 2019 10:16 PM To: Isaac Oscar Gariano; LyX Mechanics Subject: Re: [PATCH] Make math autocorrrect work with more than 2 chars Hi again, Let's go through the remaining issues now. Le 12/04/2019 à 05:23, Isaac Oscar Gariano a écrit : > * It supports unicode input. LyX seems supports this as well, but when > I put '→' in the autocorrect file instead of '\rightarrow' it shows > in lyx with a different font, however it still outputs \rightarrow > in the LaTeX. It would be nice if I could change the font lyx uses > here, so I could at least copy and paste unicode symbols from other > programs. I will pass on this one. Could someone comment on the use of unicode in math? > * It has a simple graphical dialogue for edditing the autocorrect > list. I use this feature quite frequently, so it would be very > annoying to have to restart the program every time I make a simple > change to it. I wanted to implement such a thing for LyX, however I > am not familar with QT, so I decided to be lazy and just add a > reload button. Perhaps instead we should just have a 'reload config' > button that reloads all config files at once, similar to the > existing 'reconfigure' button? I do not like the idea of adding a 'reload file' button. A real dialog would of course be the best solution, but we could also have a file monitor (see support/FileMonitor) that detects when the file has been updated. Or theCorrections could be turned into a function that reloads the corrections if the file has been changed since last use (this might prove expensive, since it requires access to the file system). > * It allows turning on autocorrect in text mode, thus can be quite > convenient. It may be better add a feature to LyX to make such > autocorrects automatically create an equation, e.g. typing '->' in a > text field would generate the latex '$\rightarrow$. I am not sure that I like that. What do others think? > * It triggers autocorrect on space, this is very annoying, lyx on the > other hand applies the autocorrect immediatley! Good :) > * It allows verbatim spaces, which is annoying as I am unable to pass > literal spaces to a user-defined math macro, though it is possible > with the predefined \text macro; I may consider 'fixing' this later. Could you give a use case? > As for the commented out texmacs corrections, I havn't had the time to > go through it, but their are several problems with them: > > * Some refer to commands that lyx dosn't recognise, like \longdashv (I > don't know how to fix this problem). > * They are in the wrong format (they are missing whitespace before the > character that triggers the redirect) > * Prefixes to some of them are allready registered as autocorrects > (e.g. '<=**> \lesseqqgtr' needs to be changed to '\leqq > \lesseqqgtr') OK, it was just a suggestion. More important would be to have new bindings that use the feature. I guess one candidate is -- > \longrightarrow > As for your question: Forget about my questions. They were pointless. JMarc