如何避免在下面定义的环境中新行创建的水平空间(文本缩进)?
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{amsthm}
\makeatletter
\newenvironment{environment}[1]{\par
\normalfont\topsep6\p@\@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\sffamily\bfseries Environment #1]\mbox{}\vskip0pt\noindent
}{%
\endtrivlist\@endpefalse
}
\makeatother
\begin{document}
\begin{environment}{(Title)}
Just some text\dots{}
\end{environment}
\end{document}
答案1
它不是缩进,而是一个空格,正如您所见,如果您%
在后面放置一个{(title)}
,您可以通过以下方式忽略源文件中的空格:
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{amsthm}
\makeatletter
\newenvironment{environment}[1]{\par
\normalfont\topsep6\p@\@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\sffamily\bfseries Environment #1]\mbox{}\vskip0pt\noindent\ignorespaces
}{%
\endtrivlist\@endpefalse
}
\makeatother
\begin{document}
\begin{environment}{(Title)}
Just some text\dots{}
\end{environment}
\end{document}