Sorry for the basic question. I'm practicing how to use circuitikz, meanwhile I want to show the process of code and output. For the elegant of LaTeX source code in pdf what I want to do is to ignore some indentations or not to display indentation symbols in showexpl LTXexample, It affects the experience of viewing so more.
Here is MWE. It would be nice if the two scenarios could be realized separately(ignore or not to display indentation).
\documentclass{article}
\usepackage{listings} %插入代码块
\usepackage{tikz}
\usepackage{circuitikz}
\usepackage{showexpl}
\lstset{%
basicstyle=\ttfamily\small,
commentstyle=\itshape\ttfamily\small,
showspaces=false,
showstringspaces=false,
showtabs=false,
breaklines=true,
backgroundcolor=\color{gray!10!white},
breakautoindent=false,
captionpos=b,
}
\begin{document}
\begin{LTXexample}[pos=r,preset=\centering,width=0.5\linewidth,rangeaccept=false,title=potentiometer]
\begin{circuitikz}
\draw (0,0) to [potentiometer, name=P, mirror] ++(0,2);
\draw (P.wiper) to[L] ++(2,0);
\end{circuitikz}
\end{LTXexample}
\end{document}






