Text replacement not working

I am trying to set up some shortcuts for LaTeX in pages. I have one for fractions that doesn't work

;frac changed to \frac{}{}

It just replaces with

the result I get is rac{}{} it is not inputing the \f

I tried both typing and pasting and I got the same result

Others like ;mu to \mu is working fine

I'm 80% sure that the problem you are having can be fixed by going into the cogwheel of that action and set the flag "Process Nothing". Your \f needs to be stopped being interpreted by KM as a linefeed, which you can read about on this page:

https://wiki.keyboardmaestro.com/manual/Tokens

That worked, thank you

An alternative -- good for when you want to process some tokens but not others -- is to "escape" things you don't want to be interpreted.

Quoting from the manual:

Using Special Characters as Plain Text

To include a percent in your text, simply double the percent (%%). To include a backslash \ in your text, double the backslash (\).

So:

image

You don't always have to escape the \ -- as you saw with your \m, if what follows can't be interpreted as "special" the \ will be treated as a literal character -- but it's good practice to always escape it so you don't get caught out.

2 Likes