我正在定义一个新环境,但环境的标题突出,即使在后环境括号中包含 \noindent,下一段的第一行仍然从一个字母的空格开始。
\documentclass[dvipsnames,svgnames, twoside, openany,reqno, 12pt, final, fleqn, ocgcolorlinks]{amsbook}
\usepackage{xcolor}
\makeatletter
\newcounter{Axiom} %counter for example
\newenvironment{Axiom} %name of environment
[1] %number of arguments for the environment
[]
{\begin{trivlist}\refstepcounter{Axiom}%be able to label
\item[{\@ifnotempty{#1}{\textcolor{red}{\textbf{#1-}}}\textcolor{red}{\textbf{Axiom~\theAxiom:}}}]%Title
}%font for body of example
{\end{trivlist}\par%new paragraph when the body of Axiom ends
\noindent\ignorespaces%stop anymore indentation
}
\makeatother
\begin{document}
This is just three lines of text. A very much dummy text because the lipsum text is very lengthy even with the parameters 1-2, 2-3, 3-4 et cetera. See My-Axioms goes outside the margin.
\begin{Axiom}[My]
This is just three lines of text. A very much dummy text because the lipsum text is very lengthy even with the parameters 1-2, 2-3, 3-4 et cetera.
\end{Axiom}
This is my typing. It is easily seen that there is a space before ``T'' even after \verb+\noindent+ is supplied in the environment.
\end{document}