I am trying to customize cwl file to provide verbatim highlighting. I am trying to get assistance from TeXstudio : User manual, and my cwl file contains the following


This is what I get

enter image description here

TeXstudio thus, does not actually highlight the argument itself as verbatim, but rather highlights the input after the closing bracket. It is possible to solve this by using | for brackets, but arguments defined using LaTeX only appear in curly brackets. Thus, the possible solutions are

  1. Modify the cwl to highlight only the argument between curly brackets as verbatim
  2. Define the command itself as to accept | for brackets for its argument

This is my MWE

\documentclass[aspectratio=169, xcolor={x11names}, t, handout]{beamer}





    % style


\newcommand{\basoom}[1]{\lstinline|#1|} % for testing

  • Is this different from your previous question?
    – mbert
    Commented Jan 29, 2023 at 20:36
  • You could make the cwl entry \basoom{arg%definition} then follow the steps here to define custom highlighting for the arg. Replace \footnote with \basoom in that example
    – mbert
    Commented Jan 29, 2023 at 23:14


You must log in to answer this question.

Browse other questions tagged .