セクションコマンドの星印付きバージョン内で `\verb` を有効にするにはどうすればよいでしょうか?

セクションコマンドの星印付きバージョン内で `\verb` を有効にするにはどうすればよいでしょうか?

内部では有効に\cprotectならないようです\verbスター付きバージョンセクションコマンド\section*など\paragraph*

この問題を解決するにはどうすればよいですか?

% MWE
\documentclass{book}
\usepackage{cprotect}
\begin{document}
\cprotect\part*{text and \verb"\verb"}
\cprotect\chapter*{text and \verb"\verb"}
\cprotect\section*{text and \verb"\verb"}
\cprotect\subsection*{text and \verb"\verb"}
\cprotect\subsubsection*{text and \verb"\verb"}
\cprotect\paragraph*{text and \verb"\verb"}
\cprotect\subparagraph*{text and \verb"\verb"}
\end{document}

答え1

ここに画像の説明を入力してください

\documentclass{book}
\usepackage{cprotect}
\begin{document}
\cprotect{\part*}{text and \verb"\verb"}
\cprotect{\chapter*}{text and \verb"\verb"}
\cprotect{\section*}{text and \verb"\verb"}
\cprotect{\subsection*}{text and \verb"\verb"}
\cprotect{\subsubsection*}{text and \verb"\verb"}
\cprotect{\paragraph*}{text and \verb"\verb"}
\cprotect{\subparagraph*}{text and \verb"\verb"}
\end{document}

関連情報