2

I have a collection of macros that I use. I want to export them, then import them on another computer.

I'm looking for some way to bulk-export my macros.

There are two highly-related questions, but unfortunately neither solves my issue.

The first one only allows me to export a single macro at a time. That's super boring, as I have quite a few. (I guess I could set up and AutoHotKey macro to export my TeXstudio macros!)

The second claims that the macros are stored in texstudio.ini. This doesn't appear to be the case. The post is from 2014, though, so maybe it was true then, but isn't now. Looking in this .ini file, I can see that my macros simply aren't in there. Moreover, I did try copying the .ini file over anyway, backing up the old one, but it didn't work. Additionally, I want to move to a newer version of TeXstudio; the .ini file includes in it the version used, so doesn't seem safe to be using it on a different version.


Dhruv suggests a method which almost works. I'm not exactly sure why it doesn't work, but I have a fix. The macros look fine, including having the correct shortcut. However, I had to go onto Configure TeXstudio... --> Shortcuts --> Macros. All the keyboard shortcuts show there. I had to simply double-click on the command under Current Shortcut, then hit Enter. I'd sometimes get a warning saying that the shortcut is already assigned elsewhere. I just hit Enter/Ok.

1 Answer 1

1

In the folder where you find the texstudio.ini file there will be a folder called 'macros'. You can copy this folder and paste it into your new installation. I haven't tried it but I think it should do the job.

Cheers.

P.S. If you don't mind sharing the macros that you have made, consider sharing them with the community.

3
  • That almost works. And I should have spotted this folder! It correctly fills in the "shortcut" and everything. But when I hit the shortcut, nothing happens! Eg, Ctrl+I in my case should give \textit{, without any closing }. To emphasise, nothing happens. Not even the old \textit{} with the cursor between the {} happens. I've tried closing and reopening. Somewhat confusing. Also, I would share the macros, but they're super boring. Eg, Ctrl+E --> \emph{ Commented Feb 15, 2022 at 18:41
  • Can you share a screenshot of your macros window in TexStudio? Commented Feb 19, 2022 at 13:28
  • I realised that my previous comment was wrong, so deleted it. I did have to do a little more work. I've edited my original question to describe the very simple step I had to do. Commented Feb 25, 2022 at 11:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.