![换行符未出现在最佳位置](https://linux22.com/image/388797/%E6%8D%A2%E8%A1%8C%E7%AC%A6%E6%9C%AA%E5%87%BA%E7%8E%B0%E5%9C%A8%E6%9C%80%E4%BD%B3%E4%BD%8D%E7%BD%AE.png)
由于某种原因,尽管使用了该microtype
包,我还是无法修复段落中的一些过度填充,如下图所示。
我希望每个函数调用的左括号后立即换行。我尝试通过在每个函数的第一个参数和每个函数的左括号之间放置零宽度空格来解决这个问题。
理想情况下,我希望解决方案也能与该\lstinline
命令兼容。
\subsubsection{Map Scanning and Information Analysis}
Before any route-finding can occur, the map on which the robot finds itself must be internalised. There are three functions which are used for this purpose: getChosenArea(\hspace{0pt}gameEnvironment, topLeft, bottomRight), getMapMax(\hspace{0pt}gameEnvironment, gameType=1) and getMapRadius(\hspace{0pt}gameEnvironment, radius). All each of these do is scan the area specified in the parameters, and return a \Map{} object.
答案1
由于涉及这么多非语法词,最简单的方法是使用sloppypar
,如小节中的第 2 个实例所示。
在 MWE 中,\leftskip
只是为了匹配 OP 的未指定边距。
\documentclass{article}
\newcommand\Map{\texttt{Map}}
\begin{document}
\leftskip1.5in\relax
\subsubsection{Map Scanning and Information Analysis}
Before any route-finding can occur, the map on which the robot finds itself must be internalised. There are three functions which are used for this purpose: getChosenArea(\hspace{0pt}gameEnvironment, topLeft, bottomRight), getMapMax(\hspace{0pt}gameEnvironment, gameType=1) and getMapRadius(\hspace{0pt}gameEnvironment, radius). All each of these do is scan the area specified in the parameters, and return a \Map{} object.
\subsubsection{Map Scanning and Information Analysis}
\begin{sloppypar}
Before any route-finding can occur, the map on which the robot finds itself must be internalised. There are three functions which are used for this purpose: getChosenArea(\hspace{0pt}gameEnvironment, topLeft, bottomRight), getMapMax(\hspace{0pt}gameEnvironment, gameType=1) and getMapRadius(\hspace{0pt}gameEnvironment, radius). All each of these do is scan the area specified in the parameters, and return a \Map{} object.
\end{sloppypar}
\end{document}