In my latest article for PCPlus, I had to replicate an equation with several clauses, like this one from Wikipedia:
I fired up Word 2007 to use its new Equation Editor, since it's the best tool I have for this kind of work.
The "sgn x" bit I did via the Function menu, selecting "sin", and modifying the name of the function.
Adding the brace was fine — there's a "structure" for it (as EE calls them).
But that's only one block to type anything in. I messed around trying to put a carriage return in there somehow, when I suddenly realized there was probably a structure with three input blocks, vertically. Yep, there is, in the Matrix menu.
I then filled in the blanks to get this:
Which is nasty. One of the problems is that the equation editor thinks text should be italicized since it's forming part of the expression. Even converting the ifs to Normal text doesn't help, since the clauses won't line up vertically. I did think about adding some spaces to line things up, but, no, abandon that.
Next attempt was inserting a matrix of 6 cells in a 2x3 arrangement.
Which finally gave me this, after setting the ifs to normal text:
Having done that, I then applied what I'd learnt to the real equation I was trying to replicate, and got this:
Which I wasn't too happy with. I really wanted the clauses in the right column to line up on the left. I played around for a little while (no, paragraph justify left doesn't work) and got to the answer: right-click on an element in that second column and select Column Alignment, Left. Adding some parentheses gave me this, which I feel is very readable.
The interesting thing is, this equation editor is only available in docx files in Word 2007. As soon as you convert the file to a Word 2003 doc file, you get a warning and the equation is converted into an image.
Also, a handy hint: if you are editing a Word document and you want to insert an equation, your instinct is to go to the Insert tab, and click on Equation. If it's disabled, you are editing a doc file and not a docx file. Save the file as docx, and the item will be enabled.
Oh, before you ask, the equation is part of the DCT (Discrete Cosine Transform) in the JPG compression algorithm.
Now playing:
Pet Shop Boys - Walking on thin ice
(from Disco Four)
No Responses
Feel free to add a comment...
Leave a response
Note: some MarkDown is allowed, but HTML is not. Expand to show what's available.
_emphasis_
**strong**
[text](url)
`IEnumerable`
* an item
1. an item
> Now is the time...
Preview of response