截屏

截屏

我创建了自己的环境并将其用于 KOMA 课程。

它工作正常,除了它后面的第一段有缩进。它希望它根本没有缩进,这就是我false-在类中使用的原因。

我怎样才能将缩进设置为零?

截屏

在此处输入图片描述

平均能量损失

\documentclass[
11pt,
a4paper,
]
{scrartcl}

\usepackage{
lmodern,
blindtext
}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{
multicol,
blindtext,
}

\newenvironment{teaser}{\vspace{0ex}\par\raggedright\sffamily}{%
\par%
\rule{0.8\columnwidth}{1pt}\par
\vspace{2ex}%
}

\listfiles

\begin{document}
\begin{center}\huge
Title stuff
\end{center}

\begin{multicols*}{2}
\section{Word}

\begin{teaser}
Stuff.
Word, some text to fill the void.
Here is a longer sentence, quite the long one.
\end{teaser}%
%
How do I have to define the new environment \verb|teaser| so that the first paragraph after it has no indentation?

Words words words words words words words words words words words words words.
Words words words words.
\end{multicols*}
\end{document}

答案1

使用\@afterheading,这是 LaTeX 在章节标题后所做的。

\documentclass{article}

\usepackage{multicol}

\makeatletter
\newenvironment{teaser}
 {%
  \par\raggedright\sffamily
 }
 {%
  \par
  \rule{0.8\columnwidth}{1pt}\par\addvspace{2ex}%
  \@afterheading
 }
\makeatother

\begin{document}

\begin{center}\huge
Title stuff
\end{center}

\begin{multicols*}{2}
\section{Word}

\begin{teaser}
Stuff.
Word, some text to fill the void.
Here is a longer sentence, quite the long one.
\end{teaser}

How do I have to define the new environment \verb|teaser| so that the first 
paragraph after it has no indentation?

Words words words words words words words words words words words words words.
Words words words words.
\end{multicols*}

\end{document}

在此处输入图片描述

相关内容