我想在图片标题中使用逐字逐句。我尝试过cprotect
包,但它似乎只适用于 和\caption
,而不适用于\captionof
。有解决方法吗?
\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}
\begin{document}
\verb|works|
\afterpage{%
\begin{landscape}
\parbox[c][\textwidth][s]{\linewidth}{%
\vfill
\centering
\mbox{+++++++ a huge figure ++++++++}
\captionof{figure}{Syntaxbaum \verb|doesn't works|}
\vfill
}
\end{landscape}
}
\end{document}
答案1
在图前创建动词框,然后在其中调用它。
\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}
\usepackage{verbatimbox}
\begin{document}
\verb|works|
\begin{verbbox}
now it works
\end{verbbox}
\afterpage{%
\begin{landscape}
\parbox[c][\textwidth][s]{\linewidth}{%
\vfill
\centering
\mbox{+++++++ a huge figure ++++++++}
\captionof{figure}{Syntaxbaum \theverbbox}
\vfill
}
\end{landscape}
}
\end{document}