Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newcommand marked as error if used once in if clause and once in else clause (for the same environment) #3580

Open
efrancis opened this issue Jun 11, 2024 · 0 comments
Labels
bug Deficiencies in TeXiFy behaviour.

Comments

@efrancis
Copy link

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

PhpStorm 2024.1.3

Operating System

MacOS Sonoma 14.5

TeXiFy IDEA version

0.9.6

What I did (steps to reproduce)

  • create an ifthenelese environment
  • in both if and else clause define the same command with \newcommand

Minimal example to reproduce the problem

\documentclass[12pt]{article}
\usepackage{ifthen}
\newcommand{\venue}{1}
\ifthenelse {\equal{\venue}{1}}{
    \newcommand\examLocation{Building 1}
}{
    \newcommand\examLocation{Building 2}
}
\begin{document}
    \examLocation
\end{document}

Expected behavior

No error indication, as this is valid LaTeX and typesets properly

Actual behavior

Both newcommand keywords are marked red, claiming its a duplicate definition. Clearly the fact that only if or else clause are executed is not recognized by the syntax chacker.

Screenshot 1:

Screenshot 2024-06-11 at 13 50 15

Screenshot 2:

Screenshot 2024-06-11 at 13 50 29
@efrancis efrancis added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Jun 11, 2024
@PHPirates PHPirates removed the untriaged Issue type still needs to be triaged or verified. label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour.
Projects
None yet
Development

No branches or pull requests

2 participants