Menu

#1798 False warning for underscores outside math environment

None
fixed
nobody
None
1
2016-06-09
2016-06-07
Anonymous
No

When underscores are used outside the math environment, a warning appears "math command outside math env". This happens in e.g. \label{fig:foo_vs_bar}. Can this be fixed? It annoys me.

Discussion

  • Jan  Sundermeyer

    Jan Sundermeyer - 2016-06-07

    labels are usually detected correctly and not checked for tex syntax.
    So your problem comes from something different.
    Please provide an example which shows the problem. Which OS, which version of txs ?

     
  • Benjamin Komen

    Benjamin Komen - 2016-06-09

    I'm sorry, I should have been more clear. I does not happen at every position of the document, but in the scope of \afterpage. This is some example code:

    \afterpage{%
        \begin{landscape}% Landscape page
            \topskip0pt
            \vspace*{\fill}
            \begin{figure}[ht]
                \centering
                \includegraphics[width=1.2\textwidth]{images/charts/newmark_vs_hht}
                \caption{Blabla}
                \label{fig:newmark_vs_hht}
            \end{figure}
            \vspace*{\fill}
        \end{landscape}
    }
    

    The underscores are marked red in the \label{} tag and in the \includegraphics{} tag. The word "landscape" in the \end{} tag is also marked red and when I hover my mouse a tooltip says: "closing environment which has not been opened".

     
  • Tim Hoffmann

    Tim Hoffmann - 2016-06-09

    The internal afterpage.cwl is incompatible with additions to the cwl language. Will be fixed in the next release.

    As a workaround, create file [settings-dir]/completion/user/afterpage.cwl with the following content:

    \afterpage{commands}
    

    FAQ: Where are the settings stored

     

    Last edit: Tim Hoffmann 2016-06-09
  • Benjamin Komen

    Benjamin Komen - 2016-06-09

    Ok, it doesn't really bother me, I just wanted to report it so it can be fixed.

     
  • Tim Hoffmann

    Tim Hoffmann - 2016-06-09

    Thanks, then.

     
  • Tim Hoffmann

    Tim Hoffmann - 2016-06-09
    • status: open --> fixed
    • Group: -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.