3

I'm using TeXstudio 3.1.1 (git 3.1.1) on Windows 10 to write a TeX document with BibLaTeX bibliography. The document uses this KOMA thesis template.

To support using acronyms, I use the acronym package. While TeXstudio usually is great in recommending and auto-completing commands as I type, it does not recommend the \ac{} command, which I need really frequently for my acronyms. In fact, it always suggests another command \acute{}, such that I always have to press ESC to cancel auto-complete to \acute{} and then manually type \ac{}. This is quite slow and annoying given that I need the command so often.

Any way to have TeXstudio correctly auto suggest and complete the acronym commands (like \ac{})?

2 Answers 2

4

Make sure the auto-completion file for the acronym package is loaded, if that isn't the case for some reason.

You can achieve this by keeping the file containing \usepackage{acronym} open, as you suggested in your own answer,
or by having acronym.cwl permanently active (which may be especially useful for bigger projects like theses, where every open tab is a possible distraction).

Simply check the respective box under Options > Configure TeXstudio... > Completion:

enter image description here

(setting your main .tex file as Root Document should do the trick as well, I think)

1
  • That configuration option in TeXstudio is good to know - the best solution from my view! Btw, in my case, my main .tex is different from the premable.tex, in which I do the "imports", so setting my main.tex as Root Document didn't suffice here. But I guess that's a special case. Apr 19, 2021 at 12:09
3

TL;DR: Open the file in TeXstudio, where the package is imported with \usepackage{} to ensure that TeXstudio's auto complete works for that package.


As I was typing this question, I figured out the answer by accident. It's highly specific to my case, but I'll post it anyways in case it helps someone.

The issue is that I import acronyms with \usepackage{acronyms} not in my main document but in a separate preamble.tex. If this preamble is not open in TeXstudio, the auto suggest and complete does not work. Once I open the preamble in the editor, auto suggestion for \ac{} and all other acronyms commands works fine - until I close the preamble and restart TeXstudio.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .