Methods for autocompletion in TexStudio don't work
I've made a mymacros.sty
file which I would like my LaTeX files to be able to access with commands that I've defined. I've managed to get it to work by putting usepackage{mymacros}
in my preamble.
However when I try to autocomplete I can't. I looked at this question:
How can I have TeXstudio recognize my own commands which it already auto-completes?
https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#how-does-txs-know-about-valid-commands), which recommends 3 ways of doing this, none of which work for me.
The first it recommends is to have mymacros.sty
open in the editor. But this doesn't work.
The second is to activate the option Editor
-> Automatically load included files
in the configure TeXstudio
options panel. However while I have an Editor
tab , there is no such option there.
The third is to using .cwl
files, however I'm not sure how to go about this. In the completion tab I've noticed that there is a mymacros.sty
option that has come up, which I ticked but that has had no effect. Do I need to make my own mymacros.cwl
file? I've tried to look this up but haven't had any luck.
Anyone have any ideas? Thanks in advance!
packages texstudio auto-completion
add a comment |
I've made a mymacros.sty
file which I would like my LaTeX files to be able to access with commands that I've defined. I've managed to get it to work by putting usepackage{mymacros}
in my preamble.
However when I try to autocomplete I can't. I looked at this question:
How can I have TeXstudio recognize my own commands which it already auto-completes?
https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#how-does-txs-know-about-valid-commands), which recommends 3 ways of doing this, none of which work for me.
The first it recommends is to have mymacros.sty
open in the editor. But this doesn't work.
The second is to activate the option Editor
-> Automatically load included files
in the configure TeXstudio
options panel. However while I have an Editor
tab , there is no such option there.
The third is to using .cwl
files, however I'm not sure how to go about this. In the completion tab I've noticed that there is a mymacros.sty
option that has come up, which I ticked but that has had no effect. Do I need to make my own mymacros.cwl
file? I've tried to look this up but haven't had any luck.
Anyone have any ideas? Thanks in advance!
packages texstudio auto-completion
Which TeXstudio version are you on? Under theConfigure TeXstudio
options, on the bottom left, there is an option to toggle advanced options. Make sure that is ticked, then check theEditor
tab again.
– Troy
Mar 30 '17 at 15:20
Ah thanks! So I've figured out how to check that box now, but annoyingly its still not working any ideas? My version is 2.12.2.
– Sam Davenport
Mar 30 '17 at 15:34
add a comment |
I've made a mymacros.sty
file which I would like my LaTeX files to be able to access with commands that I've defined. I've managed to get it to work by putting usepackage{mymacros}
in my preamble.
However when I try to autocomplete I can't. I looked at this question:
How can I have TeXstudio recognize my own commands which it already auto-completes?
https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#how-does-txs-know-about-valid-commands), which recommends 3 ways of doing this, none of which work for me.
The first it recommends is to have mymacros.sty
open in the editor. But this doesn't work.
The second is to activate the option Editor
-> Automatically load included files
in the configure TeXstudio
options panel. However while I have an Editor
tab , there is no such option there.
The third is to using .cwl
files, however I'm not sure how to go about this. In the completion tab I've noticed that there is a mymacros.sty
option that has come up, which I ticked but that has had no effect. Do I need to make my own mymacros.cwl
file? I've tried to look this up but haven't had any luck.
Anyone have any ideas? Thanks in advance!
packages texstudio auto-completion
I've made a mymacros.sty
file which I would like my LaTeX files to be able to access with commands that I've defined. I've managed to get it to work by putting usepackage{mymacros}
in my preamble.
However when I try to autocomplete I can't. I looked at this question:
How can I have TeXstudio recognize my own commands which it already auto-completes?
https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#how-does-txs-know-about-valid-commands), which recommends 3 ways of doing this, none of which work for me.
The first it recommends is to have mymacros.sty
open in the editor. But this doesn't work.
The second is to activate the option Editor
-> Automatically load included files
in the configure TeXstudio
options panel. However while I have an Editor
tab , there is no such option there.
The third is to using .cwl
files, however I'm not sure how to go about this. In the completion tab I've noticed that there is a mymacros.sty
option that has come up, which I ticked but that has had no effect. Do I need to make my own mymacros.cwl
file? I've tried to look this up but haven't had any luck.
Anyone have any ideas? Thanks in advance!
packages texstudio auto-completion
packages texstudio auto-completion
edited Apr 13 '17 at 12:36
Community♦
1
1
asked Mar 30 '17 at 14:41
Sam DavenportSam Davenport
816
816
Which TeXstudio version are you on? Under theConfigure TeXstudio
options, on the bottom left, there is an option to toggle advanced options. Make sure that is ticked, then check theEditor
tab again.
– Troy
Mar 30 '17 at 15:20
Ah thanks! So I've figured out how to check that box now, but annoyingly its still not working any ideas? My version is 2.12.2.
– Sam Davenport
Mar 30 '17 at 15:34
add a comment |
Which TeXstudio version are you on? Under theConfigure TeXstudio
options, on the bottom left, there is an option to toggle advanced options. Make sure that is ticked, then check theEditor
tab again.
– Troy
Mar 30 '17 at 15:20
Ah thanks! So I've figured out how to check that box now, but annoyingly its still not working any ideas? My version is 2.12.2.
– Sam Davenport
Mar 30 '17 at 15:34
Which TeXstudio version are you on? Under the
Configure TeXstudio
options, on the bottom left, there is an option to toggle advanced options. Make sure that is ticked, then check the Editor
tab again.– Troy
Mar 30 '17 at 15:20
Which TeXstudio version are you on? Under the
Configure TeXstudio
options, on the bottom left, there is an option to toggle advanced options. Make sure that is ticked, then check the Editor
tab again.– Troy
Mar 30 '17 at 15:20
Ah thanks! So I've figured out how to check that box now, but annoyingly its still not working any ideas? My version is 2.12.2.
– Sam Davenport
Mar 30 '17 at 15:34
Ah thanks! So I've figured out how to check that box now, but annoyingly its still not working any ideas? My version is 2.12.2.
– Sam Davenport
Mar 30 '17 at 15:34
add a comment |
2 Answers
2
active
oldest
votes
I'm afraid I can't exactly diagnose your problem , but you can create your own .cwl
file. Hopefully this is an acceptable alternative.
Reference: http://texstudio.sourceforge.net/manual/current/usermanual_en.html#CWLDESCRIPTION
1) The first step is to find the directory where the .cwl
files are stored.
If you're on Windows, the custom .cwl
files are stored in .AppDataRoamingTeXstudiocompletionuser
directory. If in doubt, go to Help
->Check LaTeX installation
from within TeXstudio and search for Setting file
. The directory should be printed out for you.
2) Go to Notepad or any other text editor (TeXstudio works too!). The command syntax for the .cwl
file is as follows:
<command>[#classification]
For a list of classification styles and what they do, refer to the link above, section 4.13.3. For now, try adding just one line to the text file:
ThisIsMyCommand#n
and save it with a file name of your choice. As far as I know, this doesn't have to coincide with your .sty
name, so let's choose randomcwl.cwl
as a file name. Ensure that it is .cwl
file.
3) Go ahead and place this file into your .cwl
directory from Step 1.
4) Now, if you go to Configure TeXstudio
-> Completion
, You'll find the random.cwl
choice has popped up. Check the box.
5) And test it out!
I already tried this and still can't get TeXstudio to autocomplete my macros when using a mymacros.sty file... maybe is a bug in 2.12.8?
– Saavestro
Apr 16 '18 at 19:31
1
@Saavestro No, I tried on 2.12.8 and it works. More details are probably needed -- if it's going to be exclusively a TXS issue, I would suggest opening an issue on the project Github page instead of on Stackexchange (more appropriate, and more likely to receive proper help)
– Troy
Apr 16 '18 at 22:01
add a comment |
I had the same issue. Since the macros defined in style file didn't appear in auto completion, I copied them in the main file (just temporarily) and it works fine. It's a simple workaround though not the best solution.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f361259%2fmethods-for-autocompletion-in-texstudio-dont-work%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I'm afraid I can't exactly diagnose your problem , but you can create your own .cwl
file. Hopefully this is an acceptable alternative.
Reference: http://texstudio.sourceforge.net/manual/current/usermanual_en.html#CWLDESCRIPTION
1) The first step is to find the directory where the .cwl
files are stored.
If you're on Windows, the custom .cwl
files are stored in .AppDataRoamingTeXstudiocompletionuser
directory. If in doubt, go to Help
->Check LaTeX installation
from within TeXstudio and search for Setting file
. The directory should be printed out for you.
2) Go to Notepad or any other text editor (TeXstudio works too!). The command syntax for the .cwl
file is as follows:
<command>[#classification]
For a list of classification styles and what they do, refer to the link above, section 4.13.3. For now, try adding just one line to the text file:
ThisIsMyCommand#n
and save it with a file name of your choice. As far as I know, this doesn't have to coincide with your .sty
name, so let's choose randomcwl.cwl
as a file name. Ensure that it is .cwl
file.
3) Go ahead and place this file into your .cwl
directory from Step 1.
4) Now, if you go to Configure TeXstudio
-> Completion
, You'll find the random.cwl
choice has popped up. Check the box.
5) And test it out!
I already tried this and still can't get TeXstudio to autocomplete my macros when using a mymacros.sty file... maybe is a bug in 2.12.8?
– Saavestro
Apr 16 '18 at 19:31
1
@Saavestro No, I tried on 2.12.8 and it works. More details are probably needed -- if it's going to be exclusively a TXS issue, I would suggest opening an issue on the project Github page instead of on Stackexchange (more appropriate, and more likely to receive proper help)
– Troy
Apr 16 '18 at 22:01
add a comment |
I'm afraid I can't exactly diagnose your problem , but you can create your own .cwl
file. Hopefully this is an acceptable alternative.
Reference: http://texstudio.sourceforge.net/manual/current/usermanual_en.html#CWLDESCRIPTION
1) The first step is to find the directory where the .cwl
files are stored.
If you're on Windows, the custom .cwl
files are stored in .AppDataRoamingTeXstudiocompletionuser
directory. If in doubt, go to Help
->Check LaTeX installation
from within TeXstudio and search for Setting file
. The directory should be printed out for you.
2) Go to Notepad or any other text editor (TeXstudio works too!). The command syntax for the .cwl
file is as follows:
<command>[#classification]
For a list of classification styles and what they do, refer to the link above, section 4.13.3. For now, try adding just one line to the text file:
ThisIsMyCommand#n
and save it with a file name of your choice. As far as I know, this doesn't have to coincide with your .sty
name, so let's choose randomcwl.cwl
as a file name. Ensure that it is .cwl
file.
3) Go ahead and place this file into your .cwl
directory from Step 1.
4) Now, if you go to Configure TeXstudio
-> Completion
, You'll find the random.cwl
choice has popped up. Check the box.
5) And test it out!
I already tried this and still can't get TeXstudio to autocomplete my macros when using a mymacros.sty file... maybe is a bug in 2.12.8?
– Saavestro
Apr 16 '18 at 19:31
1
@Saavestro No, I tried on 2.12.8 and it works. More details are probably needed -- if it's going to be exclusively a TXS issue, I would suggest opening an issue on the project Github page instead of on Stackexchange (more appropriate, and more likely to receive proper help)
– Troy
Apr 16 '18 at 22:01
add a comment |
I'm afraid I can't exactly diagnose your problem , but you can create your own .cwl
file. Hopefully this is an acceptable alternative.
Reference: http://texstudio.sourceforge.net/manual/current/usermanual_en.html#CWLDESCRIPTION
1) The first step is to find the directory where the .cwl
files are stored.
If you're on Windows, the custom .cwl
files are stored in .AppDataRoamingTeXstudiocompletionuser
directory. If in doubt, go to Help
->Check LaTeX installation
from within TeXstudio and search for Setting file
. The directory should be printed out for you.
2) Go to Notepad or any other text editor (TeXstudio works too!). The command syntax for the .cwl
file is as follows:
<command>[#classification]
For a list of classification styles and what they do, refer to the link above, section 4.13.3. For now, try adding just one line to the text file:
ThisIsMyCommand#n
and save it with a file name of your choice. As far as I know, this doesn't have to coincide with your .sty
name, so let's choose randomcwl.cwl
as a file name. Ensure that it is .cwl
file.
3) Go ahead and place this file into your .cwl
directory from Step 1.
4) Now, if you go to Configure TeXstudio
-> Completion
, You'll find the random.cwl
choice has popped up. Check the box.
5) And test it out!
I'm afraid I can't exactly diagnose your problem , but you can create your own .cwl
file. Hopefully this is an acceptable alternative.
Reference: http://texstudio.sourceforge.net/manual/current/usermanual_en.html#CWLDESCRIPTION
1) The first step is to find the directory where the .cwl
files are stored.
If you're on Windows, the custom .cwl
files are stored in .AppDataRoamingTeXstudiocompletionuser
directory. If in doubt, go to Help
->Check LaTeX installation
from within TeXstudio and search for Setting file
. The directory should be printed out for you.
2) Go to Notepad or any other text editor (TeXstudio works too!). The command syntax for the .cwl
file is as follows:
<command>[#classification]
For a list of classification styles and what they do, refer to the link above, section 4.13.3. For now, try adding just one line to the text file:
ThisIsMyCommand#n
and save it with a file name of your choice. As far as I know, this doesn't have to coincide with your .sty
name, so let's choose randomcwl.cwl
as a file name. Ensure that it is .cwl
file.
3) Go ahead and place this file into your .cwl
directory from Step 1.
4) Now, if you go to Configure TeXstudio
-> Completion
, You'll find the random.cwl
choice has popped up. Check the box.
5) And test it out!
answered Mar 30 '17 at 16:59
TroyTroy
11k62367
11k62367
I already tried this and still can't get TeXstudio to autocomplete my macros when using a mymacros.sty file... maybe is a bug in 2.12.8?
– Saavestro
Apr 16 '18 at 19:31
1
@Saavestro No, I tried on 2.12.8 and it works. More details are probably needed -- if it's going to be exclusively a TXS issue, I would suggest opening an issue on the project Github page instead of on Stackexchange (more appropriate, and more likely to receive proper help)
– Troy
Apr 16 '18 at 22:01
add a comment |
I already tried this and still can't get TeXstudio to autocomplete my macros when using a mymacros.sty file... maybe is a bug in 2.12.8?
– Saavestro
Apr 16 '18 at 19:31
1
@Saavestro No, I tried on 2.12.8 and it works. More details are probably needed -- if it's going to be exclusively a TXS issue, I would suggest opening an issue on the project Github page instead of on Stackexchange (more appropriate, and more likely to receive proper help)
– Troy
Apr 16 '18 at 22:01
I already tried this and still can't get TeXstudio to autocomplete my macros when using a mymacros.sty file... maybe is a bug in 2.12.8?
– Saavestro
Apr 16 '18 at 19:31
I already tried this and still can't get TeXstudio to autocomplete my macros when using a mymacros.sty file... maybe is a bug in 2.12.8?
– Saavestro
Apr 16 '18 at 19:31
1
1
@Saavestro No, I tried on 2.12.8 and it works. More details are probably needed -- if it's going to be exclusively a TXS issue, I would suggest opening an issue on the project Github page instead of on Stackexchange (more appropriate, and more likely to receive proper help)
– Troy
Apr 16 '18 at 22:01
@Saavestro No, I tried on 2.12.8 and it works. More details are probably needed -- if it's going to be exclusively a TXS issue, I would suggest opening an issue on the project Github page instead of on Stackexchange (more appropriate, and more likely to receive proper help)
– Troy
Apr 16 '18 at 22:01
add a comment |
I had the same issue. Since the macros defined in style file didn't appear in auto completion, I copied them in the main file (just temporarily) and it works fine. It's a simple workaround though not the best solution.
New contributor
add a comment |
I had the same issue. Since the macros defined in style file didn't appear in auto completion, I copied them in the main file (just temporarily) and it works fine. It's a simple workaround though not the best solution.
New contributor
add a comment |
I had the same issue. Since the macros defined in style file didn't appear in auto completion, I copied them in the main file (just temporarily) and it works fine. It's a simple workaround though not the best solution.
New contributor
I had the same issue. Since the macros defined in style file didn't appear in auto completion, I copied them in the main file (just temporarily) and it works fine. It's a simple workaround though not the best solution.
New contributor
New contributor
answered 12 mins ago
user243439user243439
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f361259%2fmethods-for-autocompletion-in-texstudio-dont-work%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Which TeXstudio version are you on? Under the
Configure TeXstudio
options, on the bottom left, there is an option to toggle advanced options. Make sure that is ticked, then check theEditor
tab again.– Troy
Mar 30 '17 at 15:20
Ah thanks! So I've figured out how to check that box now, but annoyingly its still not working any ideas? My version is 2.12.2.
– Sam Davenport
Mar 30 '17 at 15:34