定理名称后的 \par

定理名称后的 \par

所以,这是我的代码,我用它来在 Latex 中显示定理。

\documentclass{article}
\usepackage [utf8x] {inputenc}
\usepackage [T2A] {fontenc}
\usepackage[russian,english]{babel}
\usepackage{amsmath, amssymb}
\usepackage{amsthm}
\parindent=0cm
\newtheoremstyle{myLovelyTheorem}% name
{}%         Space above, empty = `usual value'
{}%         Space below
{}% Body font
{\parindent}%        Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}%        Punctuation after thm head
{\newline}% Space after thm head: \newline = linebreak
{}%         Thm head spec
\theoremstyle{myLovelyTheorem}
\newtheorem{thm}{Theorem}[section]
\newtheorem*{prf}{Proof}
\newtheorem*{lem}{Lemma}

当我写这样的东西时:

\begin{document}
    \begin{thm}
            text here
    \end{lem}

我得到了如下的定理、证明和引理:

因此,我的定理开始后没有空格。我的意思是,如果我使用 ,我没有空格\par\newline但如果我写 \par ,它就会出错。

全部代码:

\documentclass{article}
\usepackage [utf8x] {inputenc}
\usepackage [T2A] {fontenc}
\usepackage[russian,english]{babel}
\usepackage{amsmath, amssymb}
\usepackage{amsthm}
\parindent=0cm
\newtheoremstyle{myLovelyTheorem}% name
{}%         Space above, empty = `usual value'
{}%         Space below
{}% Body font
{\parindent}%         Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}%        Punctuation after thm head
{\newline}% Space after thm head: \newline = linebreak
{}%         Thm head spec
\theoremstyle{myLovelyTheorem}
\newtheorem{thm}{Теорема}[section]

\newtheorem*{prf}{Док-во}
\newtheorem*{lem}{Лемма}


\begin{document}
    \begin{lem}
            Пусть $f(x) = (x-x_0)^n$, тогда $f^{(k)}(x_0) = \begin{cases} n! & k = n \\ 0 & k \ne n \end{cases} $
    \end{lem}
    \begin{prf}
            $f^{(n)}(x) = n(n-1)...(n-k+1)(x-x_0)^{n-k}$

    \end{prf}
    \begin{thm}[Формула Тейлора для многочлена]
            Пусть $T$ - многочлен степени $\le n$, тогда $T(x) = \sum\limits_{k = 0}^n  \frac{T^{(k)}(x_0)}{k!}(x-x_0)^k$.
    \end{thm}
    \begin{prf}
            $T(x) = \sum\limits_{k=0}^n c_k(x-x_0)^k$

            $T^{(n)}(x) = \sum\limits_{k=0}^n c_k((x-x_0)^k)^{(n)}  =$ 

            $= c_1((x-x_0)^1)^{(n)} + c_2((x-x_0)^2)^{(2)} + ... + c_n((x-x_0)^n)^{(n)}$


            Подставим $x = x_0$, тогда $T^{(n)}(x_0) = c_n\cdot n! \Rightarrow c_n = \frac{T^{(n)}(x_0)}{n!}$
    \end{prf}
\end{document}

答案1

您的问题不太清楚,但由于您明确将其设置\parindent为零,同时指定\parindent为的第五个参数\newtheoremstyle,我假设您想通过“正常段落缩进”来缩进定理的标题,尽管正常文本没有段落缩进。以下代码正是这样做的。

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{amsmath}
\usepackage{amsthm}

\newlength{\myparindent}% it is also possible to avoid using a "\skip" register
\setlength{\myparindent}{\parindent}
\setlength{\parindent}{0pt}

\newtheoremstyle{myLovelyTheorem}% name
    {}% Space above, empty = `usual value'
    {}% Space below
    {}% Body font
    {\myparindent}% Indent amount (empty = no indent, \parindent = para indent)
    {\bfseries}% Thm head font
    {.}%        Punctuation after thm head
    {\newline}% Space after thm head: \newline = linebreak
    {}%         Thm head spec
\theoremstyle{myLovelyTheorem}
\newtheorem{thm}{Theorem}[section]

\newtheorem*{prf}{Proof}
\newtheorem*{lem}{Lemma}



\begin{document}

\section{A section title}

This is normal text, let us continue it at least until the next line to show the
paragraph indentation.

\begin{lem}
    For all~$x$, we have $x+x=2x$.
\end{lem}
\begin{prf}
    Exercise.
\end{prf}
\begin{thm}
    It holds true that $1+1=2$.
\end{thm}
\begin{prf}
    Apply the lemma for $x=1$, and note that, being $1$ the unit of the field 
    of real numbers, we have $2\cdot1=2$.
\end{prf}

\end{document}

这是输出:

代码输出

相关内容