我如何手动缩进定理、推论等环境?

我如何手动缩进定理、推论等环境?

我正在向期刊提交一篇论文,该期刊要求缩进定理、推论、证明和引理等标签。目前,这些环境与左边距齐平。我该如何实现这一点?

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{cite}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}

% for the journal
\usepackage[labelsep=period]{caption}
\captionsetup[table]{name=TABLE}
\renewcommand{\thetable}{\Roman{table}}
\usepackage{indentfirst}
\title{title}
\author{
    people
}


\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}


\begin{document}
\maketitle    

\begin{theorem}
theorem to be indented at the label
\end{theorem}


\begin{proof}
proof to be indented at the label
\end{proof}

答案1

你可以加载amsthm并定义自己的风格。我的回答https://tex.stackexchange.com/a/17555/4427列出了样式的参数plain,因此很容易修改它们。

\documentclass{article}
\usepackage{amsthm}

\usepackage{lipsum} % for mock text

\newtheoremstyle{plainindent}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\itshape}  % BODYFONT
  {\parindent}% INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {.}         % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {}          % CUSTOM-HEAD-SPEC

\theoremstyle{plainindent}
\newtheorem{theorem}{Theorem}

\begin{document}

\lipsum[1][1-4]

\begin{theorem}
\lipsum[2][1-3]
\end{theorem}

\lipsum[3][1-4]

\end{document}

在此处输入图片描述

如果您也使用\theoremstyle{definition},请定义definitionindent类似的样式plainindent,但使用\upshapefor BODYFONT

您还可以按以下方式缩进证明。

\documentclass{article}
\usepackage{amsthm}
\usepackage{xpatch}

\usepackage{lipsum} % for mock text

\newtheoremstyle{plainindent}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\itshape}  % BODYFONT
  {\parindent}% INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {.}         % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {}          % CUSTOM-HEAD-SPEC
\xpatchcmd{\proof}{\itshape}{\hspace{\parindent}\itshape}{}{}

\theoremstyle{plainindent}
\newtheorem{theorem}{Theorem}

\begin{document}

\lipsum[1][1-4]

\begin{theorem}
\lipsum[2][1-3]
\end{theorem}
\begin{proof}
\lipsum[2][4-6]
\end{proof}

\lipsum[3][1-4]

\end{document}

在此处输入图片描述

答案2

不确定这是否正是您想要的,但是ntheorem包定义了一个\theoremindent长度:

\documentclass{article}
\usepackage{amsmath}%
usepackage{cite}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}

% for the journal
\usepackage[labelsep=period]{caption}
\captionsetup[table]{name=TABLE}
\renewcommand{\thetable}{\Roman{table}}
\usepackage{indentfirst}
\title{title}
\author{
    people
}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.2pt}
\usepackage{ntheorem}
\setlength{\theoremindent}{1cm}
\theoremseparator{.}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}

\theoremstyle{nonumberplain}
\theoremseparator{\upshape:}
\theoremheaderfont{\itshape}
\theorembodyfont{\normalfont}

\newtheorem{proof}{Proof}

\begin{document}
\maketitle

\begin{theorem}
A theorem to be indented at the label. And all its contents is indented indeed.
\end{theorem}

\begin{proof}
proof to be indented at the label. Blah blah blah. Blahblah. Blahblah.
\end{proof}

\end{document} 

在此处输入图片描述

编辑:为了仅缩进定理和证明标签,我定义了两种新样式:indentednonumberindented

\documentclass{article}
\usepackage{amsmath}%
\usepackage{cite}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}

% for the journal
\usepackage[labelsep=period]{caption}
\captionsetup[table]{name=TABLE}
\renewcommand{\thetable}{\Roman{table}}
\usepackage{indentfirst}
\title{title}
\author{
    people
}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.2pt}
\usepackage{ntheorem}
\usepackage{thmtools} 
\makeatletter
\newtheoremstyle{indented}%
{\item[\hskip\parindent \theorem@headerfont ##1\ ##2\theorem@separator]}%
 {\item[\hskip\parindent \theorem@headerfont ##1\ ##2\ (##3)\theorem@separator]}
 \newtheoremstyle{nonumberindented}%
{\item[\theorem@headerfont\hskip\parindent ##1\theorem@separator]}%
{\item[\theorem@headerfont\hskip\parindent ##1\ (##3)\theorem@separator]}
\makeatother
\theoremstyle{indented}
\theoremseparator{.}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}

\theoremstyle{nonumberindented}

\theoremseparator{\,\upshape:}
\theoremheaderfont{\itshape}
\theorembodyfont{\normalfont}

\newtheorem{proof}{Proof}

\begin{document}
\maketitle

\begin{theorem}
A theorem to be indented at the label. The theorem body is not indented .
\end{theorem}

\begin{proof}
proof to be indented only at the label. Blah blah blah. Blahblah. Blahblah.Blahblahblah. 
\end{proof}

\end{document} 

在此处输入图片描述

相关内容