how to type right } in lstinline

243 views Asked by At

how to type right } in lstinline. I cannot insert

\lstinline{{}}

The left{ is work well, but the right cause error.

Extra }, or forgotten \endgroup.

Thanks for your help.

1

There are 1 answers

0
samcarter_is_at_topanswers.xyz On

You can use some other character, which does not occur in your listing, to delimit the lstinline argument:

\documentclass{article}

\usepackage{listings}

\begin{document}

\lstinline|{}|

\lstinline@{}@

\lstinline!{}!

\lstinline*{}*

\end{document}