1

I was wondering if there's an Autocorrect feature in TexStudio 2.6.2 that works like in MS Word so that if I have to type a certain word many times, the editor writes it for me as soon as I press spacebar after I finish typing the shortcut for that particular word. (Eg. phl --> photolithography)

I've already searched StackExchange for similar questions and read Qrrbrbirlbel's comment here. I've tried my hand at the Macros but it's not working properly, maybe some bug that needs TeXStudio to re-start for it take action or maybe I simply don't know how to make it work. Can someone help me, please?

  • Does autocompletion is enough for you? For example, I created a personal package containing my most used commands and now when I start to type it the editor completes to me. – Sigur Dec 21 '13 at 13:10
  • Ok, never mind! After some err & try with the Macros, I finally got the knack of it. However I wonder if one can insert a case-sensitivity to the Trigger meaning that if I write Phl (instead of phl) this should yield Photolithography, with the capital P. – WobblyWindows Dec 21 '13 at 14:05
1

From the Macros menu, go to "Edit Macros...". Add a new entry with the "Add" button then type in the specifics of your Macro. Give it a Name for your own ease of use, write the Trigger command (for eg. phl, short for photolithography), select among Normal/Environment/Script (Normal is ok here), then don't forget the crucial step: LaTeX code. In this case I'd type photolithography. Save and close. Then try out your macro, see if it works by writing a couple of sentences that have the trigger word phl and you'll see the Editor replacing it almost immediately with photolithography.

1

If the completion engine (cwl files) or simple macros aren't enough for you, have a look at this scripting example. It's quite straight forward to extend this to case insensitive matching.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.