Lyx:如何让定理编号包含三部分?

Lyx:如何让定理编号包含三部分?

使用文档类amsart,我如何才能使定理编号也包含小节的编号而不仅仅是节的编号?

下面是我所说的一个最小工作示例,其中“1.1 定理”应该(理想情况下)变成“1.1.1 定理”: 在此处输入图片描述 Lyx 来源:

#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 482
\begin_document
\begin_header
\textclass amsart
\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}
% make boxes around proofs:
%-------------------
\usepackage[framemethod=tikz]{mdframed}
\surroundwithmdframed[
  hidealllines=true,
  leftline=true,
  bottomline=true,
  innertopmargin=0pt,
  skipabove=\dimexpr\topsep+6pt\relax,
  skipbelow=\topsep,
  innerrightmargin=0pt,
]{proof}
%-------------------
\end_preamble
\options reqno
\use_default_options true
\begin_modules
theorems-ams
eqs-within-sections
figs-within-sections
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 Section
Section 1
\end_layout

\begin_layout Subsection
Subsection 1
\end_layout

\begin_layout Theorem
This is my first theorem.
\end_layout

\begin_deeper
\begin_layout Proof
And this is its proof.
\end_layout

\end_deeper
\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]{amsart}
\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]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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}
% make boxes around proofs:
%-------------------
\usepackage[framemethod=tikz]{mdframed}
\surroundwithmdframed[
  hidealllines=true,
  leftline=true,
  bottomline=true,
  innertopmargin=0pt,
  skipabove=\dimexpr\topsep+6pt\relax,
  skipbelow=\topsep,
  innerrightmargin=0pt,
]{proof}
%-------------------
\numberwithin{subsection}{section}

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

\makeatother

\usepackage{babel}
\providecommand{\theoremname}{Theorem}

\begin{document}

\title{Title}
\maketitle

\section{Section 1}

\subsection{Subsection 1}
\begin{thm}
This is my first theorem.
\begin{proof}
And this is its proof.
\end{proof}
\end{thm}

\end{document}

答案1

在 lyx 序言中添加:

%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{multicol}
\usepackage{etoolbox}%إطار النظريات
\usepackage{blindtext}%
\usepackage[theorems,skins,breakable]{tcolorbox}%
%%
\newtcbtheorem[number within=section]{tdr}{theorems}%
{overlay={},left=5pt,breakable,colback=blue!5,colframe=blue!35!black,fonttitle=\bfseries,title after break={Lemma \csuse{the\tcbcounter} -- \raggedleft Continued}}{tdr}

%%%%%%%%%%%%%%%%%%%%%%%داخل المستند

在 lyx 文档中 定理之前按Ctrl+L打开tex然后粘贴:

\begin{tdr}{ }{}

**in lyx documents** after the theorem the theorem open tex by Ctrl+L then paste:

\end{tdr}

相关内容