谢谢大家。我怎样才能自动将(例如)color
中的改为中的。单词()也是同样的情况。word
theorem
red color
lyx
definition, lemma, fact, proof
例如:
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass book
\use_default_options true
\begin_modules
theorems-ams
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "Times New Roman"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts true
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\float_placement h
\paperfontsize default
\spacing single
\use_hyperref false
\papersize a4paper
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\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
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 2.5cm
\topmargin 2.5cm
\rightmargin 2.5cm
\bottommargin 2.5cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\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 Chapter
series
\end_layout
\begin_layout Section
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
10.4
\end_layout
\end_inset
Convergence & Divergence of Series
\end_layout
\begin_layout Definition
Let
\begin_inset Formula $\sum_{n=1}^{\infty}a_{n}$
\end_inset
a series, we call the sequence
\begin_inset Formula $\left\{ s_{n}\right\} _{n=1}^{\infty}$
\end_inset
the partial sums sequence.
\end_layout
\begin_layout Section
Divergence Test
\end_layout
\begin_layout Standard
Notice that for the two series that converged the series term itself was
zero in the limit.
This will always be true for convergent series and leads to the following
theorem.
\end_layout
\begin_layout Theorem
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
Theorem
\end_layout
\end_inset
If
\begin_inset Formula $\sum a_{n}$
\end_inset
converges then
\begin_inset Formula $\lim_{n\rightarrow\infty}a_{\mathrm{n}}=0$
\end_inset
.
\end_layout
\begin_layout Fact
Facts.
Given the series
\begin_inset Formula $\sum a_{n}$
\end_inset
,
\begin_inset Newline newline
\end_inset
1.
If
\begin_inset Formula $\sum a_{n}$
\end_inset
is absolutely convergent and its value is
\begin_inset Formula $s$
\end_inset
then any rearrangement of
\begin_inset Formula $\sum a_{n}$
\end_inset
will also have a value of
\begin_inset Formula $s$
\end_inset
.
\begin_inset Newline newline
\end_inset
2.
If
\begin_inset Formula $\sum a_{n}$
\end_inset
is conditionally convergent and
\begin_inset Formula $r$
\end_inset
is any real number then there is a rearrangement of
\begin_inset Formula $\sum a_{n}$
\end_inset
whose value will be
\begin_inset Formula $r$
\end_inset
.
\end_layout
\end_body
\end_document
答案1
LyX 使用提供的样式amsthm
,即和plain
,因此您可以通过将以下内容添加到 来修改这些样式(有关 的解释,请参阅的文档,有关我使用的值,请参阅definition
remark
Document->Settings->LaTeX Preamble
\newtheoremstyle
amsthm
这个答案)
\newtheoremstyle{plain}
{\topsep} % ABOVESPACE
{\topsep} % BELOWSPACE
{\itshape} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\color{red}\bfseries} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{}
\newtheoremstyle{definition}
{\topsep} % ABOVESPACE
{\topsep} % BELOWSPACE
{\normalfont} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\color{red}\bfseries} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{}
\newtheoremstyle{remark}
{.5\topsep} % ABOVESPACE
{.5\topsep} % BELOWSPACE
{\normalfont} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\color{red}\itshape} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{}
要更改编辑器中的显示,您需要Document->Settings->Local Layout
为每个类似定理的环境添加以下几行(对于类似定理的注释,形状为斜体,形状不是粗体)
ModifyStyle Theorem
LabelFont
Shape Up
Series Bold
Color red
EndFont
End
要理解此语法的含义,请阅读手册的第 5.3 节Help->Customization
。
这是修改后的 LyX 文件
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass book
\begin_preamble
\newtheoremstyle{plain}
{\topsep} % ABOVESPACE
{\topsep} % BELOWSPACE
{\itshape} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\color{red}\bfseries} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{}
\newtheoremstyle{definition}
{\topsep} % ABOVESPACE
{\topsep} % BELOWSPACE
{\normalfont} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\color{red}\bfseries} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{}
\newtheoremstyle{remark}
{.5\topsep} % ABOVESPACE
{.5\topsep} % BELOWSPACE
{\normalfont} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\color{red}\itshape} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{}
\end_preamble
\use_default_options true
\begin_modules
theorems-ams
\end_modules
\maintain_unincluded_children false
\begin_local_layout
Format 66
Requires xcolor
ModifyStyle Theorem
LabelFont
Shape Up
Series Bold
Color red
EndFont
End
ModifyStyle Definition
LabelFont
Shape Up
Series Bold
Color red
EndFont
End
ModifyStyle Fact
LabelFont
Shape Up
Series Bold
Color red
EndFont
End
ModifyStyle Example
LabelFont
Shape Up
Series Bold
Color red
EndFont
End
\end_local_layout
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "Times New Roman"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts true
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\float_placement h
\paperfontsize default
\spacing single
\use_hyperref false
\papersize a4paper
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\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
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 2.5cm
\topmargin 2.5cm
\rightmargin 2.5cm
\bottommargin 2.5cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\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 Chapter
series
\end_layout
\begin_layout Section
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
10.4
\end_layout
\end_inset
Convergence & Divergence of Series
\end_layout
\begin_layout Definition
Let
\begin_inset Formula $\sum_{n=1}^{\infty}a_{n}$
\end_inset
a series, we call the sequence
\begin_inset Formula $\left\{ s_{n}\right\} _{n=1}^{\infty}$
\end_inset
the partial sums sequence.
\end_layout
\begin_layout Section
Divergence Test
\end_layout
\begin_layout Standard
Notice that for the two series that converged the series term itself was
zero in the limit.
This will always be true for convergent series and leads to the following
theorem.
\end_layout
\begin_layout Theorem
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
Theorem
\end_layout
\end_inset
If
\begin_inset Formula $\sum a_{n}$
\end_inset
converges then
\begin_inset Formula $\lim_{n\rightarrow\infty}a_{\mathrm{n}}=0$
\end_inset
.
\end_layout
\begin_layout Fact
Facts.
Given the series
\begin_inset Formula $\sum a_{n}$
\end_inset
,
\begin_inset Newline newline
\end_inset
1.
If
\begin_inset Formula $\sum a_{n}$
\end_inset
is absolutely convergent and its value is
\begin_inset Formula $s$
\end_inset
then any rearrangement of
\begin_inset Formula $\sum a_{n}$
\end_inset
will also have a value of
\begin_inset Formula $s$
\end_inset
.
\begin_inset Newline newline
\end_inset
2.
If
\begin_inset Formula $\sum a_{n}$
\end_inset
is conditionally convergent and
\begin_inset Formula $r$
\end_inset
is any real number then there is a rearrangement of
\begin_inset Formula $\sum a_{n}$
\end_inset
whose value will be
\begin_inset Formula $r$
\end_inset
.
\end_layout
\end_body
\end_document