答案1
答案2
tabularx
仅大致实现\verb
,但在这里你可能只需要\texttt
而不需要\verb
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{flushleft}
Outside table: \verb~/\d+/~
Outside table: \texttt{/\string\d+/}
\begin{tabularx}{\linewidth}{@{}X@{}}
Inside table: \texttt{/\string\d+/} \\
\end{tabularx}
\end{flushleft}
\end{document}