有没有办法最多 60 个字母后换行但它应该在某些命令内不会中断就像listings
这样?
例子:
\documentclass[a5paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{xcolor}
\lstset{%
language=[LaTeX]TeX,
backgroundcolor=\color{gray!25},
basicstyle=\ttfamily,
breaklines=true,
columns=fullflexible
}
\begin{document}
\begin{lstlisting}
The roadrunner is the fastest running bird \remark{Check this again with a zoologist!}.
\end{lstlisting}
\end{document}
输出:
The roadrunner is the fastest running bird remark{Check this again with a zoologist!}.
那不应该发生!在我看来,这个问题没有被讨论过verbatim
可能会中断过长的线路的环境。
答案1
感谢 Torbjørn T.,我的问题得到了回答:
只需说一句:
\lstset{%
breaklines=true,
breakatwhitespace=true,
}