
裡面好像\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}