I have downloaded clrscode3e.sty
file and put it at the corresponding place, it works now. But TeXstudio auto completion fails. How does TeXstudio achieve auto completion? What can I do to enable auto completion for clrscode3e
?
2 Answers
You need a cwl-file which doesn't exist for clrscode3e.sty
in current TeXstudio. See Options->Configure TeXstudio->Auto completion
. You have to create an own one.
-
so how can I find cwl files for
clrscode3e
?How can I create my own one? Commented Jul 24, 2018 at 11:58 -
On Ubuntu they are in
~/.config/texstudio/
and the own one in~/.config/texstudio/complition/user/
– user2478Commented Jul 24, 2018 at 12:06 -
I have found the
cwl
generated by tex studio automatically, but it still can't do auto completion. I have seen the line\proc{arg1}#S
atclrscode3e.cwl
, but when I includeclrscode3e
package and type\pro
, I can't seeproc
at the command list to be selected. Commented Jul 24, 2018 at 12:06 -
I have surprizingly found out that if I change the line
\proc{arg1}#S
to\proc{arg1}
(namely, delete the#S
) or change it to\proc{arg1}#
, tex studio will do the auto completion now. Is it a bug of tex studio that it auto generates wrong cwl files? Commented Jul 24, 2018 at 12:13 -
after trying for some while, I have worked out the way.
according to user manual, go to the TeXstudio config directory:
This directory is placed in ~/.config/texstudio under linux and usually "c:\Documents and Settings/User/AppData/Roaming/texstudio" under windows
then go to sub directory completion\autogenerated
, you can see lots of cwl
files. open one with text editor. If you see some lines end with #S
, this is the cause. If you are using linux, then a single line of sed -i 's/#S$/#/g' *.cwl
should do the trick. If you are using windows, maybe you can checkout cmd scripts to find out how to do it.
according to my experience, either replacing #S
with #
or removing #S
does the trick.
^_^