我正在用 LYX 写一篇论文。我的所有方程式都已编号,并使用内置的所见即所得数学编辑器输入,除了一个方程式必须以 LATEX 输入。这弄乱了编辑器中的编号,没有计算 LATEX 方程式,但输出的 pdf 没问题。在输出的 pdf 文件中,方程式编号比编辑器中 LATEX 方程式后面的方程式大 1。lyx 编辑器中的方程式计数器必须与 LATEX 输出中的计数器不同。我如何正确同步它们?例如,我可以编写一个宏来将 1 添加到编辑器的计数器而不更改 LATEX 计数器吗?
答案1
从技术上讲,这并没有回答您的问题,所以如果您愿意,我可以删除它。但作为我上一条评论的延伸:在这篇文章的末尾,您将找到一个示例.lyx
文件。它演示了您的方法,以及使用gathered
或align
环境而不是array
。这两个环境都可以通过 GUI 获得,可以通过插入 --> 数学菜单,或者右键单击公式并查看插入。
与 相比array
,增加字体大小是没有必要的,因为它不使用\textstyle
(或其他任何array
使用的东西),并且 也是[2mm]
没有必要的,因为默认情况下行之间的空间比 的要大array
。
以下是显示这三种方法的屏幕截图。我个人可能会使用第三种方法。注意,我用 替换\mid
了\biggr|
。
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\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
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\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 Standard
Your method:
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
large
\end_layout
\begin_layout Plain Layout
\backslash
begin{equation}
\end_layout
\begin_layout Plain Layout
\backslash
begin{array}{c}
\end_layout
\begin_layout Plain Layout
F^{
\backslash
mu
\backslash
nu}(x)=
\backslash
frac{q}{V_{B}(s)
\backslash
cdot
\backslash
left(x-X_{B}(s)
\backslash
right)}
\backslash
\backslash
[2mm]
\end_layout
\begin_layout Plain Layout
\backslash
times
\backslash
frac{d}{ds}
\backslash
left[
\backslash
frac{
\backslash
left(x-X_{B}(s)
\backslash
right)^{
\backslash
mu}V_{B}^{
\backslash
nu}(s)-
\backslash
left(x-X_{B}(s)
\backslash
right)^{
\backslash
nu}V_{B}^{
\backslash
mu}(s)}{V_{B}(s)
\backslash
cdot
\backslash
left(x-X_{B}(s)
\backslash
right)}
\backslash
right]
\backslash
mid_{s=s_{r}}
\end_layout
\begin_layout Plain Layout
\backslash
end{array}
\end_layout
\begin_layout Plain Layout
\backslash
end{equation}
\end_layout
\begin_layout Plain Layout
\backslash
normalsize
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Alternative approach 1:
\begin_inset Formula
\begin{equation}
\begin{gathered}F^{\mu\nu}(x)=\frac{q}{V_{B}(s)\cdot\left(x-X_{B}(s)\right)}\\
\times\frac{d}{ds}\left[\frac{\left(x-X_{B}(s)\right)^{\mu}V_{B}^{\nu}(s)-\left(x-X_{B}(s)\right)^{\nu}V_{B}^{\mu}(s)}{V_{B}(s)\cdot\left(x-X_{B}(s)\right)}\right]\biggr|_{s=s_{r}}
\end{gathered}
\end{equation}
\end_inset
\end_layout
\begin_layout Standard
Alternative approach 2:
\begin_inset Formula
\begin{equation}
\begin{aligned}F^{\mu\nu}(x) & =\frac{q}{V_{B}(s)\cdot\left(x-X_{B}(s)\right)}\\
& \qquad\times\frac{d}{ds}\left[\frac{\left(x-X_{B}(s)\right)^{\mu}V_{B}^{\nu}(s)-\left(x-X_{B}(s)\right)^{\nu}V_{B}^{\mu}(s)}{V_{B}(s)\cdot\left(x-X_{B}(s)\right)}\right]\biggr|_{s=s_{r}}
\end{aligned}
\end{equation}
\end_inset
\end_layout
\end_body
\end_document