共用方式為


Microsoft Word EQ Field

Word’s first math editing facility was the EQ field. Some description of the EQ field and comparison to the Equation Editor, MathType and native math zones is given in Other Office Math Editing Facilities. For mathematical purposes, the native equation facility built into Word and other Office apps is better than the EQ field as illustrated by the examples in this post. But some spacing features of the EQ field aren’t available in the native math-zone facility and might be useful for other purposes.

Word’s current help facility does not document the EQ field, although it works as designed. In case you need to know more about the EQ field, this post gives documentation adapted from earlier Word help files.

Up until this month, a user could convert an EQ field into an Equation Editor OLE object. But starting this month, that is not possible since the Equation Editor is no longer available due to security concerns. See Error when editing an equation in Office for further information. One work around is that MathType can convert an EQ field into a MathType object. If you’ve been using the Equation Editor, it’s very worthwhile to install MathType. You can download MathType for free with the full features for 30 days and after that it still has more features than the Equation Editor, as well as being up-to-date security wise. Alternatively, you might want to check out https://0patch.blogspot.com/2018/01/bringing-abandoned-equation-editor-back.html. Even with that approach, it’s not easy to restore the Equation Editor since you have to reinstall the original eqnedt files and edit the registry.

Inserting EQ field

Word help does document most fields such as SaveDate. To insert a field using Word’s ribbon, click on Insert/Quick Parts/Field…, which brings up a dialog. Scrolling down to Eq and clicking on Field Codes and then on Options, you can see

The options dialog lists the switches along with a brief description. It doesn’t give any switch options, at least some of which are needed for all but the most basic arithmetic.  Once an EQ field is inserted, you can use the Toggle Field Codes context-menu option to toggle back and forth between displaying the built-up equation and the linear {EQ…} text. In the latter, you can insert Unicode math alphanumerics and add spacing to improve the typography (see examples in Other Office Math Editing Facilities). The EQ field examples in this post don’t have these enhancements.

{ EQ switches }

The EQ field produces mathematical expressions given by the switches. The switches specify how to build the equation with the elements, which are enclosed in parentheses. You can modify the behavior of a switch by following it with one or more switch options. A switch consists of a backslash (\) followed by a single letter. An option consists of a backslash followed by two letters and sometimes a number. Either EQ or eq can be used.

Some switches take a list of elements separated by commas or semicolons. Use commas as the separators if the decimal symbol for your system is a period. If the decimal symbol for your system is a comma, use semicolons.

To use a comma, open parenthesis, or backslash character in a resulting equation, precede the symbol with a backslash:  \,  \(  \\.

Switch Action
array: \a() Draw a two-dimensional array
bracket: \b() Bracket a single element
displace: \d() Move next character to left or right a specified number of points
fraction:  \f(,) Create a fraction
integral:  \i(,,) Create an integral, summation or product using the specified symbol or default symbol and three elements
list:  \l() Group values in a list, which can then be used as a single element
overstrike:  \o() Display each successive element on top of the previous one
radical:  \r(,) Draw a radical sign, using one or two elements
superscript or subscript:  \s() Position elements as superscripts or subscripts
box:  \x() Draw a border around an element

 

The following sections describe each of these switches along with their options. The spaces shown in the tables between the options and the numeric value n are present only for readability; they can be omitted. In the switch examples, the linear native math zones are given in UnicodeMath. Typing the UnicodeMath text into a math zone (type alt+= to insert a math zone) and then ctrl+= converts it to the built-up (Professional) display to the right of the UnicodeMath.

Array switch:  \a()

Display an array (matrix) of elements in multiple columns. The elements appear in order by rows. The following options modify the \a switch

Option.. Action
\al Align left within columns
\ac Align center within columns
\ar Align right within columns
\co n Array elements in n columns (default is 1)
\vs n Add n points of vertical spacing between lines
\hs n Add n points of horizontal spacing between columns

Example

{ EQ \a \ac \co2 \vs3 \hs3(Axy,Bxy,A,B) }
\matrix(Axy&Bxy@A&B)

Bracket:  \b()

Enclose an element with bracket(s) sized to fit the element. The default brackets are parentheses. The options listed in the following table can modify the \b switch.

Option.. Action
\lc\c Draw left bracket using the character c.
\rc\c Draw right bracket using the character c.
\bc\c  Draw both bracket characters using the character specified for c. If the character you specify is {, [, (, or <, Word uses the corresponding closing character as the right bracket. If you specify any other character, Word uses that character for both brackets.

Example

{ EQ \b \bc\{ (\r(3,x)) }
{\sqrt(3&x)}

Displace:  \d()

Displace the next character according to the option(s) for the \d switch. The empty parentheses follow the last option. This switch doesn’t have a counterpart in native math zones, but Unicode spaces can be entered as desired in native math zones.

Option.. Action
\fo n () Displace n points to the right
\ba n () Displace n points to the left
\li () Underline the space up to the next character

Example

"Before { EQ \d \fo10 \li() } after" displays Before __ after

Fraction:  \f(,)

Create a fraction with the numerator centered over the denominator. If your system uses a comma as the decimal symbol, separate the two elements with a semicolon.

Example

{ EQ \f(2,RateChange) }
2/"RateChange"

Integral:  \i(,,)

Create an integral, summation or product using the specified symbol or default symbol and three elements. The first element is the lower limit, the second is the upper limit, and the third is the integrand, sum or product. The options listed in the following table modify the \i switch. By default the n-ary symbol is ∫.

Option.. Action
\su Change n-ary symbol to Σ and create a summation
\pr Change n-ary symbol to Π and create a product
\in Use inline formatting (display limits to right of the n-ary symbol instead of above and below)
\fc\c Substitute a fixed-height character specified by c for the n-ary symbol
\vc\c Substitute a variable-height character specified by c for the n-ary symbol. The symbol matches the height of the third element.

Example

{ EQ \i \su(n=1,5,n) }
\sum_(n=1)^5 n

List:  \l()

Create a list of elements separated by commas or semicolons, so that multiple elements act as a single element. Native math zones don’t need this construct.

Example

{ EQ \l(A,B,C,D,E) } displays A,B,C,D,E

Overstrike:  \o()

Place each successive element on top of the previous one. Any number of elements is allowed. Separate multiple elements with commas. Each character is printed within an invisible character box. Options align the boxes on top of one another. This functionality can be obtained using the phantom operators (see Section 3.17 of the UnicodeMath specification) in native math zones. The following options modify the \o switch

Option.. Align character boxes
\al At left edge
\ac In the center (default)
\ar At right edge

Example

{EQ \o(J,w) }
\hsmash(J)w

Radical:  \r(,)

Draw a radical using one or two elements.

{ EQ \r(n,x) }  
\sqrt(n&x)

Superscript or Subscript:  \s()

Place an element or elements as superscript or subscript characters. Each \s code can have one or more elements; separate the elements with commas. If more than one element is specified, the elements are stacked and left-aligned. The following options place single elements after the \s switch

Option.. Action
\ai n () Add n points of space above a line in a paragraph
\up n () Move a single element above the baseline by n points. The default is 2 points
\di n () Add n points of space below a line in a paragraph
\do n () Move a single element below the baseline by n points. The default is 2 points

Example

a{eq \s\do4(b{eq \s\do3(c)})}
a_b_c

Box:  \x()

Create a border for an element. When used without options, this switch draws a box around the element. The following options modify the \x switch

Switch.. Draws a border
\to above element
\bo below element
\le left of element
\ri right of element

Example (Word currently ignores the 12& in the UnicodeMath, but its context menu lets you hide borders)

{ EQ \x \to \bo(5) }
\rect(12&5)

Miscellaneous Examples

The arrangement of these examples is the {eq…} field on a line followed by a line with the corresponding UnicodeMath followed, in turn, by the built-up displays of the eq field and UnicodeMath. The symbol ⁡[boxed fn]⁡ can be entered by \funcapply (there are easier ways to type it and the integrals if one can use the → key)

{ eq \a\ac\vs1\co1(lim,n→∞) \b(\f(n,n2 + 12) + \f(n,n2 + 22) + ... + \f(n,n2 + n2))}

lim_(n→∞) (n/(n^2+1^2 )+n/(n^2+2^2 )+…+n/(n^2+n^2 ))

.....

 

{ eq \I(,,  \b(\f(x,x2 + 3x + 2)))\s\up10(2)}

∫  (x/(x^2+3x+2))^2 dx

.....

 

{ eq \i\in( tan x, \s\up2(sec x), \b(\r(3) )\s\up4(t)\s\up7(2)  dt)}

\int_(tan x)^(sec ⁡x) (\sqrt 3)^𝑡^2

.....

 

{ eq \b\bc\|(\i\in( 0, 1,f(t) dt) - \i\su(k=0,n-1,\f(1,2n) \b\bc\[(f\b(\f(k+1,n)) + f\b(\f(k,n))))) ≤ \f(M,12n²)}

|\int_0^1\of f(t)dt-\sum_(k=0)^(n-1)\of\begin 1/2n [f(k+1/n)+f(k/n)]\end|\leq M/12n^2

.....

 

{ eq \b(\a\ac\vs2\hs2\col3(cos θ,-sin θ, 0, sin θ, cos θ, 0, 0, 0, 1))\s\up20(n)}

(\matrix(cos θ&-sin θ&0@sin θ&cos θ&0@0&0&1))^n

 .....

 

{ eq f(x) =\b\lc\{(\a\al\vs3\hs14\col2(x,if x>0,0,if x=0,-x,if x<0)) }

f(x)=\cases(x &"if" x>0@0 &"if" x=0@-x &"if" x<0)

.....

 

{eq eq \o(\o(x,\s\do6(~)),\s\up5(^))}

x\hat\below~

.....

Comments

  • Anonymous
    May 31, 2018
    Dear Murray, thanks for your insights on EQ. Very helpful !!I have been exploring the possibility of using EQ field to produce interlinear Bible. So far it works perfectly well for one single word/EQ :{EQ \a \co1 (N-NMS,Ἰακὼβ,Ἰακώβ,Jacob)}but as the number of words/EQs increase to a dozen, Word-2016 (16.0.0926.2114) slows down dramatically and becomes unusable.Could you help me on this? Thanks in advance !!
    • Anonymous
      September 28, 2018
      Have you tried using Word's ruby-text feature? It's intended for East Asian annotations, but it works well with other scripts.