0

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

\basoom{verbatimSymbol}

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}

\usetheme{Dresden}

\usefonttheme{professionalfonts}
\renewcommand{\sfdefault}{ppl}

\usepackage[T1]{fontenc}
\renewcommand{\encodingdefault}{T1}

\usepackage{listings}

\lstdefinestyle{LaTeX}{
    % style
    language={[LaTeX]TeX},
    basicstyle=\linespread{0.8}\ttfamily\color{DodgerBlue3},
}

\lstset{style=LaTeX}

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

\begin{document}
    
    \basoom{BasmahWantsMeHappy}BasmahWantsMeHappy
    
    \basoom|BasmahWantsMeHappy|
    
\end{document}
2
  • 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

0

You must log in to answer this question.

Browse other questions tagged .