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.

  • 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 9 '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 9 '13 at 15:29
  • @StevenB.Segletes That's a valid answer, but I expect more objective ones :) – jub0bs May 9 '13 at 15:29
  • 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 9 '13 at 15:39
  • 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 9 '13 at 15:52

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.


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


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 1: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:) – Andrew May 10 '13 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.