删除定理的缩进

删除定理的缩进

我正在使用 amstheorem 和 amsbook,我想删除定理编号前的缩进,以便它们完全向左对齐。有什么办法吗?此外,最好有:1) 定理编号放在一个框中(在其他地方引用时也一样)。2) 定理编号和名称以粗体显示。

这是一个最小的工作示例: 下面是一张我所指的图片(两条红色水平线): 在此处输入图片描述 LyX 代码:

#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 479
\begin_document
\begin_header
\textclass amsbook
\begin_preamble
\usepackage[breaklinks,colorlinks=true,linkcolor=blue,
citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{braket}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}%
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
\usepackage{amsfonts}
\usepackage{dsfont}
\renewcommand{\vec}[1]{\mathbf{#1}}
\usepackage[scaled=0.88]{beraserif}
\usepackage[scaled=0.85]{berasans}
\usepackage[scaled=0.84]{beramono}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage[T1,small,euler-digits]{eulervm}
\numberwithin{section}{chapter}
\end_preamble
\options reqno
\use_default_options true
\begin_modules
theorems-ams
eqs-within-sections
figs-within-sections
yashi-theorems-ams
theorems-sec
\end_modules
\maintain_unincluded_children false
\begin_local_layout
Preamble
\swapnumbers
EndPreamble
\end_local_layout
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\papersize a4paper
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1cm
\topmargin 1cm
\rightmargin 1cm
\bottommargin 1cm
\secnumdepth 5
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 1 0 9 -1
\bullet 3 0 7 -1
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Title
Title
\end_layout

\begin_layout Chapter
First Chapter
\end_layout

\begin_layout Section
First Section
\end_layout

\begin_layout Standard
Here is some text.
 As it begins a paragraph, it starts indented.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
 Bla bla bla.
\end_layout

\begin_layout Claim
Some Claim [some words some words some words some words some words some
 words some words some words some words some words some words some words
 some words some words some words some words some words some words some
 words some words some words some words some words some words]
\end_layout

\begin_layout Definition
Some Definition
\end_layout

\end_body
\end_document

LaTeX 代码:

%% LyX 2.2.0dev created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,english,reqno]{amsbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\setcounter{secnumdepth}{5}
\usepackage{amsthm}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\swapnumbers
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}[section]
  \theoremstyle{plain}
  \newtheorem{claim}[thm]{\protect\claimname}
  \theoremstyle{definition}
  \newtheorem{defn}[thm]{\protect\definitionname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[breaklinks,colorlinks=true,linkcolor=blue,
citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{braket}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}%
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
\usepackage{amsfonts}
\usepackage{dsfont}
\renewcommand{\vec}[1]{\mathbf{#1}}
\usepackage[scaled=0.88]{beraserif}
\usepackage[scaled=0.85]{berasans}
\usepackage[scaled=0.84]{beramono}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage[T1,small,euler-digits]{eulervm}
\numberwithin{section}{chapter}

\AtBeginDocument{
  \def\labelitemii{\(\circ\)}
  \def\labelitemiv{\(\star\)}
}

\makeatother

\usepackage{babel}
  \providecommand{\claimname}{Claim}
  \providecommand{\definitionname}{Definition}
\providecommand{\theoremname}{Theorem}

\begin{document}

\title{Title}
\maketitle

\chapter{First Chapter}

\section{First Section}

Here is some text. As it begins a paragraph, it starts indented. Bla
bla bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla
bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla bla.
Bla bla bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla
bla bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla
bla. Bla bla bla. Bla bla bla. Bla bla bla. Bla bla bla.
\begin{claim}
Some Claim {[}some words some words some words some words some words
some words some words some words some words some words some words
some words some words some words some words some words some words
some words some words some words some words some words some words
some words{]}
\end{claim}
\begin{defn}
Some Definition
\end{defn}

\end{document}

答案1

改变这种情况的最简单方法是修补\@thm命令amsbook。(我认为)您将需要\usepackage{etoolbox}。然后您序言中的这段代码应该可以解决问题。

\makeatletter
\patchcmd\@thm
  {\let\thm@indent\indent}{\let\thm@indent\noindent}%
  {}{}
\makeatother

(该\noindent设置是 中的默认设置amsart。)

编辑: steven segletes 的评论提出了另一种选择:

\makeatletter
\let\sv@thm\@thm
\def\@thm{\let\indent\relax\sv@thm}
\makeatother

事实证明,消除证明的缩进要困难得多。之前的方法都不起作用(尽管 amsbook和之间的唯一区别amsart(证明是不是在这方面,缩进的原因是没有\itemindent设置amsart

我正在努力。

相关内容