这可能是一个愚蠢的问题,但我找不到解决方法。以下是 MWE:
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{blindtext}
\begin{document}
\ttfamily
What can we do in this case? What should we do about this? What can we do in this case? What should we do about this?
\blindtext
\end{document}
结果是这样的:
如您所见,右侧完全错位了。我尝试过设置,\hyphenpenalty
但似乎没用。
怎样修复此问题?
答案1
类似如下: 断词、对齐和 ttfamily
这可能对你有用:
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{blindtext}
\begin{document}
\ttfamily\hyphenchar\font=`\-\spaceskip=.5em plus .5em\xspaceskip=.5em
What can we do in this case? What should we do about this? What can we do in this case? What should we do about this?
\blindtext
\end{document}