texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Support custom class (cls) file detection/parsing

Open stepo2 opened this issue 4 weeks ago • 0 comments

Describe the feature and the current behavior/state

I have a document using a custom class (cls file). However, TeXstudio does not really support class files as it seems.

For example:

\documentclass{myclass}

will not allow me to CTRL-click on "myclass" to open the cls file (which sits in the same folder than the tex file).

Another example: Opening my project in TeXstudio and then opening the cls file alongside and pressing the compile button when the cls file tab is active will result in errors (because it tries to compile the cls file). So it totally leaves the project scope in the cls file.

Another example: The commands I defined in my class are also not recognized by TeXstudio, so it also does not parse the cls file at all as it seems.

I also found no setting to specify lookup paths for cls files or add custom cls files to the configuration.

It would be nice if TeXstudio could provide basic support for reading custom classes so that basic syntax highlighting and ctrl-click behaviour works as it does in regular tex files. For the basic stuff it should be enough to treat a cls files like any other included regular tex file. If I copy-paste my cls-defined commands to a tex file and \input it, the commands are recognized and I can ctrl-click on the file, so having the exact same mechanism for cls files in \documentclass would be a good start.

I know there's CWL files, but my request here is to support the basic regular stuff that works out-of-the-box for tex files also for cls files.

Who will benefit with this feature?

Everyone writing/using custom classes.

stepo2 avatar Jun 21 '24 10:06 stepo2