[Tex/LaTex] TexStudio: How to use default icon for user command in toolbar
texstudio
I defined a user command like this
And I add it to custom toolbar
But you see the icon is
What I want is to use icon of Pdflatex, like that in the "Tools" menu
How to do this?
Best Answer
Getting the Icon:
The easiest way should be taking a screenshot. As the symbol will be displayed very small, bad quality should not matter that much. Maybe consider removing the background colour with a tool like gimp to get a transparent background.
Getting it from the source of TeXStudio. Once downloaded the source ball contains a folder images-ng where all the icons can be found in .svgz format (alternatively it can be found online at https://sourceforge.net/p/texstudio/hg/ci/default/tree/images-ng/compile-pdf.svgz). Converting it to .png can be done e.g. with inkscape or google can find you online services to do so.
Replacing the Icon:
In the preference menu, you can change the icon simply with a right click.
Remark:
Keep the image in the location you selected it from, otherwise you end up with a non existing icon - or in other words an empty space in the toolbar, you can only guess what command it is for.
Actually, it's not you who is missing something, but the Custom Highlighting. It's an unfinished feature. See the FAQ for what it can(not) do.
If it's just about telling the syntax checker, you should use a custom cwl file. Note, that TXS autogenerates a cwl file by inspecting the package. But this mechanism is not perfect due to the complexity of LaTeX. Therefore it may not find all specified commands. You are welcome to take this cwl as a starting point, add the missing commands and provide it to us, so we can include it in TXS.
For instance, to tell the syntax checker and completer that there is the compactenum environment, just add the following line to your custom cwl file:
You could add a user defined tool. Open the preferences and go to build. In the lower part of the window you can add user commands. If you make sure that your batch file is executable it should work if you add the path and name as command.
The new macro then is available via Tool > User or you can assign a short cut in the preferences.
Best Answer
Getting the Icon:
The easiest way should be taking a screenshot. As the symbol will be displayed very small, bad quality should not matter that much. Maybe consider removing the background colour with a tool like
gimp
to get a transparent background.Getting it from the source of TeXStudio. Once downloaded the source ball contains a folder
images-ng
where all the icons can be found in.svgz
format (alternatively it can be found online at https://sourceforge.net/p/texstudio/hg/ci/default/tree/images-ng/compile-pdf.svgz). Converting it to.png
can be done e.g. withinkscape
or google can find you online services to do so.Replacing the Icon:
In the preference menu, you can change the icon simply with a right click.
Remark:
Keep the image in the location you selected it from, otherwise you end up with a non existing icon - or in other words an empty space in the toolbar, you can only guess what command it is for.