Math:输入一个公式

出自OOo 中文手册翻译

跳转到: 导航, 搜索

目录


有三种方法用于输入公式:

  • 选择窗口选择一个图标。
  • 在公式编辑器中点击右键,在弹出的快捷菜单上选择一个符号。 Right-click on the equation editor and select the symbol from the context menu.
  • 直接在编辑器中输入标记语言。 Type markup in the equation editor.

快捷菜单和选择窗口根据选定的符号输出标记语言。顺便说一句,这是学习OOoMath标记语言的便捷方法。 The context menu and the Selection window insert the markup corresponding to a symbol. Incidentally, this provides a convenient way to learn the OOoMath markup.

Image:documentation_note.png在文档中点击鼠标退出公式编辑器。
在公式上双击则重新进入公式的编辑状态。
  Click on the document body to exit the formula editor.
Double-click on a formula to enter the formula editor again.


[编辑] 选择窗口

输入公式的最简单的方法是利用下图的选择窗口。 The simplest method for entering a formula is the Selection window, shown below.

公式符号放置在不同的类别中

选择窗口分成两个主要部分: The Selection window is divided into two main portions.

  • 上部分为符号类别,点击后显示该类别的符号。 shows the symbol categories. Click on these to change the list of symbols.
  • 下部分列出当前类别的符号。 shows the symbols available in the current category.
Image:Tip.png您可以使用 视图 > 选择 来打开或者关闭选择窗口。
  


[编辑] 示例 1:5乘以4

本例子中我们输入一个简单的公式:5乘以4: For this example we will enter a simple formula: 5 × 4

选择窗口上:

  1. 选择在列表部分的左上角的图标。 Select the top-left button of the categories (top) section.
  2. 点击乘法符号。 Click on the multiplication symbol.
一元/二元运算符类别

当您选择乘法符号后发生了两个变化: When you select the multiplication symbol on the Selection window, two things happen:

  • 公式编辑器上显示了标记语句: <?> times <?> The equation editor shows the markup: <?> times <?>
  • 文档正文的灰色框中显示 □×□(<math>\Box\times\Box</math>)。 The body of the document shows a gray box with the figure: <math>\Box\times\Box</math>
点击乘法符号。

<?>为占位符,可以被其它内容替代。公式将自动更改,结果如下图所示。 The <?> symbols are placeholders that you can replace by other text. The equation will update automatically, and the result should resemble the figure below.

乘法的显示结果
在“times”两边输入“5”和“4”后的结果。 Result of entering "5" and "4" next to the "times" operator.

Image:Tip.png To keep the equation from updating automatically, select View > AutoUpdate display. To update a formula manually, press F9 or select View > Update.
  


[编辑] 右击快捷菜单

访问数学符号的另一种方式是在公式编辑器中右击鼠标,显示 图 6 的快捷菜单。 Another way to access mathematical symbols is to right-click on the equation editor. This produces a menu as shown in Figure 6.

右击快捷菜单。
Image:documentation_note.png快捷菜单上各项与选择窗口对应。
  


[编辑] 标记语言

您可以直接在编辑器中输入标记语言。例如,输入“5 times 4”则显示“5×4”(<math>5 \times 4</math>)。这是输入公式的最快捷的方式。 You can type the markup directly in the equation editor. For example, you can type “5 times 4" to obtain <math>5 \times 4</math>. If you know the markup, this can be the fastest way to enter a formula.

Image:Tip.png标记语言类似于英文的语法结构。
  As a mnemonic, the formula markup resembles the way the formula reads in English.


下面列出了一些简单的方程及对应的标记语句。 Below is a short list of common equations and their corresponding markup.

显示命令语句显示命令语句
a=ba = basqrt {a}
a2a^2ana_n
f(x)dxint f(x) dxansum a_n
a≤ba <= binfinity
a×ba times bx·yx cdot y

[编辑] 希腊字母

希腊字母(α, β, γ, θ等)在数学公式里很常用,但它们并不在选择窗口或者右击快捷菜单上。但调用它们的标记语法很简单,就是一个百分号(“%”)后面跟着字符的英文名字: Greek characters (α, β, γ, θ, etc.) are common in mathematical formulas. These characters are not available in the selection box or the right-click menu. Fortunately, the markup for Greek characters is simple: Type a % sign followed the name of the character, in English.

  • 小写的名字时对应小写的希腊字母; To type a lowercase character, write the name of the character in lowercase.
  • 大写的名字时对应大写的希腊字母。 To type an uppercase character, write the name of the character in uppercase.

下表列出一些示例: See the table below for some examples.

小写大写
%alpha α%ALPHA Α
%beta β%BETA Β
%gamma γ%GAMMA Γ
%psi ψ%PSI Ψ
%phi φ%PHI Φ
%theta θ%THETA Θ
Image:documentation_note.png在《Writer指南》中有完整的希腊字母表。
  


另一个输入希腊字母的方法是使用 工具 > 分类 的对话框窗口,在图标组下面的列表里面选择希腊语,然后双击列表中的希腊字母。 Another way to enter Greek characters is by using the catalog window. Go to Tools > Catalog. The catalog window is shown below. Under “Symbol Set" select “Greek" and double-click on a Greek letter from the list.

输入希腊字母的对话框。

[编辑] 示例 2: π≈3.14159

先做如下的假设:For this example we will suppose that:

  • 我们需要显示π的小数点后五位数字; We want to enter the above formula (the value of pi rounded to 5 decimal places).
  • 我们知道希腊字母π的名字为“pi”;We know the name of the Greek character ("pi").
  • 但是我们不知道约等于符号的标识语言。 But we do not know the markup associated with the <math>\simeq \!</math> symbol.

第一步:输入“%”,然后输入“pi”,这样显示希腊字母π; Type "%" followed by the text "pi". This displays the Greek character π.

第二步:打开选择窗口(视图 > 选择); Open the Selection window (View > Selection).

第三步:约等于符号(≈)属于关系类别,因此我们点击关系图标Image:MathRelBtn.png。当鼠标放在图标上时会显示工具提示“关系”。 The <math>\simeq \!</math> symbol is a relation, so we click on the relations button Image:MathRelBtn.png. If you hover the mouse over this button you see the tooltip "Relations".

关系图标的工具提示。

第四步:删除<?>并在公式后面输入“3.14159”。这时标记语言显示为%pi simeq 3.14159,结果显示如下: Delete the <?> text and add "3.14159" at the end of the equation. Hence we end up with the markup %pi simeq 3.14159. The result is shown below.

最终结果


[编辑] 相关链接

本文原文

个人工具