将 \lstinline 放在 \chapter、\section 等命令内 2024-5-25 • sectioning listings titles inline arguments 我如何将\lstinline代码放置在诸如、、\chapter等命令内?\section\subsection 或者这是一种糟糕或者无味的做法? 答案1 你可以,只要你\protect移动参数: \documentclass{report} \usepackage{listings} \lstset{ basicstyle=\ttfamily } \begin{document} \tableofcontents \chapter{The \protect\lstinline!if! command} \section{The \protect\lstinline!while! command} \subsection[More commands]{The \lstinline!end! command} \end{document} 相关内容 TFTP 连接 Docker 服务器超时 为特定网站禁用 Accept-encoding:gzip Firefox Chromium 无法访问 SSL 站点 使用EdgeAndBing 导向器 什么是 POSIX“强制实用程序”? 打印计数器值减 1 Google Cloud Directory Sync java 空指针异常 我怎样才能将 pactl 恢复为其默认配置(环回时噪音很大)? 从 Linux 客户端更改 VPN 密码 如何在 Windows CMD 中将双引号作为命令行参数传递?