我在 Latex 中使用 lstlisting 命令。我想使用双连字符“--help”,但乳胶连字符像在普通文本中一样连接(但它是源代码),我不能使用“-{}-”进行分隔。
\begin{lstlisting}
$ oc <command> --help
\end{lstlisting}
Run Code Online (Sandbox Code Playgroud)
请问你能帮帮我吗?谢谢
看到您正在使用类似终端的代码显示,请考虑使用 a\ttfamily作为您的basicstyle:
\documentclass{article}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\begin{document}
\begin{lstlisting}
$ oc <command> --help
\end{lstlisting}
\end{document}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1084 次 |
| 最近记录: |