导入几何包会搞乱 \texthl 的换行行为

导入几何包会搞乱 \texthl 的换行行为

看起来取消注释下面代码的第 6 行会抑制换行行为\texthl

\documentclass[a4paper, 11pt]{article}

\usepackage{parskip}
\usepackage{fontspec}
\usepackage{xcolor}
%\usepackage[showframe, margin=2cm]{geometry}
\usepackage{soul}

\setmonofont{Courier New}
\definecolor{bg}{rgb}{0.85, 0.85, 0.85}
\sethlcolor{bg}

\begin{document}
    This is some inline code that uses LaTeX special characters, and
    breaks a line
    \texthl{\texttt{\textbackslash newcommand\{test\}\{out\}}}

    This is some inline code that uses LaTeX special characters, and
    \texthl{\texttt{\textbackslash newcommand\{test\}\{out\}}}


    This is a path that alsodsad kljaskl djaslkdj aslkdj aksljd klaj
    sdlak sklajdaklsjd kalsdj klasjd
    \texthl{\texttt{Cas\{dals\textbackslash dalskdaslkdaslkdlaskdlask}}

\end{document}

这是没有导入geometry

在此处输入图片描述

这是导入geometry

当我使用时,如何才能geometry尊重边距texthl

相关内容