ntheorem 第一行開頭不需要的空格

ntheorem 第一行開頭不需要的空格

如何透過 ntheorem 避免第一行開頭的空格

\documentclass[a4paper,10pt,openany,twoside]{scrbook}
\usepackage[paperwidth=94mm,paperheight=50mm,margin=2mm,footskip=2mm,showframe
] {geometry}

\usepackage{amsmath,amssymb}
%
\usepackage[amsmath,thmmarks]{ntheorem}
\theoremstyle{nonumberplain}
\theorembodyfont{\normalfont}
\theoremsymbol{\ensuremath{\vartriangleleft}}
\newtheorem{mythm}{}
%
\setlength\parindent{0pt}
\begin{document}

\begin{mythm}
Some text\\
Some other text
\[
a = b
\]
\end{mythm}
\end{document}

在此輸入影像描述

答案1

nonumberplain樣式期望定理具有由第二個參數指定的標題\newtheorem,並在該標題和定理正文之間插入一些空格。

您可以在第 52 頁查看 nonumberplain 樣式的定義定理文檔

我想解決這個問題的方法是定義另一個與它類似但沒有 s 的定理樣式\hskip,並將其用於無標題無數字定理:

\documentclass[a4paper,10pt,openany,twoside]{scrbook}
\usepackage[paperwidth=94mm,paperheight=50mm,margin=2mm,footskip=2mm,showframe
] {geometry}

\usepackage{amsmath,amssymb}
%
\usepackage[amsmath,thmmarks]{ntheorem}

\makeatletter
\newtheoremstyle{nonumbernoheading}%
{\item[\theorem@headerfont##1\theorem@separator]}%
{\item[\theorem@headerfont##1\ (##3)\theorem@separator]}
\makeatother

\theoremstyle{nonumbernoheading}
\theorembodyfont{\normalfont}
\theoremsymbol{\ensuremath{\vartriangleleft}}
\newtheorem{mythm}{}
%
\setlength\parindent{0pt}
\begin{document}

\begin{mythm}
Some text\\
Some other text
\[
a = b
\]
\end{mythm}
\end{document}

新定理樣式輸出

相關內容