showexpl
package that loads listings
package might be interesting for you as it provides more sophisticated features as follows.
\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{accsupp}
\newcommand*{\noaccsupp}[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}
\usepackage{xcolor}
\usepackage{showexpl}
\lstdefinestyle{Common}
{
language={[LaTeX]TeX},
numbers=left,
numbersep=1em,
numberstyle=\tiny\noaccsupp,
frame=single,
framesep=\fboxsep,
framerule=\fboxrule,
rulecolor=\color{red},
xleftmargin=\dimexpr\fboxsep+\fboxrule,
xrightmargin=\dimexpr\fboxsep+\fboxrule,
breaklines=true,
breakindent=0pt,
tabsize=2,
columns=flexible,
includerangemarker=false,
rangeprefix=//\ ,
}
\lstdefinestyle{A}
{
style=Common,
backgroundcolor=\color{yellow!10},
basicstyle=\scriptsize\ttfamily,
keywordstyle=\color{blue}\bf,
identifierstyle=\color{black},
stringstyle=\color{red},
commentstyle=\color{green}
}
\usepackage{graphicx}
\begin{document}
\section*{lstinline}
\lstinline[style=A]|\LaTeX\ is fun.|
\section*{lstlisting}
\begin{lstlisting}[style=A]
\LaTeX\ is also fun in displayed mode.
\end{lstlisting}
\section*{LTXexample}
\LTXexample[style=A]
\LaTeX\ is fun.
\endLTXexample
\end{document}

verbatim
environment if you have a lot of text or you can use\verb|\it|
.\verb+\it+
and NO!!!!! you do NOT use\it
to get italic!!! Please to not teach this to users. Use\textit{...}
or if it is for emphasizing\emph{...}
.\it
isTeX
and should not be used in LaTeX\itshape
is also acceptable as a switch.