12

This is a follow-up question to How can I convert my TeX-illiterate coworkers to LaTeX?.

To better demonstrate the power of TeX & friends and dismiss the competition (e.g. MS Word, Open Office), I need to cover all the bases. In particular, I know that MS Word offers the possibility of programming macros, to automate some repetitive tasks.

I know close to nothing about Word macros and what they have to offer. Of course, I intend to do my homework and gauge their potential (or lack thereof :p ); but, for now, I'm interested in what you think.

If you are familiar with both Word macros and TeX & friends, please give me your perspective on the comparative strengths & limitations of the former, when used to typeset a document.

jub0bs
  • 58,916
  • 5
    Why would I be familiar with present Word capabilities? It's like a nightmare from my deep past. I would require hypnotic regression to answer your question. (I forgot to add the smiley emoticon :^) But as of 8 years ago, figure placement was awful, with figures jumping around randomly with any edit whatsoever. While I heard it could auto-renumber figures, tables, equations, I newer knew anyone who actually used those features (thus, they must not have been straightforward to use). Likewise for toc, lof, and lot's. – Steven B. Segletes May 09 '13 at 15:29
  • Hmmm... It is easy to set up a database in MS Office for use in mail merges with the combination of Word, Access and/or Excel especially with the help of a mail merge wizard. Even people who have not used it before will find it very intuitive to use. Same thing can be said about Libre/OpenOffice' combination of Writer, Base and/or Calc. Of course datatool is more flexible, but many first time users from the MS block will find it too demanding of their time and efforts, sad to say :( – hpesoj626 May 09 '13 at 15:29
  • @StevenB.Segletes That's a valid answer, but I expect more objective ones :) – jub0bs May 09 '13 at 15:29
  • TeX is used via editors so you are inviting an editor war here :) Just to get it out of the way, Emacs and Vim belittles Word and its macros in a couple of shortcuts. And VB environment for ease of use is an oxymoron. – percusse May 09 '13 at 15:30
  • @percusse Starting a flame war is not my intention :) – jub0bs May 09 '13 at 15:32
  • 1
    And don't forget change-tracking, when interacting with your org's mandatory tech pubs interface. If anything is done to your LaTeX doc, the change is immediately obvious with ASCII comparison. In Word, as I recall, subtle (supposedly) non-printing changes to the format could adversely affect other document parts. Then there's the problem where Bill Gates auto-changes your text, because he knows better what you want than you do. This can result in inadvertantly capitalized math, etc. – Steven B. Segletes May 09 '13 at 15:39
  • Two more things that MS office users love about Word: lists and tables. Many of them will complain about how difficult it is to set these up in LaTeX. If you have used Word in the past, though, as much as I had, you would know that the behavior of lists in Word is very hard to control. One time it is showing in upper case Roman, upon hitting enter you might get an upper case alphabet list. – hpesoj626 May 09 '13 at 15:50
  • @hpesoj626 Yes, I find lists waaaayyy easier to typeset in LaTeX than in Word; the jumping around in Word is just horrendous! When it comes to tables, though, I don't think LaTeX is that user-friendly... – jub0bs May 09 '13 at 15:52
  • 1
    You can write Word or office macros by your own including malware or viruses. That's the reason why office had a massive security problem if you use macros. Just have a look into the virus lists. Conclusion: better do nor use Word/office macros. Resulting conclusion: better use LaTeX ;-) – Mensch May 09 '13 at 15:52
  • @Jubobs It is waaayyy easier to produce tables in Word... but waayyy easier to produce ugly ones there too. I think most Word users actually don't care much about how their tables appear. And it is very easy to ignore the oftentimes horrible, automatic, word-wrapping in table cells. – hpesoj626 May 09 '13 at 16:04
  • @hpesoj626 I agree with you, but I still think that typesetting tables in LaTeX is a bit of a pain. No pain, no gain, I suppose... – jub0bs May 09 '13 at 16:09

3 Answers3

12

I'm not an expert on this, but here's my take:

MS Office and other Microsoft products (Internet Explorer, etc.) all expose an API for scripting. You can use this API from Office macros, written in VBA - Visual Basic for Applications, embedded into the document; or separate script files written in JScript (MS's JavaScript dialect) or VBScript. Here is a sample of what you can do.

Essentially, everything that you can do in Office by clicking around can be automated. Every button and feature has its equivalent API function. A huge advantage over (PDF)TeX is that there are "proper" programming languages at your hand, though LuaTeX also offers one. VBA is easier to learn than macro programming. On the other hand if you look around on CTAN, somebody has likely already written the stuff you need for TeX. There is no "CMSWAN" :)

I don't agree with Steven Segletes; TeX is also a bit whimsical when placing figures. Someone who uses Word's capabilities to automatically generate TOC/LOF/LOT/numbering is considered an Office wizard - maybe just as much as we are all considered TeX geeks by people around us. I do know Office wizards. I also think that browsing the docs for the Word API and browsing the LaTeX packages and their manuals to achieve what you want are equally time-consuming and equally fun tasks.

Example: I was given some hundred Word documents which composed a book. Each file corresponded to a subsection and the filename was the number of the first page of that subsection. Chapters had their own numbered folders. So if you wanted to find something, you had to open the chapter folder, open the TOC for that chapter, look up the page number for the title and open that file. So I put together a script that opens each file, reads the first paragraph which should be the title, and writes a new TOC that has the titles hyperlinked to the files.

But I've seen Excel sheets that downloaded databases, accessed web APIs, created 3D plots etc. at the click of a button, all done in tons of VBA.

marczellm
  • 11,809
2

It's a comment rather than an exact answer since marczellm 's answer has summed up well.

1

This is nothing to do with macros, but word's "Track changes" feature is really nice. As far as I am aware there is nothing comparable for tex, at least when you are using standard tex editors such as vim, emacs, texshop, ... - although it is possible to concoct poor relatives of word's track-changes using things like patch and git etc.

Of course the underlying "problem" is that tex works with "flat" files which don't naturally have a way of encoding the changes that are made between versions.

  • 1
    In keeping with the UNIX philosophy that TeX cohabits with (though doesn't exactly partake of, since it's not a UNIX-specific tool) there is an individual utility for every independent task. People always recommend using VCS software such as git or subversion for tracking changes. Objecting to its absence from "tex" is like objecting to the absence of a text editor from tex. – Ryan Reich May 10 '13 at 01:40
  • @RyanReich I wasn't "objecting" to its absence but rather saying that it was nice that word had this. I also mentioned git etc as a workaround:) –  May 10 '13 at 07:02