How to tell TeXStudio to ignore all content of some environment from its Tree (structure) layout?

  • Nasser M. Abbasi

    I am using TexStudio 2.8.2 (excellent editor)

    Is there a way to tell texstudio to ignore entries such as \section and \chapter that appears inside Verbatim environment from showing in the Structure tree in the left panel?

    The problem shows up only when I defined a macro like this:


    Then in the code I write


    Now \section{blabla} shows up in the Structure tree to the left, even though it is inside a Verbatim.

    However, the \section{blabla} do not show up if I write Verbatim explicit as in:


    Which is good! But I like to use macros such as X above, to reduce the amount of typing each time. So I need a way to tell texstudio to simply treat the X environment exactly as Verbatim, that is all.

    I wonder if there is a setting or a way to add such environment and tell TexStudio that environment X is Verbatim?

    thank you

  • Tim Hoffmann

    Tim Hoffmann - 2014-08-11

    In the particular case of verbatim, the simplest solution is to define X as verbatim at Options -> Custom Highlighting -> Custom Environment. You need to have the advanced option checkbox in the lower left corner of the options dialog enabled to access this setting.

    More refined definition of commands can be achieved by a user-defined cwl file. See and the links therein.


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

Sign up for the SourceForge newsletter:

No, thanks