#326 Syntax highlighting mistake if $ is used between \ifcsname and \endcsname


Text/math highlighting is inverted after this:
(listings package, set a style if it exists)


  • Tino Weinkauf

    Tino Weinkauf - 2013-09-28
    • status: open --> pending
  • Tino Weinkauf

    Tino Weinkauf - 2013-09-28

    Ok, well, we change to math mode as soon as we find a $ that is not within a comment.

    Can you tell me what the above code is doing exactly and what the $ sign is good for in that code?

    Please note that it is very difficult to support all possible TeX situations.

  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2013-09-30

    Using the listings package you can predefine styles to use after. If you define a style named xxxxx a variable is set: lststy@xxxxx$ (yes, with a $ at the end)
    If you want to conditionally use a script based on its existence, you can use the code above (\ifcsname lststy@xxxxx$ \endcsname\lstset{style=xxxxx}\fi)
    $ is not good for anything, however package developers sometimes use it inside variable names on the inside of packages. On one hand it is to make it more "protected", and on the other hand it is customary to use $ instead of @ as a "substring separator" on string ends, however it is seldom needed to put a separator on the end.
    I think every character is considered text in an \ifcsname-\endcsname context, not only $.

    Last edit: Sándor Kazi 2013-09-30
  • Tino Weinkauf

    Tino Weinkauf - 2013-09-30

    Ok, I add this to our feature wish list. Thanks for your report and clarifications.

  • Tino Weinkauf

    Tino Weinkauf - 2013-09-30

    Ticket moved from /p/texniccenter/user-reports/1381/

    Can't be converted:

    • _milestone: 2.01_Stable
  • Tino Weinkauf

    Tino Weinkauf - 2013-09-30
    • labels: syntax highlight, math mode --> syntax highlight, math mode, editor
    • Group: 2.01_Stable --> Final_Release_(1.0)
    • Priority: 5 --> 1
  • Tino Weinkauf

    Tino Weinkauf - 2013-09-30
    • status: pending --> open


Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks