I am currently using the below codes for auto line breaking in Latex. However, below code places an extra space behind the /texttt. How can I remove the extra space being placed after the /texttt command? The spacing looks like the below image.
Code:
\makeatletter
\newcommand\aepath[1]{%%
\bgroup
\ttfamily
\ae@path#1\relax\@nil
\egroup}
\def\ae@path#1#2\@nil{%%
\def\ae@continue{}%%
\detokenize{#1}\unskip\penalty\z@
\ifx\relax#2
\else
\def\ae@continue{\ae@path#2\@nil}%%
\fi
\ae@continue}
\makeatother
\let\texttt\aepath

%after\ifx\relax#2will do. – Phelype Oleinik Jun 08 '19 at 19:37aepath– egreg Jun 08 '19 at 19:42