I'm trying to define a new language cli-like interface, but I can not figure out how the use the delimiter to match my prompt.
I want to apply tree different styles to the text. In the example below I have underlined each char with a ~
, -
or =
to signal what style group they should belong to.
# configure terminal
~ ==================
(config)# json notification host a
--------~ ========================
(something-something)# url http://10.99.10.1:8000/path
---------------------~ ===============================
I have been experimenting with this:
\documentclass{article}
\usepackage{listings}
\lstdefinelanguage{iCli}
{
comment=[l]{\%},
basicstyle=\small,
keywords={\#},
keywordstyle=\textbf,
delim=[s][keywordstyle]{(}{\#}
}
\begin{document}
\begin{lstlisting}[language=iCli]
% This is a comment
# configure terminal
(config)# json notification host a
\end{lstlisting}
\end{document}
But it does not highlight #
as a keyword
\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Sep 26 '14 at 11:10(config)
and(something-something)
in red, but not the following#
or the first#
. Correct? What color should#
characters be highlighted in? – jub0bs Sep 26 '14 at 11:13#
to be red(or some other color), and then I would like all#
to be bold, and the other text normal. – Allan Sep 26 '14 at 12:10#
) in bold. – Allan Sep 26 '14 at 12:13