
使用如下例所示的定理樣式,在備註之後會產生一個新段落。我可以阻止這種情況嗎? (並amsthm
同時使用該包)?
\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{amsthm}
\usepackage{blindtext}
\newtheorem{rem}{Remark}
\begin{document}
\begin{rem}
\blindtext
\end{rem}
\blindtext % I want that the text begins aligned left, i.e. no new
% paragraph
\end{document}
答案1
不確定您到底在尋找什麼,但這可以幫助您
\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{amsthm}
\usepackage{blindtext}
\newtheoremstyle{mystyle}
{\topsep} % Space above
{0pt} % Space below
{\itshape} % Body font
{} % Indent amount
{\bfseries} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{mystyle}
\newtheorem{rem}{Remark}
\begin{document}
\begin{rem}
\blindtext
\end{rem}
\noindent\blindtext
\end{document}
PS:使用的定理樣式來自這裡
答案2
要做到這一點並不難,但你應該三思而後行。證據中的評論rem
環境是一個段落(或多個段落)單獨存在,因此其後面的文本應該成為一個新段落。
\documentclass{article}
\usepackage{amsthm}
\newtheorem{reminner}{Remark}
\makeatletter
\newenvironment{rem}
{\reminner}
{\endreminner\@endpetrue}
\makeatother
\begin{document}
\begin{rem}
A remarkable text.
\end{rem}
Some text that shouldn't start a new paragraph. But why not?
\begin{rem}
Another remarkable text.
\end{rem}
Some text that will start a new paragraph.
\end{document}
答案3
發生該行為是因為在其定義中amsthm.sty
明確包含:它具有\@endpefalse
\@endtheorem
\def\@endtheorem{\endtrivlist\@endpefalse }
。在 1996 年 5 月 7 日郵政在 comp.text.tex 上,Mark Wooding 給了一個解決方案,
\expandafter\let\csname @endtheorem\endcsname\endtrivlist
然後寫道:「一個更穩健的方法是說
\makeatletter
\toks@\expandafter{\@endtheorem\@endpetrue}
\edef\@endtheorem{\the\toks@}
\makeatother
萬一 [...]其他人進一步更改了原始巨集\usepackage{amsthm}
。\newtheorem{...}{...}
的那樣(誰提供了\makeatletter\def\@endtheorem{\endtrivlist}\makeatother
解決方案)。