## colon document.SUBSCRIPTION_OPTIONS = { "thing": "thread", "subscribed": false, "url": "subscribe", "icon": { "css": "fa fa-envelope-o" } };

TXS - Help
2013-01-10
2013-01-20
• Pat Schweitzer - 2013-01-10

Hi,
since it's probably just my settings, I thought I'd ask here.
In the following minimal example:

\documentclass[]{article}
\begin{document}
$\colon$
\end{document}

\colon is underlined as unrecognized command. How can that be?
(I just activated syntax checking today, so I might have more questions in the future)

• Tim Hoffmann - 2013-01-10

It is unrecognized because it is not specified in any completion file (likely just missing).

Does it require a package or is it basic tex?

• Pat Schweitzer - 2013-01-11

I see. So for a change, I wasn't just too stupid. :-)

I tried to convince you with my minimal example that it
must be the settings and not any packages. So no package
needed. Anyway, while we are at it, the $\lnot$ is also
underlined and it also doesn't require a package.

I have more of these "unrecognized" commands that should
be in, but are not. Do you want me to report them as bugs,
feature requests or is syntax check still in beta?

• Pat Schweitzer - 2013-01-11

Ok, I'll put the ones that I find here. For now I can tell you that the import package isn't properly implemented. I need to use "\subimport" instead of "\include" or "\input". None of the customized commands in the subimported file are recognized.
Furthermore the if package seems to be incomplete. With "\newif" you define the following command, e.g. "\ifapp" which additionally create the commands \appfalse and \apptrue. I'll look at the cwl format later, right now it's just too many unrecognized commands...

• Tim Hoffmann - 2013-01-12

Ok. These two cases currently cannot be handled correctly

1) \subimport has more than one argument. There is currently no way to specify to which of the arguments the cwl format specifiers should apply. We might add this later on. Moreover, we don't have any means in the cwl format to describe how to derive the path.

2) \newif does tricky stuff by defining multiple new commands with composed names. You would need a way to describe this in the cwl. That's also not possible now, and I don't know if it ever will. It is impossible to have a 100% correct coverage of new or renewed commands. That would basically require to mimic the complete TeX compile process. You can simply do too many things with this mechanism.

As a workaround for 2), you can specify your own cwl and hard-code the created commands. e.g.

personal-ifs.cwl:

\ifapp
\appfalse
\apptrue


Place the file in the config directory of TXS (his directory is placed in ~/.config/texstudio under linux and usually "c:\Documents and Settings/User/AppData/Roaming/texstudio" under windows.)

Restart txs. The file appears in Options -> Config -> Completion. Set the checkmark.

Last edit: Tim Hoffmann 2013-01-12
• Pat Schweitzer - 2013-01-14

Oh, thanks for the long answer.

As for 2.) That isn't really bothering me to much. It's just a few commands and your proposed workaround seems to be a really quick fix.

As for 1.) I guess I could put a "copy" of the file in a sub directory to be able to use \include or \input (for now). I'm not a big fan of multiple copies of a file, though. The "\bibliography" command is indicating the path in a similar fashion as \subimport. (Maybe you could also add "Open.." to the subimport command?)

Last, I just recompiled the sources and found a completer test. Maybe this was introduced by taking care of my wishes?...

FAIL! : LatexCompleterTest::simple(simple) '(ist)==(text)' returned FALSE. (equal failed: got ">>\abstractname<<" !=expected ">>\abstractname{}<<" )

Thanks for all the hard work, yet again.

• Tim Hoffmann - 2013-01-14

Please check if the completer check also fails with default settings. It's likely just a result of changed editor settings. The tests are only designed to run against default settings. Otherwise we would have to analyse all settings and determine expected outcomes, e.g. the completion result may depend on your indentation settings. These checks would be a lot of work for a minor benefit.

As for 1.) As far as I understand \bibliography and \subimport do not use the same scheme:

http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management#Getting_current_LaTeX_document_to_use_your_.bib_file:

However, if your .bib file was elsewhere (which makes sense if you intend to maintain a centralized database of references for all your research), you need to specify the path as well, e.g \bibliography{/some/where/sample}.

vs. import-Package documentation:

\subimport{<path_extension>}{<file>}

• Pat Schweitzer - 2013-01-18

This looks very similar, modulo those double brackets, or am I missing something? I would have thought that removing the first closing bracket and anything until and including the next opening bracket and concatenating the stuff in between the outer brackets gives you the path. But you are the expert :-).
Btw. did you include the $\lnot$ and the $\colon$? They still show up as underlined.

• Tim Hoffmann - 2013-01-20

This looks very similar, modulo those double brackets, or am I missing something? I would have thought that removing the first closing bracket and anything until and including the next opening bracket and concatenating the stuff in between the outer brackets gives you the path. But you are the expert :-).

That's not how the parser works. It uses the concept of command and argument(s). \bibliography has one argument which specifies the full (possibily relative) path. \subimport uses two arguments, one for the path and one for the filename.

Btw. did you include the $\lnot$ and the $\colon$? They still show up as underlined.

Just did that now.