9

I am trying to find a way to enable spell-check in cases such as:

\remark[I don't understend this]{$2+5=7$}

I found something that might look as an answer but it sadly does not work ... In 'configure TexStudio' -> 'editor' I unchecked both 'hide spelling errors in non-text ..' and 'hide grammar in ...'.

  • Thank you Andrew. (I think you suggest that my message is a little crude ? But I don't want to somehow pollute the question with politeness). – cglacet Apr 16 '15 at 14:45
  • @ChristianG. No, Andrew suggests that you are asking the first time here and welcomes you to our community. You are on the right way with your 'lag of politeness' (meta.tex.stackexchange.com/q/3602). No worries. Back to topic: I am having the same issue here. Please check for existing issues or write a new one here: sourceforge.net/p/texstudio/bugs – LaRiFaRi Apr 16 '15 at 15:22
  • 1
    Even with both of these options switched off, TeXStudio won't see an error in \understend[understend]{understend}. So you could ask more in general than just for optional parameters. – LaRiFaRi Apr 16 '15 at 15:25
  • @LaRiFaRi: Wow, you are right, I just tested it and it seems like the problem acutally comes from the fact that this is a personalized command... strange. I don't know if I can edit my message but I'll try. Thank you for your comment. Or maybe someone already asked this different question :). – cglacet Apr 16 '15 at 16:09
6

If I understand the problem correctly, when you add a user-defined command, like in my case \remark, TexStudio somehow add this new command to a known-commands list. (Thereby it is able to manage auto-completion on user-defined commands.) But when it does so, it cannot guess the type of parameters that your command is supposed to take. I don't know what happens precisely here, but for sure the default comportment is not to consider that your new command takes text as parameter.

Therefore, if you want, as I did, to add a new command that will have some text as parameter you have to create a .cwl file in order to explicitely specify the type of your command's parameter. In my case I added a file mycommands.cwl to ~/.configure/texstudio/. In this file for now I only have a single line:

\remark[text]{text}

After doing this, once you restart TexStudio, you can go to Options -> Configure TexStudio -> Completion and check mycommands.cwl. Now you command is recognized as having text for both parameters and TexStudio will thus spellcheck its content.


For more information on .cwl file format you can refer to TexStudio's manual.

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.